mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
20 lines
654 B
Rust
20 lines
654 B
Rust
use tek::*;
|
|
use tengri::input::*;
|
|
use std::sync::*;
|
|
struct ExampleClips(Arc<RwLock<Vec<Arc<RwLock<MidiClip>>>>>);
|
|
impl HasClips for ExampleClips {
|
|
fn clips (&self) -> RwLockReadGuard<'_, Vec<Arc<RwLock<MidiClip>>>> {
|
|
self.0.read().unwrap()
|
|
}
|
|
fn clips_mut (&self) -> RwLockWriteGuard<'_, Vec<Arc<RwLock<MidiClip>>>> {
|
|
self.0.write().unwrap()
|
|
}
|
|
}
|
|
fn main () -> Result<(), Box<dyn std::error::Error>> {
|
|
let mut clips = Pool::default();//ExampleClips(Arc::new(vec![].into()));
|
|
PoolClipCommand::Import {
|
|
index: 0,
|
|
path: std::path::PathBuf::from("./example.mid")
|
|
}.execute(&mut clips)?;
|
|
Ok(())
|
|
}
|