temporal: reference time for BBT_Argument is always superclocks
This commit is contained in:
parent
16c9d91641
commit
3307dcfcb2
|
@ -236,7 +236,7 @@ Session::convert_to_samples (AnyTime const & position)
|
|||
|
||||
switch (position.type) {
|
||||
case AnyTime::BBT:
|
||||
return Temporal::superclock_to_samples (TempoMap::use()->superclock_at (BBT_Argument (timepos_t::zero (Temporal::BeatTime), position.bbt)), _current_sample_rate);
|
||||
return Temporal::superclock_to_samples (TempoMap::use()->superclock_at (BBT_Argument (superclock_t (0), position.bbt)), _current_sample_rate);
|
||||
break;
|
||||
|
||||
case AnyTime::Timecode:
|
||||
|
|
|
@ -1447,7 +1447,7 @@ AudioTrigger::compute_end (Temporal::TempoMap::SharedPtr const & tmap, Temporal:
|
|||
_beatcnt : the expected duration of the trigger, based on analysis of its tempo .. can be overridden by the user later
|
||||
*/
|
||||
|
||||
const Temporal::BBT_Argument transition_bba (timepos_t::zero (Temporal::BeatTime), transition_bbt);
|
||||
const Temporal::BBT_Argument transition_bba (superclock_t (0), transition_bbt);
|
||||
|
||||
samplepos_t end_by_follow_length = tmap->sample_at (tmap->bbt_walk (transition_bba, _follow_length));
|
||||
samplepos_t end_by_data_length = transition_sample + (data.length - _start_offset);
|
||||
|
@ -2315,7 +2315,7 @@ MIDITrigger::start_and_roll_to (samplepos_t start_pos, samplepos_t end_position,
|
|||
timepos_t
|
||||
MIDITrigger::compute_end (Temporal::TempoMap::SharedPtr const & tmap, Temporal::BBT_Time const & transition_bbt, samplepos_t, Temporal::Beats & effective_length)
|
||||
{
|
||||
const Temporal::BBT_Argument transition_bba (timepos_t::zero(Temporal::BeatTime), transition_bbt);
|
||||
const Temporal::BBT_Argument transition_bba (superclock_t (0), transition_bbt);
|
||||
|
||||
Temporal::Beats end_by_follow_length = tmap->quarters_at (tmap->bbt_walk (transition_bba, _follow_length));
|
||||
Temporal::Beats end_by_data_length = tmap->quarters_at (tmap->bbt_walk (transition_bba, Temporal::BBT_Offset (0, data_length.get_beats(), data_length.get_ticks())));
|
||||
|
|
|
@ -663,13 +663,13 @@ MeterPoint::get_state () const
|
|||
return base;
|
||||
}
|
||||
|
||||
timepos_t
|
||||
superclock_t
|
||||
TempoMetric::reftime() const
|
||||
{
|
||||
return _tempo->map().reftime (*this);
|
||||
}
|
||||
|
||||
timepos_t
|
||||
superclock_t
|
||||
TempoMap::reftime (TempoMetric const &tm) const
|
||||
{
|
||||
Points::const_iterator pi;
|
||||
|
@ -689,7 +689,7 @@ TempoMap::reftime (TempoMetric const &tm) const
|
|||
--pi;
|
||||
}
|
||||
|
||||
return timepos_t (pi->sclock());
|
||||
return pi->sclock();
|
||||
}
|
||||
|
||||
Temporal::BBT_Argument
|
||||
|
@ -731,7 +731,7 @@ TempoMetric::bbt_at (timepos_t const & pos) const
|
|||
|
||||
DEBUG_TRACE (DEBUG::TemporalMap, string_compose ("BBT offset from %3 @ %1: %2\n", (_tempo->beats() < _meter->beats() ? _meter->bbt() : _tempo->bbt()), bbt_offset,
|
||||
(_tempo->beats() < _meter->beats() ? "meter" : "tempo")));
|
||||
timepos_t ref (std::min (_meter->sclock(), _tempo->sclock()));
|
||||
superclock_t ref (std::min (_meter->sclock(), _tempo->sclock()));
|
||||
|
||||
return BBT_Argument (ref, _meter->bbt_add (reference_point->bbt(), bbt_offset));
|
||||
}
|
||||
|
@ -2079,7 +2079,7 @@ TempoMap::bbt_at (superclock_t s) const
|
|||
{
|
||||
TempoMetric metric (metric_at (s));
|
||||
|
||||
timepos_t ref (std::min (metric.tempo().sclock(), metric.meter().sclock()));
|
||||
superclock_t ref (std::min (metric.tempo().sclock(), metric.meter().sclock()));
|
||||
return BBT_Argument (ref, metric.bbt_at (timepos_t::from_superclock (s)));
|
||||
}
|
||||
|
||||
|
@ -2087,7 +2087,7 @@ Temporal::BBT_Argument
|
|||
TempoMap::bbt_at (Temporal::Beats const & qn) const
|
||||
{
|
||||
TempoMetric metric (metric_at (qn));
|
||||
timepos_t ref (std::min (metric.tempo().sclock(), metric.meter().sclock()));
|
||||
superclock_t ref (std::min (metric.tempo().sclock(), metric.meter().sclock()));
|
||||
return BBT_Argument (ref, metric.bbt_at (qn));
|
||||
}
|
||||
|
||||
|
|
|
@ -27,19 +27,19 @@ namespace Temporal {
|
|||
struct LIBTEMPORAL_API BBT_Argument : public BBT_Time
|
||||
{
|
||||
public:
|
||||
BBT_Argument () : BBT_Time (), _reference (Temporal::timepos_t (Temporal::BeatTime)) {}
|
||||
BBT_Argument (int32_t B, int32_t b, int32_t t) : BBT_Time (B, b, t), _reference (Temporal::timepos_t (Temporal::BeatTime)) {}
|
||||
BBT_Argument () : BBT_Time (), _reference (0) {}
|
||||
BBT_Argument (int32_t B, int32_t b, int32_t t) : BBT_Time (B, b, t), _reference (0) {}
|
||||
|
||||
BBT_Argument (Temporal::timepos_t const & r) : BBT_Time (), _reference (r) {}
|
||||
BBT_Argument (Temporal::timepos_t const & r, int32_t B, int32_t b, int32_t t) : BBT_Time (B, b, t), _reference (r) {}
|
||||
BBT_Argument (superclock_t r) : BBT_Time (), _reference (r) {}
|
||||
BBT_Argument (superclock_t r, int32_t B, int32_t b, int32_t t) : BBT_Time (B, b, t), _reference (r) {}
|
||||
|
||||
explicit BBT_Argument (BBT_Time const & bbt) : BBT_Time (bbt), _reference (Temporal::timepos_t (Temporal::BeatTime)) {}
|
||||
BBT_Argument (Temporal::timepos_t const & r, BBT_Time const & bbt) : BBT_Time (bbt), _reference (r) {}
|
||||
explicit BBT_Argument (BBT_Time const & bbt) : BBT_Time (bbt), _reference (0) {}
|
||||
BBT_Argument (superclock_t r, BBT_Time const & bbt) : BBT_Time (bbt), _reference (r) {}
|
||||
|
||||
Temporal::timepos_t reference() const { return _reference; }
|
||||
superclock_t reference() const { return _reference; }
|
||||
|
||||
private:
|
||||
Temporal::timepos_t _reference;
|
||||
superclock_t _reference;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -481,7 +481,7 @@ class LIBTEMPORAL_API TempoMetric
|
|||
TempoMetric (TempoPoint const & t, MeterPoint const & m) : _tempo (&t), _meter (&m) {}
|
||||
virtual ~TempoMetric () {}
|
||||
|
||||
timepos_t reftime() const;
|
||||
superclock_t reftime() const;
|
||||
|
||||
TempoPoint const & tempo() const { return *_tempo; }
|
||||
MeterPoint const & meter() const { return *_meter; }
|
||||
|
@ -720,7 +720,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
|||
LIBTEMPORAL_API static void abort_update ();
|
||||
|
||||
/* not part of public API */
|
||||
timepos_t reftime(TempoMetric const &) const;
|
||||
superclock_t reftime(TempoMetric const &) const;
|
||||
|
||||
/* and now on with the rest of the show ... */
|
||||
|
||||
|
|
|
@ -664,7 +664,7 @@ timepos_t::earlier (Temporal::BBT_Offset const & offset) const
|
|||
TempoMap::SharedPtr tm (TempoMap::use());
|
||||
|
||||
if (is_superclock()) {
|
||||
return timepos_t (tm->superclock_at (BBT_Argument (*this, tm->bbt_walk (BBT_Argument (*this, tm->bbt_at (*this)), -offset))));
|
||||
return timepos_t (tm->superclock_at (BBT_Argument (this->superclocks(), tm->bbt_walk (BBT_Argument (this->superclocks(), tm->bbt_at (*this)), -offset))));
|
||||
}
|
||||
|
||||
return timepos_t (tm->bbtwalk_to_quarters (beats(), -offset));
|
||||
|
@ -763,7 +763,7 @@ timepos_t::shift_earlier (Temporal::BBT_Offset const & offset)
|
|||
TempoMap::SharedPtr tm (TempoMap::use());
|
||||
|
||||
if (is_superclock()) {
|
||||
v = build (false, (tm->superclock_at (tm->bbt_walk (BBT_Argument (*this, tm->bbt_at (*this)), -offset))));
|
||||
v = build (false, (tm->superclock_at (tm->bbt_walk (BBT_Argument (this->superclocks(), tm->bbt_at (*this)), -offset))));
|
||||
} else {
|
||||
v = build (true, tm->bbtwalk_to_quarters (beats(), -offset).to_ticks());
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ timepos_t::operator+= (Temporal::BBT_Offset const & offset)
|
|||
if (is_beats()) {
|
||||
v = build (true, tm->bbtwalk_to_quarters (beats(), offset).to_ticks());
|
||||
} else {
|
||||
v = build (false, tm->superclock_at (tm->bbt_walk (BBT_Argument (*this, tm->bbt_at (*this)), offset)));
|
||||
v = build (false, tm->superclock_at (tm->bbt_walk (BBT_Argument (this->superclocks(), tm->bbt_at (*this)), offset)));
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
|
Loading…
Reference in New Issue
Block a user