add color property to MIDISceneChange

This commit is contained in:
Paul Davis 2014-11-10 21:17:39 -05:00
parent c99d3b39ef
commit ac4a66592f
2 changed files with 21 additions and 0 deletions

View file

@ -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 */

View file

@ -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;
}