Slightly tweaked patch from royvegard to add optional threshold for catch-up of non motorised controls in generic MIDI surfaces (#4828).

git-svn-id: svn://localhost/ardour2/branches/3.0@12716 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-06-13 21:53:50 +00:00
parent 1c2951e0ea
commit 72642335d1
4 changed files with 47 additions and 1 deletions

View file

@ -55,6 +55,7 @@ using namespace std;
GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s)
: ControlProtocol (s, _("Generic MIDI"))
, _motorised (false)
, _threshold (10)
, gui (0)
{
_input_port = MIDI::Manager::instance()->midi_input_port ();
@ -647,6 +648,13 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath)
} else {
_motorised = false;
}
if ((prop = (*citer)->property ("threshold")) != 0) {
_threshold = atoi (prop->value ());
} else {
_threshold = 10;
}
}
if ((*citer)->name() == "Binding") {
@ -1011,3 +1019,9 @@ GenericMidiControlProtocol::set_motorised (bool m)
{
_motorised = m;
}
void
GenericMidiControlProtocol::set_threshold (int t)
{
_threshold = t;
}