diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-10 21:17:39 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-10 23:16:59 -0500 |
commit | 70960a5a0055019b576e32acc1acf2094f4e4141 (patch) | |
tree | 9980007afe84c6520d4bad19fcbc0d18347c1849 /libs | |
parent | 3d0efb8bf7b5fe2c3d73359f278bb74eaa7ddc41 (diff) |
add color property to MIDISceneChange
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/midi_scene_change.h | 7 | ||||
-rw-r--r-- | libs/ardour/midi_scene_change.cc | 14 |
2 files changed, 21 insertions, 0 deletions
diff --git a/libs/ardour/ardour/midi_scene_change.h b/libs/ardour/ardour/midi_scene_change.h index f0b516cacf..9c8f5ca01f 100644 --- a/libs/ardour/ardour/midi_scene_change.h +++ b/libs/ardour/ardour/midi_scene_change.h @@ -22,6 +22,8 @@ #include "evoral/PatchChange.hpp" +#include "pbd/signals.h" + #include "ardour/scene_change.h" namespace ARDOUR @@ -53,10 +55,15 @@ class MIDISceneChange : public SceneChange bool operator==(const MIDISceneChange& other) const; + uint32_t color() const; + void set_color (uint32_t); + PBD::Signal0<void> ColorChanged; + private: int _bank; int _program; uint8_t _channel; + uint32_t _color; }; } /* namespace */ diff --git a/libs/ardour/midi_scene_change.cc b/libs/ardour/midi_scene_change.cc index edcc8a658d..db7e826384 100644 --- a/libs/ardour/midi_scene_change.cc +++ b/libs/ardour/midi_scene_change.cc @@ -32,6 +32,7 @@ MIDISceneChange::MIDISceneChange (int c, int b, int p) : _bank (b) , _program (p) , _channel (c & 0xf) + , _color (0x00000000) /* note: zero alpha means invisible, which acts as out-of-bound signal */ { if (_bank > 16384) { _bank = -1; @@ -148,3 +149,16 @@ MIDISceneChange::operator==(const MIDISceneChange& other) const _bank == other._bank && _channel == other._channel; } + +void +MIDISceneChange::set_color (uint32_t c) +{ + _color = c; + ColorChanged (); /* EMIT SIGNAL */ +} + +uint32_t +MIDISceneChange::color() const +{ + return _color; +} |