wip: general overhaul of core and ports
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-05-20 22:05:09 +03:00
parent 573534a9a6
commit 447638ee71
30 changed files with 824 additions and 548 deletions

View file

@ -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);