implement missing methods for MIDISceneChange
[ardour.git] / libs / ardour / midi_scene_change.cc
index edcc8a658d2faf4e6dfdbeac2b5ddf6f15f6f57f..c10ca74904391d1a6db965663ff1dab867304e84 100644 (file)
@@ -110,6 +110,8 @@ MIDISceneChange::get_state ()
        node->add_property (X_("bank"), buf);
        snprintf (buf, sizeof (buf), "%d", (int) _channel);
        node->add_property (X_("channel"), buf);
+       snprintf (buf, sizeof (buf), "%u", _color);
+       node->add_property (X_("color"), buf);
 
        return *node;
 }
@@ -138,13 +140,39 @@ MIDISceneChange::set_state (const XMLNode& node, int /* version-ignored */)
        }
        _channel = atoi (prop->value());
 
+       if ((prop = node.property (X_("color"))) != 0) {
+               _color = atoi (prop->value());
+       } else {
+               _color = out_of_bound_color;
+       }
+
        return 0;
 }
 
 bool
 MIDISceneChange::operator==(const MIDISceneChange& other) const
 {
-        return _program == other._program &&
-                _bank == other._bank &&
-                _channel == other._channel;
+       return _program == other._program &&
+               _bank == other._bank &&
+               _channel == other._channel;
+}
+
+void
+MIDISceneChange::set_channel (int channel)
+{
+        _channel = channel;
+}
+
+void
+MIDISceneChange::set_program (int program)
+{
+        _program = program;
+}
+
+void
+MIDISceneChange::set_bank (int bank)
+{
+        _bank = bank;
 }
+      
+