add color property to MIDISceneChange
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user