13
0

next step of generic MIDI feedback fix - remove static _send_feedback from MIDI controllables

git-svn-id: svn://localhost/ardour2/trunk@1225 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-12-19 14:13:00 +00:00
parent 62c718f7f4
commit 1f4a82cb8e
3 changed files with 10 additions and 7 deletions

View File

@ -39,7 +39,7 @@ opts.AddOptions(
BoolOption('LIBLO', 'Compile with support for liblo library', 1), BoolOption('LIBLO', 'Compile with support for liblo library', 1),
BoolOption('NLS', 'Set to turn on i18n support', 1), BoolOption('NLS', 'Set to turn on i18n support', 1),
PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'), PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
BoolOption('SURFACES', 'Build support for control surfaces', 0), BoolOption('SURFACES', 'Build support for control surfaces', 1),
BoolOption('SYSLIBS', 'USE AT YOUR OWN RISK: CANCELS ALL SUPPORT FROM ARDOUR AUTHORS: Use existing system versions of various libraries instead of internal ones', 0), BoolOption('SYSLIBS', 'USE AT YOUR OWN RISK: CANCELS ALL SUPPORT FROM ARDOUR AUTHORS: Use existing system versions of various libraries instead of internal ones', 0),
BoolOption('VERSIONED', 'Add revision information to ardour/gtk executable name inside the build directory', 0), BoolOption('VERSIONED', 'Add revision information to ardour/gtk executable name inside the build directory', 0),
BoolOption('VST', 'Compile with support for VST', 0), BoolOption('VST', 'Compile with support for VST', 0),

View File

@ -32,8 +32,6 @@ using namespace MIDI;
using namespace PBD; using namespace PBD;
using namespace ARDOUR; using namespace ARDOUR;
bool MIDIControllable::_send_feedback = false;
MIDIControllable::MIDIControllable (Port& p, Controllable& c, bool is_bistate) MIDIControllable::MIDIControllable (Port& p, Controllable& c, bool is_bistate)
: controllable (c), _port (p), bistate (is_bistate) : controllable (c), _port (p), bistate (is_bistate)
{ {
@ -288,7 +286,7 @@ MIDIControllable::send_feedback ()
{ {
byte msg[3]; byte msg[3];
if (setting || !_send_feedback || control_type == none) { if (setting || !feedback || control_type == none) {
return; return;
} }
@ -302,7 +300,7 @@ MIDIControllable::send_feedback ()
MIDI::byte* MIDI::byte*
MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool force) MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool force)
{ {
if (control_type != none &&_send_feedback && bufsize > 2) { if (control_type != none && feedback && bufsize > 2) {
MIDI::byte gm = (MIDI::byte) (controllable.get_value() * 127.0); MIDI::byte gm = (MIDI::byte) (controllable.get_value() * 127.0);
@ -345,6 +343,12 @@ MIDIControllable::set_state (const XMLNode& node)
return -1; return -1;
} }
if ((prop = node.property ("feedback")) != 0) {
feedback = (prop->value() == "yes");
} else {
feedback = true; // default
}
bind_midi (control_channel, control_type, control_additional); bind_midi (control_channel, control_type, control_additional);
return 0; return 0;
@ -362,6 +366,7 @@ MIDIControllable::get_state ()
node.add_property ("channel", buf); node.add_property ("channel", buf);
snprintf (buf, sizeof(buf), "0x%x", (int) control_additional); snprintf (buf, sizeof(buf), "0x%x", (int) control_additional);
node.add_property ("additional", buf); node.add_property ("additional", buf);
node.add_property ("feedback", (feedback ? "yes" : "no"));
return node; return node;
} }

View File

@ -80,8 +80,6 @@ class MIDIControllable : public Stateful
std::string _control_description; std::string _control_description;
bool feedback; bool feedback;
static bool _send_feedback;
void midi_receiver (MIDI::Parser &p, MIDI::byte *, size_t); void midi_receiver (MIDI::Parser &p, MIDI::byte *, size_t);
void midi_sense_note (MIDI::Parser &, MIDI::EventTwoBytes *, bool is_on); void midi_sense_note (MIDI::Parser &, MIDI::EventTwoBytes *, bool is_on);
void midi_sense_note_on (MIDI::Parser &p, MIDI::EventTwoBytes *tb); void midi_sense_note_on (MIDI::Parser &p, MIDI::EventTwoBytes *tb);