13
0

triggerbox: Triggers may be assigned a color

colors can be transmitted to some surfaces (Launchpad et al), so must be store in Trigger::
This commit is contained in:
Ben Loftis 2021-12-27 11:40:09 -06:00
parent 8ac1b40694
commit cc5fb209ab
2 changed files with 15 additions and 0 deletions

View File

@ -61,6 +61,8 @@ class MidiRegion;
class TriggerBox; class TriggerBox;
class SideChain; class SideChain;
typedef uint32_t color_t;
class LIBARDOUR_API Trigger : public PBD::Stateful { class LIBARDOUR_API Trigger : public PBD::Stateful {
public: public:
enum State { enum State {
@ -178,6 +180,9 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
FollowAction follow_action (uint32_t n) const { assert (n < 2); return n ? _follow_action1 : _follow_action0; } FollowAction follow_action (uint32_t n) const { assert (n < 2); return n ? _follow_action1 : _follow_action0; }
void set_follow_action (FollowAction, uint32_t n); void set_follow_action (FollowAction, uint32_t n);
color_t color() const { return _color; }
void set_color (color_t);
void set_region (boost::shared_ptr<Region>, bool use_thread = true); void set_region (boost::shared_ptr<Region>, bool use_thread = true);
void clear_region (); void clear_region ();
virtual int set_region_in_worker_thread (boost::shared_ptr<Region>) = 0; virtual int set_region_in_worker_thread (boost::shared_ptr<Region>) = 0;
@ -280,6 +285,7 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
PBD::Property<float> _midi_velocity_effect; PBD::Property<float> _midi_velocity_effect;
PBD::Property<bool> _stretchable; PBD::Property<bool> _stretchable;
PBD::Property<bool> _isolated; PBD::Property<bool> _isolated;
PBD::Property<color_t> _color;
/* computed from data */ /* computed from data */

View File

@ -90,6 +90,7 @@ Trigger::Trigger (uint32_t n, TriggerBox& b)
, _midi_velocity_effect (Properties::velocity_effect, 0.) , _midi_velocity_effect (Properties::velocity_effect, 0.)
, _stretchable (Properties::stretchable, true) , _stretchable (Properties::stretchable, true)
, _isolated (Properties::isolated, false) , _isolated (Properties::isolated, false)
, _color (Properties::color, 0xBEBEBEFF)
, _barcnt (0.) , _barcnt (0.)
, _apparent_tempo (0.) , _apparent_tempo (0.)
, expected_end_sample (0) , expected_end_sample (0)
@ -108,6 +109,7 @@ Trigger::Trigger (uint32_t n, TriggerBox& b)
add_property (_midi_velocity_effect); add_property (_midi_velocity_effect);
add_property (_stretchable); add_property (_stretchable);
add_property (_isolated); add_property (_isolated);
add_property (_color);
} }
void void
@ -152,6 +154,13 @@ Trigger::set_scene_isolated (bool i)
PropertyChanged (ARDOUR::Properties::isolated); PropertyChanged (ARDOUR::Properties::isolated);
} }
void
Trigger::set_color (color_t c)
{
_color = c;
PropertyChanged (ARDOUR::Properties::color);
}
void void
Trigger::set_stretchable (bool s) Trigger::set_stretchable (bool s)
{ {