mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
split apart mackie meter messages when we have to send two, one to turn on/off the overload indicator and one to set the level. this avoids MIDI bridge issues with non-canonical MIDI messages
git-svn-id: svn://localhost/ardour2/branches/3.0@12367 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a6c3508bd3
commit
8c73a62ee0
3 changed files with 14 additions and 10 deletions
|
|
@ -40,8 +40,8 @@ Meter::factory (Surface& surface, int id, const char* name, Group& group)
|
|||
return m;
|
||||
}
|
||||
|
||||
MidiByteArray
|
||||
Meter::update_message (float dB)
|
||||
void
|
||||
Meter::send_update (Surface& surface, float dB)
|
||||
{
|
||||
float def = 0.0f; /* Meter deflection %age */
|
||||
|
||||
|
|
@ -75,12 +75,13 @@ Meter::update_message (float dB)
|
|||
if (def > 100.0f) {
|
||||
if (!overload_on) {
|
||||
overload_on = true;
|
||||
msg << MidiByteArray (2, 0xd0, (id() << 4) | 0xe);
|
||||
surface.write (MidiByteArray (2, 0xd0, (id() << 4) | 0xe));
|
||||
|
||||
}
|
||||
} else {
|
||||
if (overload_on) {
|
||||
overload_on = false;
|
||||
msg << MidiByteArray (2, 0xd0, (id() << 4) | 0xf);
|
||||
surface.write (MidiByteArray (2, 0xd0, (id() << 4) | 0xf));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -90,9 +91,12 @@ Meter::update_message (float dB)
|
|||
|
||||
if (last_segment_value_sent != segment) {
|
||||
last_segment_value_sent = segment;
|
||||
msg << MidiByteArray (2, 0xD0, (id()<<4) | segment);
|
||||
surface.write (MidiByteArray (2, 0xD0, (id()<<4) | segment));
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
MidiByteArray
|
||||
Meter::zero ()
|
||||
{
|
||||
return MidiByteArray (2, 0xD0, (id()<<4 | 0));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ public:
|
|||
, last_segment_value_sent (-1)
|
||||
, overload_on (false) {}
|
||||
|
||||
MidiByteArray update_message (float dB);
|
||||
void send_update (Surface&, float dB);
|
||||
|
||||
MidiByteArray zero() { return update_message (-99999999.0); }
|
||||
MidiByteArray zero();
|
||||
|
||||
static Control* factory (Surface&, int id, const char*, Group&);
|
||||
|
||||
|
|
|
|||
|
|
@ -687,7 +687,7 @@ Strip::update_meter ()
|
|||
{
|
||||
if (_meter) {
|
||||
float dB = const_cast<PeakMeter&> (_route->peak_meter()).peak_power (0);
|
||||
_surface->write (_meter->update_message (dB));
|
||||
_meter->send_update (*_surface, dB);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue