mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 13:45:43 +01:00
avoid sending replicated fader set position messages
This commit is contained in:
parent
3bc7f863ca
commit
04b9df1fd9
2 changed files with 9 additions and 0 deletions
|
|
@ -60,6 +60,13 @@ Fader::update_message ()
|
|||
}
|
||||
|
||||
int posi = lrintf (16384.0 * position);
|
||||
|
||||
if (posi == last_update_position) {
|
||||
return MidiByteArray();
|
||||
}
|
||||
|
||||
last_update_position = posi;
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("generate fader message for position %1 (%2)\n", position, posi));
|
||||
return MidiByteArray (3, 0xe0 + id(), posi & 0x7f, posi >> 7);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class Fader : public Control
|
|||
Fader (int id, std::string name, Group & group)
|
||||
: Control (id, name, group)
|
||||
, position (0.0)
|
||||
, last_update_position (-1)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -26,6 +27,7 @@ class Fader : public Control
|
|||
|
||||
private:
|
||||
float position;
|
||||
int last_update_position;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue