mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: unified dsl_ns macro
This commit is contained in:
parent
28aacd7cbc
commit
08730df042
8 changed files with 524 additions and 510 deletions
|
|
@ -25,7 +25,7 @@ impl HasSceneScroll for Arrangement {
|
|||
fn scene_scroll (&self) -> usize { self.scene_scroll }
|
||||
}
|
||||
|
||||
pub type SceneWith<'a, T: Send + Sync> = (usize, &'a Scene, usize, usize, T);
|
||||
pub type SceneWith<'a, T> = (usize, &'a Scene, usize, usize, T);
|
||||
|
||||
impl<T: HasScenes + HasTracks> AddScene for T {}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,10 +139,10 @@ impl TrackCommand {
|
|||
std::mem::swap(&mut color, &mut track.color);
|
||||
Ok(Some(Self::SetColor { color }))
|
||||
}
|
||||
fn set_mute (track: &mut Track, value: Option<bool>) -> Perhaps<Self> {
|
||||
fn set_mute (_track: &mut Track, _value: Option<bool>) -> Perhaps<Self> {
|
||||
todo!()
|
||||
}
|
||||
fn set_solo (track: &mut Track, value: Option<bool>) -> Perhaps<Self> {
|
||||
fn set_solo (_track: &mut Track, _value: Option<bool>) -> Perhaps<Self> {
|
||||
todo!()
|
||||
}
|
||||
fn set_rec (track: &mut Track, value: Option<bool>) -> Perhaps<Self> {
|
||||
|
|
@ -155,10 +155,10 @@ impl TrackCommand {
|
|||
let value = value.unwrap_or(!current);
|
||||
Ok((value != current).then_some(Self::SetRec { value: Some(current) }))
|
||||
}
|
||||
fn set_size (track: &mut Track, size: usize) -> Perhaps<Self> {
|
||||
fn set_size (_track: &mut Track, _size: usize) -> Perhaps<Self> {
|
||||
todo!()
|
||||
}
|
||||
fn set_zoom (track: &mut Track, zoom: usize) -> Perhaps<Self> {
|
||||
fn set_zoom (_track: &mut Track, _zoom: usize) -> Perhaps<Self> {
|
||||
todo!()
|
||||
}
|
||||
fn stop (track: &mut Track) -> Perhaps<Self> {
|
||||
|
|
|
|||
|
|
@ -63,11 +63,11 @@ pub(crate) fn button_play_pause (playing: bool) -> impl Content<TuiOut> {
|
|||
impl Default for ViewCache {
|
||||
fn default () -> Self {
|
||||
let mut beat = String::with_capacity(16);
|
||||
write!(beat, "{}", Self::BEAT_EMPTY);
|
||||
let _ = write!(beat, "{}", Self::BEAT_EMPTY);
|
||||
let mut time = String::with_capacity(16);
|
||||
write!(time, "{}", Self::TIME_EMPTY);
|
||||
let _ = write!(time, "{}", Self::TIME_EMPTY);
|
||||
let mut bpm = String::with_capacity(16);
|
||||
write!(bpm, "{}", Self::BPM_EMPTY);
|
||||
let _ = write!(bpm, "{}", Self::BPM_EMPTY);
|
||||
Self {
|
||||
beat: Memo::new(None, beat),
|
||||
time: Memo::new(None, time),
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ impl PoolClipCommand {
|
|||
Ok(Self::Add { index, clip }.execute(pool)?)
|
||||
}
|
||||
|
||||
fn export (pool: &mut Pool, index: usize, path: PathBuf) -> Perhaps<Self> {
|
||||
fn export (_pool: &mut Pool, _index: usize, _path: PathBuf) -> Perhaps<Self> {
|
||||
todo!("export clip to midi file");
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ impl PoolClipCommand {
|
|||
|
||||
#[tengri_proc::command(Pool)]
|
||||
impl RenameCommand {
|
||||
fn begin (pool: &mut Pool) -> Perhaps<Self> {
|
||||
fn begin (_pool: &mut Pool) -> Perhaps<Self> {
|
||||
unreachable!();
|
||||
}
|
||||
fn cancel (pool: &mut Pool) -> Perhaps<Self> {
|
||||
|
|
@ -165,7 +165,7 @@ impl RenameCommand {
|
|||
return Ok(None)
|
||||
}
|
||||
fn confirm (pool: &mut Pool) -> Perhaps<Self> {
|
||||
if let Some(PoolMode::Rename(clip, ref mut old_name)) = pool.mode_mut().clone() {
|
||||
if let Some(PoolMode::Rename(_clip, ref mut old_name)) = pool.mode_mut().clone() {
|
||||
let old_name = old_name.clone();
|
||||
*pool.mode_mut() = None;
|
||||
return Ok(Some(Self::Set { value: old_name }))
|
||||
|
|
@ -173,7 +173,7 @@ impl RenameCommand {
|
|||
return Ok(None)
|
||||
}
|
||||
fn set (pool: &mut Pool, value: Arc<str>) -> Perhaps<Self> {
|
||||
if let Some(PoolMode::Rename(clip, ref mut old_name)) = pool.mode_mut().clone() {
|
||||
if let Some(PoolMode::Rename(clip, ref mut _old_name)) = pool.mode_mut().clone() {
|
||||
pool.clips()[clip].write().unwrap().name = value;
|
||||
}
|
||||
return Ok(None)
|
||||
|
|
@ -182,7 +182,7 @@ impl RenameCommand {
|
|||
|
||||
#[tengri_proc::command(Pool)]
|
||||
impl CropCommand {
|
||||
fn begin (pool: &mut Pool) -> Perhaps<Self> {
|
||||
fn begin (_pool: &mut Pool) -> Perhaps<Self> {
|
||||
unreachable!()
|
||||
}
|
||||
fn cancel (pool: &mut Pool) -> Perhaps<Self> {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ impl Sampler {
|
|||
impl SamplerCommand {
|
||||
fn record_toggle (sampler: &mut Sampler, slot: usize) -> Perhaps<Self> {
|
||||
let recording = sampler.recording.as_ref().map(|x|x.0);
|
||||
Self::record_finish(sampler);
|
||||
Self::record_finish(sampler)?;
|
||||
// autoslice: continue recording at next slot
|
||||
if recording != Some(slot) {
|
||||
Self::record_begin(sampler, slot)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue