mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-04-28 05:20:14 +02:00
18 lines
605 B
Rust
18 lines
605 B
Rust
use tek_midi::*;
|
|
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 = ExampleClips(Arc::new(vec![].into()));
|
|
PoolClipCommand::Import(0, std::path::PathBuf::from("./example.mid")).execute(&mut clips)?;
|
|
Ok(())
|
|
}
|