using namespace PBD;
using namespace ARDOUR;
-MIDISceneChange::MIDISceneChange (framepos_t time, int c, int b, int p)
- : SceneChange (time)
- , _bank (b)
+MIDISceneChange::MIDISceneChange (int c, int b, int p)
+ : _bank (b)
, _program (p)
, _channel (c & 0xf)
{
}
MIDISceneChange::MIDISceneChange (const XMLNode& node, int version)
- : SceneChange (0)
- , _bank (-1)
+ : _bank (-1)
, _program (-1)
, _channel (-1)
{
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;
}
}
_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;
+}
+
+void
+MIDISceneChange::set_channel (int channel)
+{
+ _channel = channel;
+}
+
+void
+MIDISceneChange::set_program (int program)
+{
+ _program = program;
+}
+
+void
+MIDISceneChange::set_bank (int bank)
+{
+ _bank = bank;
+}
+
+