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:
parent
8ac1b40694
commit
cc5fb209ab
@ -61,6 +61,8 @@ class MidiRegion;
|
||||
class TriggerBox;
|
||||
class SideChain;
|
||||
|
||||
typedef uint32_t color_t;
|
||||
|
||||
class LIBARDOUR_API Trigger : public PBD::Stateful {
|
||||
public:
|
||||
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; }
|
||||
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 clear_region ();
|
||||
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<bool> _stretchable;
|
||||
PBD::Property<bool> _isolated;
|
||||
PBD::Property<color_t> _color;
|
||||
|
||||
/* computed from data */
|
||||
|
||||
|
@ -90,6 +90,7 @@ Trigger::Trigger (uint32_t n, TriggerBox& b)
|
||||
, _midi_velocity_effect (Properties::velocity_effect, 0.)
|
||||
, _stretchable (Properties::stretchable, true)
|
||||
, _isolated (Properties::isolated, false)
|
||||
, _color (Properties::color, 0xBEBEBEFF)
|
||||
, _barcnt (0.)
|
||||
, _apparent_tempo (0.)
|
||||
, expected_end_sample (0)
|
||||
@ -108,6 +109,7 @@ Trigger::Trigger (uint32_t n, TriggerBox& b)
|
||||
add_property (_midi_velocity_effect);
|
||||
add_property (_stretchable);
|
||||
add_property (_isolated);
|
||||
add_property (_color);
|
||||
}
|
||||
|
||||
void
|
||||
@ -152,6 +154,13 @@ Trigger::set_scene_isolated (bool i)
|
||||
PropertyChanged (ARDOUR::Properties::isolated);
|
||||
}
|
||||
|
||||
void
|
||||
Trigger::set_color (color_t c)
|
||||
{
|
||||
_color = c;
|
||||
PropertyChanged (ARDOUR::Properties::color);
|
||||
}
|
||||
|
||||
void
|
||||
Trigger::set_stretchable (bool s)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user