diff options
-rw-r--r-- | ardour.rc.in | 1 | ||||
-rw-r--r-- | libs/surfaces/generic_midi/midicontrollable.cc | 14 | ||||
-rw-r--r-- | libs/surfaces/generic_midi/midicontrollable.h | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/ardour.rc.in b/ardour.rc.in index ab34ae29d4..44738f8062 100644 --- a/ardour.rc.in +++ b/ardour.rc.in @@ -2,6 +2,7 @@ <Ardour> <MIDI-port tag="%MIDITAG%" device="ardour" type="%MIDITYPE%" mode="duplex"/> <MIDI-port tag="control" device="ardour" type="%MIDITYPE%" mode="duplex"/> + <MIDI-port tag="mcu" device="ardour" type="%MIDITYPE%" mode="duplex"/> <Config> <Option name="minimum-disk-io-bytes" value="262144"/> <Option name="track-buffer-seconds" value="5.000000"/> diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc index 71cdde3fd3..1f00e58167 100644 --- a/libs/surfaces/generic_midi/midicontrollable.cc +++ b/libs/surfaces/generic_midi/midicontrollable.cc @@ -35,7 +35,7 @@ MIDIControllable::MIDIControllable (Port& p, Controllable& c, bool is_bistate) : controllable (c), _port (p), bistate (is_bistate) { setting = false; - last_written = 0; // got a better idea ? + last_value = 0; // got a better idea ? control_type = none; _control_description = "MIDI Control: none"; control_additional = (byte) -1; @@ -143,7 +143,7 @@ MIDIControllable::midi_sense_note (Parser &p, EventTwoBytes *msg, bool is_on) } } - last_written = (MIDI::byte) (controllable.get_value() * 127.0); // to prevent feedback fights + last_value = (MIDI::byte) (controllable.get_value() * 127.0); // to prevent feedback fights } void @@ -160,7 +160,7 @@ MIDIControllable::midi_sense_controller (Parser &, EventTwoBytes *msg) } } - last_written = (MIDI::byte) (controllable.get_value() * 127.0); // to prevent feedback fights + last_value = (MIDI::byte) (controllable.get_value() * 127.0); // to prevent feedback fights } } @@ -171,7 +171,7 @@ MIDIControllable::midi_sense_program_change (Parser &p, byte msg) if (!bistate) { controllable.set_value (msg/127.0); - last_written = (MIDI::byte) (controllable.get_value() * 127.0); // to prevent feedback fights + last_value = (MIDI::byte) (controllable.get_value() * 127.0); // to prevent feedback fights } } @@ -183,7 +183,7 @@ MIDIControllable::midi_sense_pitchbend (Parser &p, pitchbend_t pb) /* XXX gack - get rid of assumption about typeof pitchbend_t */ controllable.set_value ((pb/(float) SHRT_MAX)); - last_written = (MIDI::byte) (controllable.get_value() * 127.0); // to prevent feedback fights + last_value = (MIDI::byte) (controllable.get_value() * 127.0); // to prevent feedback fights } void @@ -313,11 +313,11 @@ MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool force) MIDI::byte gm = (MIDI::byte) (controllable.get_value() * 127.0); - if (gm != last_written) { + if (gm != last_value) { *buf++ = (0xF0 & control_type) | (0xF & control_channel); *buf++ = control_additional; /* controller number */ *buf++ = gm; - last_written = gm; + last_value = gm; bufsize -= 3; } } diff --git a/libs/surfaces/generic_midi/midicontrollable.h b/libs/surfaces/generic_midi/midicontrollable.h index 7e0243971c..4bac325feb 100644 --- a/libs/surfaces/generic_midi/midicontrollable.h +++ b/libs/surfaces/generic_midi/midicontrollable.h @@ -67,7 +67,7 @@ class MIDIControllable : public Stateful PBD::Controllable& controllable; MIDI::Port& _port; bool setting; - MIDI::byte last_written; + MIDI::byte last_value; bool bistate; int midi_msg_id; /* controller ID or note number */ sigc::connection midi_sense_connection[2]; |