13
0

triggerbox: use stretching() internally but change property name to stretchable (libardour)

This commit is contained in:
Ben Loftis 2021-12-15 18:06:25 -06:00
parent 4b26ce3f5f
commit 382f73fa51
2 changed files with 18 additions and 9 deletions

View File

@ -260,7 +260,7 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
PBD::Property<float> _midi_velocity_effect; PBD::Property<float> _midi_velocity_effect;
void* _ui; void* _ui;
samplepos_t expected_end_sample; samplepos_t expected_end_sample;
PBD::Property<bool> _stretching; PBD::Property<bool> _stretchable;
bool _explicitly_stopped; bool _explicitly_stopped;
void set_region_internal (boost::shared_ptr<Region>); void set_region_internal (boost::shared_ptr<Region>);
@ -300,7 +300,9 @@ class LIBARDOUR_API AudioTrigger : public Trigger {
SegmentDescriptor get_segment_descriptor () const; SegmentDescriptor get_segment_descriptor () const;
void set_expected_end_sample (Temporal::TempoMap::SharedPtr const &, Temporal::BBT_Time const &); void set_expected_end_sample (Temporal::TempoMap::SharedPtr const &, Temporal::BBT_Time const &);
void set_stretching (bool yn); void set_stretchable (bool yn);
bool stretchable () const { return _stretchable; }
bool stretching () const; bool stretching () const;
protected: protected:
@ -614,7 +616,7 @@ namespace Properties {
LIBARDOUR_API extern PBD::PropertyDescriptor<float> velocity_effect; LIBARDOUR_API extern PBD::PropertyDescriptor<float> velocity_effect;
LIBARDOUR_API extern PBD::PropertyDescriptor<gain_t> gain; LIBARDOUR_API extern PBD::PropertyDescriptor<gain_t> gain;
LIBARDOUR_API extern PBD::PropertyDescriptor<Trigger*> currently_playing; LIBARDOUR_API extern PBD::PropertyDescriptor<Trigger*> currently_playing;
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> stretching; LIBARDOUR_API extern PBD::PropertyDescriptor<bool> stretchable;
} }

View File

@ -56,7 +56,7 @@ namespace ARDOUR {
PBD::PropertyDescriptor<int> follow_action_probability; PBD::PropertyDescriptor<int> follow_action_probability;
PBD::PropertyDescriptor<float> velocity_effect; PBD::PropertyDescriptor<float> velocity_effect;
PBD::PropertyDescriptor<gain_t> gain; PBD::PropertyDescriptor<gain_t> gain;
PBD::PropertyDescriptor<bool> stretching; PBD::PropertyDescriptor<bool> stretchable;
} }
} }
@ -81,7 +81,7 @@ Trigger::Trigger (uint64_t n, TriggerBox& b)
, _midi_velocity_effect (Properties::velocity_effect, 0.) , _midi_velocity_effect (Properties::velocity_effect, 0.)
, _ui (0) , _ui (0)
, expected_end_sample (0) , expected_end_sample (0)
, _stretching (Properties::stretching, true) , _stretchable (Properties::stretchable, true)
, _explicitly_stopped (false) , _explicitly_stopped (false)
{ {
add_property (_legato); add_property (_legato);
@ -89,7 +89,7 @@ Trigger::Trigger (uint64_t n, TriggerBox& b)
add_property (_follow_count); add_property (_follow_count);
add_property (_midi_velocity_effect); add_property (_midi_velocity_effect);
add_property (_follow_action_probability); add_property (_follow_action_probability);
add_property (_stretching); add_property (_stretchable);
} }
void void
@ -563,7 +563,7 @@ AudioTrigger::~AudioTrigger ()
bool bool
AudioTrigger::stretching() const AudioTrigger::stretching() const
{ {
return (_apparent_tempo != .0) && _stretching; return (_apparent_tempo != .0) && _stretchable;
} }
void void
@ -648,6 +648,13 @@ AudioTrigger::set_state (const XMLNode& node, int version)
return 0; return 0;
} }
void
AudioTrigger::set_stretchable (bool s)
{
_stretchable = s;
PropertyChanged (ARDOUR::Properties::stretchable);
}
void void
AudioTrigger::set_start (timepos_t const & s) AudioTrigger::set_start (timepos_t const & s)
{ {
@ -1579,8 +1586,8 @@ Trigger::make_property_quarks ()
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for follow-action-0 = %1\n", Properties::follow_action0.property_id)); DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for follow-action-0 = %1\n", Properties::follow_action0.property_id));
Properties::follow_action1.property_id = g_quark_from_static_string (X_("follow-action-1")); Properties::follow_action1.property_id = g_quark_from_static_string (X_("follow-action-1"));
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for follow-action-1 = %1\n", Properties::follow_action1.property_id)); DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for follow-action-1 = %1\n", Properties::follow_action1.property_id));
Properties::stretching.property_id = g_quark_from_static_string (X_("stretching")); Properties::stretchable.property_id = g_quark_from_static_string (X_("stretchable"));
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for stretching = %1\n", Properties::stretching.property_id)); DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for stretchable = %1\n", Properties::stretchable.property_id));
} }
const int32_t TriggerBox::default_triggers_per_box = 8; const int32_t TriggerBox::default_triggers_per_box = 8;