triggerbox: do not use follow length when (left) follow action is None
This commit is contained in:
parent
68c87c3f29
commit
b884f7c534
@ -324,6 +324,8 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
|
|||||||
void set_region_internal (boost::shared_ptr<Region>);
|
void set_region_internal (boost::shared_ptr<Region>);
|
||||||
virtual void retrigger() = 0;
|
virtual void retrigger() = 0;
|
||||||
virtual void _startup (Temporal::BBT_Offset const &);
|
virtual void _startup (Temporal::BBT_Offset const &);
|
||||||
|
|
||||||
|
bool internal_use_follow_length() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::shared_ptr<Trigger> TriggerPtr;
|
typedef boost::shared_ptr<Trigger> TriggerPtr;
|
||||||
|
@ -407,6 +407,12 @@ Trigger::set_use_follow_length (bool ufl)
|
|||||||
_box.session().set_dirty();
|
_box.session().set_dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Trigger::internal_use_follow_length () const
|
||||||
|
{
|
||||||
|
return (_follow_action0.val().type != None) && _use_follow_length;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Trigger::set_legato (bool yn)
|
Trigger::set_legato (bool yn)
|
||||||
{
|
{
|
||||||
@ -1055,20 +1061,20 @@ AudioTrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tma
|
|||||||
end_by_follow_length, _follow_length, end_by_barcnt, end_by_data_length));
|
end_by_follow_length, _follow_length, end_by_barcnt, end_by_data_length));
|
||||||
|
|
||||||
if (stretching()) {
|
if (stretching()) {
|
||||||
if (_use_follow_length) {
|
if (internal_use_follow_length()) {
|
||||||
expected_end_sample = std::min (end_by_follow_length, end_by_barcnt);
|
expected_end_sample = std::min (end_by_follow_length, end_by_barcnt);
|
||||||
} else {
|
} else {
|
||||||
expected_end_sample = end_by_barcnt;
|
expected_end_sample = end_by_barcnt;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (_use_follow_length) {
|
if (internal_use_follow_length()) {
|
||||||
expected_end_sample = std::min (end_by_follow_length, end_by_data_length);
|
expected_end_sample = std::min (end_by_follow_length, end_by_data_length);
|
||||||
} else {
|
} else {
|
||||||
expected_end_sample = end_by_data_length;
|
expected_end_sample = end_by_data_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_use_follow_length) {
|
if (internal_use_follow_length()) {
|
||||||
final_sample = end_by_follow_length - transition_sample;
|
final_sample = end_by_follow_length - transition_sample;
|
||||||
} else {
|
} else {
|
||||||
final_sample = expected_end_sample - transition_sample;
|
final_sample = expected_end_sample - transition_sample;
|
||||||
@ -1076,7 +1082,7 @@ AudioTrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tma
|
|||||||
|
|
||||||
samplecnt_t usable_length;
|
samplecnt_t usable_length;
|
||||||
|
|
||||||
if (_use_follow_length && (end_by_follow_length < end_by_data_length)) {
|
if (internal_use_follow_length() && (end_by_follow_length < end_by_data_length)) {
|
||||||
usable_length = tmap->sample_at (tmap->bbt_walk (Temporal::BBT_Time (), _follow_length));
|
usable_length = tmap->sample_at (tmap->bbt_walk (Temporal::BBT_Time (), _follow_length));
|
||||||
} else {
|
} else {
|
||||||
usable_length = data.length;
|
usable_length = data.length;
|
||||||
@ -1752,7 +1758,7 @@ MIDITrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tmap
|
|||||||
|
|
||||||
Temporal::Beats usable_length;
|
Temporal::Beats usable_length;
|
||||||
|
|
||||||
if (_use_follow_length && (end_by_follow_length < end_by_data_length)) {
|
if (internal_use_follow_length() && (end_by_follow_length < end_by_data_length)) {
|
||||||
usable_length = tmap->quarters_at (tmap->bbt_walk (transition_bbt, _follow_length)) - transition_beats;
|
usable_length = tmap->quarters_at (tmap->bbt_walk (transition_bbt, _follow_length)) - transition_beats;
|
||||||
} else {
|
} else {
|
||||||
usable_length = data_length;
|
usable_length = data_length;
|
||||||
@ -1762,7 +1768,7 @@ MIDITrigger::set_expected_end_sample (Temporal::TempoMap::SharedPtr const & tmap
|
|||||||
|
|
||||||
if (launch_style() != Repeat || (q == Temporal::BBT_Offset())) {
|
if (launch_style() != Repeat || (q == Temporal::BBT_Offset())) {
|
||||||
|
|
||||||
if (_use_follow_length) {
|
if (internal_use_follow_length()) {
|
||||||
final_beat = end_by_follow_length;
|
final_beat = end_by_follow_length;
|
||||||
} else {
|
} else {
|
||||||
final_beat = end_by_data_length;
|
final_beat = end_by_data_length;
|
||||||
|
Loading…
Reference in New Issue
Block a user