Feat: begin slight refactoring
Some checks failed
Deploy Website / deploy (push) Failing after 4m46s
Some checks failed
Deploy Website / deploy (push) Failing after 4m46s
This commit is contained in:
40
src/main.rs
40
src/main.rs
@@ -146,7 +146,7 @@ fn main() -> io::Result<()> {
|
||||
audio_sample_pos: Arc::clone(&audio_sample_pos),
|
||||
sample_rate: Arc::clone(&sample_rate_shared),
|
||||
lookahead_ms: Arc::clone(&lookahead_ms),
|
||||
cc_memory: Some(Arc::clone(&app.midi.cc_memory)),
|
||||
cc_access: Some(Arc::new(app.midi.cc_memory.clone()) as Arc<dyn crate::model::CcAccess>),
|
||||
#[cfg(feature = "desktop")]
|
||||
mouse_x: Arc::clone(&mouse_x),
|
||||
#[cfg(feature = "desktop")]
|
||||
@@ -257,22 +257,48 @@ fn main() -> io::Result<()> {
|
||||
// Process pending MIDI commands
|
||||
while let Ok(midi_cmd) = midi_rx.try_recv() {
|
||||
match midi_cmd {
|
||||
engine::MidiCommand::NoteOn { device, channel, note, velocity } => {
|
||||
engine::MidiCommand::NoteOn {
|
||||
device,
|
||||
channel,
|
||||
note,
|
||||
velocity,
|
||||
} => {
|
||||
app.midi.send_note_on(device, channel, note, velocity);
|
||||
}
|
||||
engine::MidiCommand::NoteOff { device, channel, note } => {
|
||||
engine::MidiCommand::NoteOff {
|
||||
device,
|
||||
channel,
|
||||
note,
|
||||
} => {
|
||||
app.midi.send_note_off(device, channel, note);
|
||||
}
|
||||
engine::MidiCommand::CC { device, channel, cc, value } => {
|
||||
engine::MidiCommand::CC {
|
||||
device,
|
||||
channel,
|
||||
cc,
|
||||
value,
|
||||
} => {
|
||||
app.midi.send_cc(device, channel, cc, value);
|
||||
}
|
||||
engine::MidiCommand::PitchBend { device, channel, value } => {
|
||||
engine::MidiCommand::PitchBend {
|
||||
device,
|
||||
channel,
|
||||
value,
|
||||
} => {
|
||||
app.midi.send_pitch_bend(device, channel, value);
|
||||
}
|
||||
engine::MidiCommand::Pressure { device, channel, value } => {
|
||||
engine::MidiCommand::Pressure {
|
||||
device,
|
||||
channel,
|
||||
value,
|
||||
} => {
|
||||
app.midi.send_pressure(device, channel, value);
|
||||
}
|
||||
engine::MidiCommand::ProgramChange { device, channel, program } => {
|
||||
engine::MidiCommand::ProgramChange {
|
||||
device,
|
||||
channel,
|
||||
program,
|
||||
} => {
|
||||
app.midi.send_program_change(device, channel, program);
|
||||
}
|
||||
engine::MidiCommand::Clock { device } => app.midi.send_realtime(device, 0xF8),
|
||||
|
||||
Reference in New Issue
Block a user