summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-12-03 09:15:10 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-06-29 14:18:14 -0400
commitc2476ea73da79237984fb4cedb397033d0bd62ec (patch)
tree0a005de14835f25ffa3241eac9e186eeaa7014d8
parent51d2804535b7bab8dbd96da8c8ae02d65c9347c1 (diff)
add API for controlling and determining active status of a SceneChange
Conflicts: libs/ardour/ardour/scene_change.h
-rw-r--r--libs/ardour/ardour/scene_change.h22
-rw-r--r--libs/ardour/midi_scene_changer.cc8
-rw-r--r--libs/ardour/scene_change.cc10
3 files changed, 31 insertions, 9 deletions
diff --git a/libs/ardour/ardour/scene_change.h b/libs/ardour/ardour/scene_change.h
index ee711985b5..661d2238b7 100644
--- a/libs/ardour/ardour/scene_change.h
+++ b/libs/ardour/ardour/scene_change.h
@@ -36,17 +36,21 @@ class SceneChange : public PBD::Stateful
static boost::shared_ptr<SceneChange> factory (const XMLNode&, int version);
static std::string xml_node_name;
- uint32_t color() const;
- void set_color (uint32_t);
- bool color_out_of_bounds() const { return _color == out_of_bound_color; }
- static const uint32_t out_of_bound_color;
-
- PBD::Signal0<void> ColorChanged;
+ uint32_t color() const;
+ void set_color (uint32_t);
+ bool color_out_of_bounds() const { return _color == out_of_bound_color; }
+ static const uint32_t out_of_bound_color;
-protected:
- /* derived classes are responsible for serializing & deserializing this value */
- uint32_t _color;
+ bool active () const { return _active; }
+ void set_active (bool);
+
+ PBD::Signal0<void> ColorChanged;
+ PBD::Signal0<void> ActiveChanged;
+ protected:
+ /* derived classes are responsible for serializing & deserializing this value */
+ uint32_t _color;
+ bool _active;
};
} /* namespace */
diff --git a/libs/ardour/midi_scene_changer.cc b/libs/ardour/midi_scene_changer.cc
index bd32ff308b..6288a6fc84 100644
--- a/libs/ardour/midi_scene_changer.cc
+++ b/libs/ardour/midi_scene_changer.cc
@@ -96,6 +96,10 @@ MIDISceneChanger::gather (const Locations::LocationList& locations)
void
MIDISceneChanger::rt_deliver (MidiBuffer& mbuf, framepos_t when, boost::shared_ptr<MIDISceneChange> msc)
{
+ if (!msc->active()) {
+ return;
+ }
+
uint8_t buf[4];
size_t cnt;
@@ -121,6 +125,10 @@ MIDISceneChanger::rt_deliver (MidiBuffer& mbuf, framepos_t when, boost::shared_p
void
MIDISceneChanger::non_rt_deliver (boost::shared_ptr<MIDISceneChange> msc)
{
+ if (!msc->active()) {
+ return;
+ }
+
uint8_t buf[4];
size_t cnt;
boost::shared_ptr<AsyncMIDIPort> aport = boost::dynamic_pointer_cast<AsyncMIDIPort>(output_port);
diff --git a/libs/ardour/scene_change.cc b/libs/ardour/scene_change.cc
index 6560a7ca2f..322b37a195 100644
--- a/libs/ardour/scene_change.cc
+++ b/libs/ardour/scene_change.cc
@@ -41,6 +41,7 @@ SceneChange::factory (const XMLNode& node, int version)
SceneChange::SceneChange ()
: _color (out_of_bound_color)
+ , _active (true)
{
}
@@ -56,3 +57,12 @@ SceneChange::color() const
{
return _color;
}
+
+void
+SceneChange::set_active (bool yn)
+{
+ if (_active != yn) {
+ _active = yn;
+ ActiveChanged (); /* EMIT SIGNAL */
+ }
+}