mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 13:16:27 +01:00
add API for controlling and determining active status of a SceneChange
Conflicts: libs/ardour/ardour/scene_change.h
This commit is contained in:
parent
51d2804535
commit
c2476ea73d
3 changed files with 31 additions and 9 deletions
|
|
@ -41,12 +41,16 @@ class SceneChange : public PBD::Stateful
|
||||||
bool color_out_of_bounds() const { return _color == out_of_bound_color; }
|
bool color_out_of_bounds() const { return _color == out_of_bound_color; }
|
||||||
static const uint32_t out_of_bound_color;
|
static const uint32_t out_of_bound_color;
|
||||||
|
|
||||||
PBD::Signal0<void> ColorChanged;
|
bool active () const { return _active; }
|
||||||
|
void set_active (bool);
|
||||||
|
|
||||||
protected:
|
PBD::Signal0<void> ColorChanged;
|
||||||
|
PBD::Signal0<void> ActiveChanged;
|
||||||
|
|
||||||
|
protected:
|
||||||
/* derived classes are responsible for serializing & deserializing this value */
|
/* derived classes are responsible for serializing & deserializing this value */
|
||||||
uint32_t _color;
|
uint32_t _color;
|
||||||
|
bool _active;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace */
|
} /* namespace */
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,10 @@ MIDISceneChanger::gather (const Locations::LocationList& locations)
|
||||||
void
|
void
|
||||||
MIDISceneChanger::rt_deliver (MidiBuffer& mbuf, framepos_t when, boost::shared_ptr<MIDISceneChange> msc)
|
MIDISceneChanger::rt_deliver (MidiBuffer& mbuf, framepos_t when, boost::shared_ptr<MIDISceneChange> msc)
|
||||||
{
|
{
|
||||||
|
if (!msc->active()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t buf[4];
|
uint8_t buf[4];
|
||||||
size_t cnt;
|
size_t cnt;
|
||||||
|
|
||||||
|
|
@ -121,6 +125,10 @@ MIDISceneChanger::rt_deliver (MidiBuffer& mbuf, framepos_t when, boost::shared_p
|
||||||
void
|
void
|
||||||
MIDISceneChanger::non_rt_deliver (boost::shared_ptr<MIDISceneChange> msc)
|
MIDISceneChanger::non_rt_deliver (boost::shared_ptr<MIDISceneChange> msc)
|
||||||
{
|
{
|
||||||
|
if (!msc->active()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t buf[4];
|
uint8_t buf[4];
|
||||||
size_t cnt;
|
size_t cnt;
|
||||||
boost::shared_ptr<AsyncMIDIPort> aport = boost::dynamic_pointer_cast<AsyncMIDIPort>(output_port);
|
boost::shared_ptr<AsyncMIDIPort> aport = boost::dynamic_pointer_cast<AsyncMIDIPort>(output_port);
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ SceneChange::factory (const XMLNode& node, int version)
|
||||||
|
|
||||||
SceneChange::SceneChange ()
|
SceneChange::SceneChange ()
|
||||||
: _color (out_of_bound_color)
|
: _color (out_of_bound_color)
|
||||||
|
, _active (true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,3 +57,12 @@ SceneChange::color() const
|
||||||
{
|
{
|
||||||
return _color;
|
return _color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SceneChange::set_active (bool yn)
|
||||||
|
{
|
||||||
|
if (_active != yn) {
|
||||||
|
_active = yn;
|
||||||
|
ActiveChanged (); /* EMIT SIGNAL */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue