mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
This commit is contained in:
parent
573534a9a6
commit
447638ee71
30 changed files with 824 additions and 548 deletions
|
|
@ -21,11 +21,11 @@ pub struct Clock {
|
|||
/// Size of buffer in samples
|
||||
pub chunk: Arc<AtomicUsize>,
|
||||
/// For syncing the clock to an external source
|
||||
pub midi_in: Arc<RwLock<Option<JackMidiIn>>>,
|
||||
pub midi_in: Arc<RwLock<Option<MidiInput>>>,
|
||||
/// For syncing other devices to this clock
|
||||
pub midi_out: Arc<RwLock<Option<JackMidiOut>>>,
|
||||
pub midi_out: Arc<RwLock<Option<MidiOutput>>>,
|
||||
/// For emitting a metronome
|
||||
pub click_out: Arc<RwLock<Option<JackAudioOut>>>,
|
||||
pub click_out: Arc<RwLock<Option<AudioOutput>>>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Clock {
|
||||
|
|
@ -56,9 +56,9 @@ impl Clock {
|
|||
offset: Arc::new(Moment::zero(&timebase)),
|
||||
started: RwLock::new(None).into(),
|
||||
timebase,
|
||||
midi_in: Arc::new(RwLock::new(Some(JackMidiIn::new(jack, "M/clock", &[])?))),
|
||||
midi_out: Arc::new(RwLock::new(Some(JackMidiOut::new(jack, "clock/M", &[])?))),
|
||||
click_out: Arc::new(RwLock::new(Some(JackAudioOut::new(jack, "click", &[])?))),
|
||||
midi_in: Arc::new(RwLock::new(Some(MidiInput::new(jack, "M/clock", &[])?))),
|
||||
midi_out: Arc::new(RwLock::new(Some(MidiOutput::new(jack, "clock/M", &[])?))),
|
||||
click_out: Arc::new(RwLock::new(Some(AudioOutput::new(jack, "click", &[])?))),
|
||||
};
|
||||
if let Some(bpm) = bpm {
|
||||
clock.timebase.bpm.set(bpm);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue