13
0

Add API to set TriggerTrack flag

This is intended to decide if a track will be visible on the
Trigger-Tab/Page. It should be kept in sync with trigger-processor
enable.
This commit is contained in:
Robin Gareus 2021-11-18 17:03:10 +01:00
parent 7edbf06420
commit 3a2566b4af
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 38 additions and 1 deletions

View File

@ -41,6 +41,7 @@ namespace Properties {
LIBARDOUR_API extern PBD::PropertyDescriptor<uint32_t> order;
LIBARDOUR_API extern PBD::PropertyDescriptor<uint32_t> color;
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> selected;
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> trigger_track;
/* we use this; declared in region.cc */
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> hidden;
}
@ -128,8 +129,16 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
/* bus type for monitor mixes */
FoldbackBus = 0x2000,
/* has TriggerBox, show on TriggerUI page */
TriggerTrack = 0x4000,
/* special mask to delect out "state" bits */
StatusMask = (Hidden),
#ifdef MIXBUS
StatusMask = (Hidden | MixbusEditorHidden | TriggerTrack),
#else
StatusMask = (Hidden | TriggerTrack),
#endif
/* special mask to delect select type bits */
TypeMask = (AudioBus|AudioTrack|MidiTrack|MidiBus|VCA|MasterOut|MonitorOut|Auditioner|FoldbackBus)
};
@ -160,6 +169,7 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
void set_color (color_t);
void set_hidden (bool yn);
void set_trigger_track (bool yn);
void set_flags (Flag f) { _flags = f; }
bool order_set() const { return _flags & OrderSet; }
@ -167,6 +177,7 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
int selection_cnt() const { return _selection_cnt; }
bool hidden() const { return _flags & Hidden; }
bool trigger_track () const { return _flags & TriggerTrack; }
bool special(bool with_master = true) const { return _flags & ((with_master ? MasterOut : 0)|MonitorOut|Auditioner); }
bool flag_match (Flag f) const {

View File

@ -757,6 +757,10 @@ setup_enum_writer ()
REGISTER_CLASS_ENUM (PresentationInfo, Hidden);
REGISTER_CLASS_ENUM (PresentationInfo, OrderSet);
REGISTER_CLASS_ENUM (PresentationInfo, FoldbackBus);
REGISTER_CLASS_ENUM (PresentationInfo, TriggerTrack);
#ifdef MIXBUS
REGISTER_CLASS_ENUM (PresentationInfo, MixbusEditorHidden);
#endif
REGISTER_BITS (_PresentationInfo_Flag);
REGISTER_CLASS_ENUM (MusicalMode,Dorian);

View File

@ -1944,7 +1944,9 @@ LuaBindings::common (lua_State* L)
.addConst ("Auditioner", ARDOUR::PresentationInfo::Flag(PresentationInfo::Auditioner))
.addConst ("Hidden", ARDOUR::PresentationInfo::Flag(PresentationInfo::Hidden))
.addConst ("GroupOrderSet", ARDOUR::PresentationInfo::Flag(PresentationInfo::OrderSet))
.addConst ("TriggerTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::TriggerTrack))
.addConst ("StatusMask", ARDOUR::PresentationInfo::Flag(PresentationInfo::StatusMask))
.addConst ("TypeMask", ARDOUR::PresentationInfo::Flag(PresentationInfo::TypeMask))
.endNamespace ()
.endNamespace ()

View File

@ -56,6 +56,7 @@ namespace ARDOUR {
PBD::PropertyDescriptor<bool> selected;
PBD::PropertyDescriptor<uint32_t> order;
PBD::PropertyDescriptor<uint32_t> color;
PBD::PropertyDescriptor<bool> trigger_track;
}
}
@ -190,6 +191,9 @@ PresentationInfo::set_state (XMLNode const& node, int /* version */)
if ((f&Hidden) != (_flags&Hidden)) {
pc.add (Properties::hidden);
}
if ((f&TriggerTrack) != (_flags&TriggerTrack)) {
pc.add (Properties::trigger_track);
}
_flags = f;
}
@ -285,6 +289,22 @@ PresentationInfo::set_order (order_t order)
}
}
void
PresentationInfo::set_trigger_track (bool yn)
{
if (yn != trigger_track ()) {
if (yn) {
_flags = Flag (_flags | TriggerTrack);
} else {
_flags = Flag (_flags & ~TriggerTrack);
}
send_change (PropertyChange (Properties::trigger_track));
send_static_change (PropertyChange (Properties::trigger_track));
}
}
PresentationInfo&
PresentationInfo::operator= (PresentationInfo const& other)
{