mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
support multiple midi ins in PhrasePlayer::process
This commit is contained in:
parent
325492ec42
commit
02f691c494
3 changed files with 51 additions and 66 deletions
|
|
@ -423,7 +423,7 @@ impl<E: Engine> PhrasePlayer<E> {
|
|||
pub fn toggle_monitor (&mut self) { self.monitoring = !self.monitoring; }
|
||||
pub fn toggle_record (&mut self) { self.recording = !self.recording; }
|
||||
pub fn toggle_overdub (&mut self) { self.overdub = !self.overdub; }
|
||||
pub fn enqueue_next (&mut self, phrase: Option<&Arc<RwLock<Phrase>>>) {
|
||||
pub fn enqueue_next (&mut self, phrase: Option<&Arc<RwLock<Phrase>>>) {
|
||||
let start = self.clock.next_launch_pulse();
|
||||
self.next_phrase = Some((start.into(), phrase.map(|p|p.clone())));
|
||||
self.reset = true;
|
||||
|
|
@ -433,6 +433,21 @@ impl<E: Engine> PhrasePlayer<E> {
|
|||
.map(|(started,_)|started.load(Ordering::Relaxed))
|
||||
.map(|started|started - self.clock.sample())
|
||||
}
|
||||
pub fn playing_phrase (&self) -> Option<(usize, Arc<RwLock<Phrase>>)> {
|
||||
if let (
|
||||
Some(TransportState::Rolling),
|
||||
Some((start_frame, _)),
|
||||
Some((_started, Some(ref phrase)))
|
||||
) = (
|
||||
*self.clock.playing.read().unwrap(),
|
||||
self.started,
|
||||
&self.phrase
|
||||
) {
|
||||
Some((start_frame, phrase.clone()))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Displays and edits phrase length
|
||||
pub struct PhraseLength<E: Engine> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue