summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie/meter.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-05-21 19:02:44 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-05-21 19:02:44 +0000
commit8c73a62ee0800673cd28e5e0946d65212e163d3b (patch)
treeb6a1993f0ccddabd840eae3618ac6891ac0ca5a1 /libs/surfaces/mackie/meter.cc
parenta6c3508bd381e939d420b6069e374776b5e4468d (diff)
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
Diffstat (limited to 'libs/surfaces/mackie/meter.cc')
-rw-r--r--libs/surfaces/mackie/meter.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/libs/surfaces/mackie/meter.cc b/libs/surfaces/mackie/meter.cc
index a4824d3612..82aef2bef8 100644
--- a/libs/surfaces/mackie/meter.cc
+++ b/libs/surfaces/mackie/meter.cc
@@ -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));
+}