better variable name for midi feedback fighter. added MCU midi port to system ardour.rc

git-svn-id: svn://localhost/ardour2/trunk@1680 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Jesse Chappell 2007-04-07 17:01:33 +00:00
parent 8f3b0ba643
commit 946ccff52e
3 changed files with 9 additions and 8 deletions

View File

@ -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"/>

View File

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

View File

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