13
0

Fix 'sticky' sliders when MIDI control feedback is enabled.

git-svn-id: svn://localhost/ardour2/branches/3.0@4628 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-02-18 23:54:41 +00:00
parent 9cfa3e2bf6
commit cbb59ddbce
5 changed files with 14 additions and 3 deletions

View File

@ -569,14 +569,14 @@ GainMeterBase::meter_point_clicked ()
gint
GainMeterBase::start_gain_touch (GdkEventButton* ev)
{
_io->gain_control()->alist()->start_touch ();
_io->gain_control()->start_touch ();
return FALSE;
}
gint
GainMeterBase::end_gain_touch (GdkEventButton* ev)
{
_io->gain_control()->alist()->stop_touch ();
_io->gain_control()->stop_touch ();
return FALSE;
}

View File

@ -65,10 +65,12 @@ public:
}
inline void start_touch() {
set_touching (true);
return ((ARDOUR::AutomationList*)_list.get())->start_touch();
}
inline void stop_touch() {
set_touching (false);
return ((ARDOUR::AutomationList*)_list.get())->stop_touch();
}

View File

@ -36,6 +36,7 @@ Controllable::Controllables Controllable::registry;
Controllable::Controllable (std::string name)
: _name (name)
, _touching (false)
{
if (registry_lock == 0) {
registry_lock = new Glib::Mutex;

View File

@ -54,13 +54,17 @@ class Controllable : public PBD::StatefulDestructible {
int set_state (const XMLNode&);
XMLNode& get_state ();
std::string name() const { return _name; }
std::string name() const { return _name; }
bool touching () const { return _touching; }
void set_touching (bool yn) { _touching = yn; }
static Controllable* by_id (const PBD::ID&);
static Controllable* by_name (const std::string&);
private:
std::string _name;
bool _touching;
void add ();
void remove ();

View File

@ -182,6 +182,10 @@ MIDIControllable::midi_sense_note (Parser &p, EventTwoBytes *msg, bool is_on)
void
MIDIControllable::midi_sense_controller (Parser &, EventTwoBytes *msg)
{
if (controllable.touching()) {
return; // to prevent feedback fights when e.g. dragging a UI slider
}
if (control_additional == msg->controller_number) {
if (!bistate) {
controllable.set_value (midi_to_control(msg->value));