require use of BBT_Argument as both parameter and return type from most methods (libs edition)
This commit is contained in:
parent
f033b5717d
commit
259499fc5f
@ -292,7 +292,7 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
|
||||
timepos_t current_pos() const;
|
||||
double position_as_fraction() const;
|
||||
|
||||
Temporal::BBT_Time compute_start (Temporal::TempoMap::SharedPtr const &, samplepos_t start, samplepos_t end, Temporal::BBT_Offset const & q, samplepos_t& start_samples, bool& will_start);
|
||||
Temporal::BBT_Argument compute_start (Temporal::TempoMap::SharedPtr const &, samplepos_t start, samplepos_t end, Temporal::BBT_Offset const & q, samplepos_t& start_samples, bool& will_start);
|
||||
virtual timepos_t compute_end (Temporal::TempoMap::SharedPtr const &, Temporal::BBT_Time const &, samplepos_t, Temporal::Beats &) = 0;
|
||||
virtual void start_and_roll_to (samplepos_t start, samplepos_t position, uint32_t cnt) = 0;
|
||||
|
||||
@ -337,11 +337,11 @@ class LIBARDOUR_API Trigger : public PBD::Stateful {
|
||||
|
||||
|
||||
bool compute_quantized_transition (samplepos_t start_sample, Temporal::Beats const & start, Temporal::Beats const & end,
|
||||
Temporal::BBT_Time& t_bbt, Temporal::Beats& t_beats, samplepos_t& t_samples,
|
||||
Temporal::BBT_Argument& t_bbt, Temporal::Beats& t_beats, samplepos_t& t_samples,
|
||||
Temporal::TempoMap::SharedPtr const & tmap, Temporal::BBT_Offset const & q);
|
||||
|
||||
pframes_t compute_next_transition (samplepos_t start_sample, Temporal::Beats const & start, Temporal::Beats const & end, pframes_t nframes,
|
||||
Temporal::BBT_Time& t_bbt, Temporal::Beats& t_beats, samplepos_t& t_samples,
|
||||
Temporal::BBT_Argument& t_bbt, Temporal::Beats& t_beats, samplepos_t& t_samples,
|
||||
Temporal::TempoMap::SharedPtr const & tmap);
|
||||
|
||||
|
||||
|
@ -795,8 +795,8 @@ LuaBindings::common (lua_State* L)
|
||||
.addFunction ("meter_at_bbt", (Temporal::MeterPoint const& (Temporal::TempoMap::*)(Temporal::BBT_Argument const &) const) &Temporal::TempoMap::meter_at)
|
||||
.addFunction ("meter_at_beats", (Temporal::MeterPoint const& (Temporal::TempoMap::*)(Temporal::Beats const &) const) &Temporal::TempoMap::meter_at)
|
||||
|
||||
.addFunction ("bbt_at", (Temporal::BBT_Time (Temporal::TempoMap::*)(Temporal::timepos_t const &) const) &Temporal::TempoMap::bbt_at)
|
||||
.addFunction ("bbt_at_beats", (Temporal::BBT_Time (Temporal::TempoMap::*)(Temporal::Beats const &) const) &Temporal::TempoMap::bbt_at)
|
||||
.addFunction ("bbt_at", (Temporal::BBT_Argument (Temporal::TempoMap::*)(Temporal::timepos_t const &) const) &Temporal::TempoMap::bbt_at)
|
||||
.addFunction ("bbt_at_beats", (Temporal::BBT_Argument (Temporal::TempoMap::*)(Temporal::Beats const &) const) &Temporal::TempoMap::bbt_at)
|
||||
|
||||
#ifdef WITH_SUPERCLOCK_BINDINGS
|
||||
.addFunction ("tempo_at_sc", (Temporal::TempoPoint const& (Temporal::TempoMap::*)(superclock_t) const) &Temporal::TempoMap::tempo_at)
|
||||
|
@ -234,7 +234,7 @@ Session::convert_to_samples (AnyTime const & position)
|
||||
|
||||
switch (position.type) {
|
||||
case AnyTime::BBT:
|
||||
return Temporal::superclock_to_samples (TempoMap::use()->superclock_at (position.bbt), _current_sample_rate);
|
||||
return Temporal::superclock_to_samples (TempoMap::use()->superclock_at (BBT_Argument (timepos_t::zero (Temporal::BeatTime), position.bbt)), _current_sample_rate);
|
||||
break;
|
||||
|
||||
case AnyTime::Timecode:
|
||||
|
@ -2120,8 +2120,8 @@ Session::flush_cue_recording ()
|
||||
_locations->clear_cue_markers (_last_roll_location, _transport_sample);
|
||||
|
||||
while (TriggerBox::cue_records.read (&cr, 1) == 1) {
|
||||
BBT_Time bbt = tmap->bbt_at (timepos_t (cr.when));
|
||||
bbt = bbt.round_up_to_bar ();
|
||||
BBT_Argument bbt = tmap->bbt_at (timepos_t (cr.when));
|
||||
bbt = BBT_Argument (bbt.reference(), bbt.round_up_to_bar ());
|
||||
|
||||
const timepos_t when (tmap->quarters_at (bbt));
|
||||
|
||||
|
@ -200,14 +200,14 @@ intptr_t Session::vst_callback (
|
||||
newflags |= (kVstTimeSigValid);
|
||||
}
|
||||
if ((value & (kVstPpqPosValid)) || (value & (kVstBarsValid))) {
|
||||
Temporal::BBT_Time bbt;
|
||||
Temporal::BBT_Argument bbt;
|
||||
|
||||
try {
|
||||
bbt = tmap->bbt_at (timepos_t (now));
|
||||
bbt.beats = 1;
|
||||
bbt.ticks = 0;
|
||||
/* exact quarter note */
|
||||
double ppqBar = DoubleableBeats (tmap->quarters_at (bbt)).to_double ();
|
||||
double ppqBar = DoubleableBeats (tmap->quarters_at (BBT_Argument (bbt))).to_double ();
|
||||
/* quarter note at sample position (not rounded to note subdivision) */
|
||||
double ppqPos = DoubleableBeats (tmap->quarters_at_sample (now)).to_double();
|
||||
if (value & (kVstPpqPosValid)) {
|
||||
|
@ -929,18 +929,18 @@ Trigger::process_state_requests (BufferSet& bufs, pframes_t dest_offset)
|
||||
}
|
||||
}
|
||||
|
||||
Temporal::BBT_Time
|
||||
Temporal::BBT_Argument
|
||||
Trigger::compute_start (Temporal::TempoMap::SharedPtr const & tmap, samplepos_t start, samplepos_t end, Temporal::BBT_Offset const & q, samplepos_t& start_samples, bool& will_start)
|
||||
{
|
||||
Temporal::Beats start_beats (tmap->quarters_at (timepos_t (start)));
|
||||
Temporal::Beats end_beats (tmap->quarters_at (timepos_t (end)));
|
||||
|
||||
Temporal::BBT_Time t_bbt;
|
||||
Temporal::BBT_Argument t_bbt;
|
||||
Temporal::Beats t_beats;
|
||||
|
||||
if (!compute_quantized_transition (start, start_beats, end_beats, t_bbt, t_beats, start_samples, tmap, q)) {
|
||||
will_start = false;
|
||||
return Temporal::BBT_Time ();
|
||||
return Temporal::BBT_Argument ();
|
||||
}
|
||||
|
||||
will_start = true;
|
||||
@ -949,7 +949,7 @@ Trigger::compute_start (Temporal::TempoMap::SharedPtr const & tmap, samplepos_t
|
||||
|
||||
bool
|
||||
Trigger::compute_quantized_transition (samplepos_t start_sample, Temporal::Beats const & start_beats, Temporal::Beats const & end_beats,
|
||||
Temporal::BBT_Time& t_bbt, Temporal::Beats& t_beats, samplepos_t& t_samples,
|
||||
Temporal::BBT_Argument& t_bbt, Temporal::Beats& t_beats, samplepos_t& t_samples,
|
||||
Temporal::TempoMap::SharedPtr const & tmap, Temporal::BBT_Offset const & q)
|
||||
{
|
||||
/* XXX need to use global grid here is quantization == zero */
|
||||
@ -958,7 +958,7 @@ Trigger::compute_quantized_transition (samplepos_t start_sample, Temporal::Beats
|
||||
* quantization, the next time for a transition.
|
||||
*/
|
||||
|
||||
Temporal::BBT_Time possible_bbt;
|
||||
Temporal::BBT_Argument possible_bbt;
|
||||
Temporal::Beats possible_beats;
|
||||
samplepos_t possible_samples;
|
||||
|
||||
@ -978,7 +978,7 @@ Trigger::compute_quantized_transition (samplepos_t start_sample, Temporal::Beats
|
||||
} else {
|
||||
|
||||
possible_bbt = tmap->bbt_at (timepos_t (start_beats));
|
||||
possible_bbt = possible_bbt.round_up_to_bar ();
|
||||
possible_bbt = Temporal::BBT_Argument (possible_bbt.reference(), possible_bbt.round_up_to_bar ());
|
||||
/* bars are 1-based; 'every 4 bars' means 'on bar 1, 5, 9, ...' */
|
||||
possible_bbt.bars = 1 + ((possible_bbt.bars-1) / q.bars * q.bars);
|
||||
possible_beats = tmap->quarters_at (possible_bbt);
|
||||
@ -1004,7 +1004,7 @@ Trigger::compute_quantized_transition (samplepos_t start_sample, Temporal::Beats
|
||||
|
||||
pframes_t
|
||||
Trigger::compute_next_transition (samplepos_t start_sample, Temporal::Beats const & start, Temporal::Beats const & end, pframes_t nframes,
|
||||
Temporal::BBT_Time& t_bbt, Temporal::Beats& t_beats, samplepos_t& t_samples,
|
||||
Temporal::BBT_Argument& t_bbt, Temporal::Beats& t_beats, samplepos_t& t_samples,
|
||||
Temporal::TempoMap::SharedPtr const & tmap)
|
||||
{
|
||||
using namespace Temporal;
|
||||
@ -1072,7 +1072,7 @@ Trigger::maybe_compute_next_transition (samplepos_t start_sample, Temporal::Beat
|
||||
return;
|
||||
}
|
||||
|
||||
Temporal::BBT_Time transition_bbt;
|
||||
Temporal::BBT_Argument transition_bbt;
|
||||
TempoMap::SharedPtr tmap (TempoMap::use());
|
||||
|
||||
if (!compute_next_transition (start_sample, start, end, nframes, transition_bbt, transition_beats, transition_samples, tmap)) {
|
||||
@ -1449,13 +1449,15 @@ 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
|
||||
*/
|
||||
|
||||
samplepos_t end_by_follow_length = tmap->sample_at (tmap->bbt_walk(transition_bbt, _follow_length));
|
||||
const Temporal::BBT_Argument transition_bba (timepos_t::zero (Temporal::BeatTime), 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);
|
||||
/* this could still blow up if the data is less than 1 tick long, but
|
||||
we should handle that elsewhere.
|
||||
*/
|
||||
const Temporal::Beats bc (Temporal::Beats::from_double (_beatcnt));
|
||||
samplepos_t end_by_beatcnt = tmap->sample_at (tmap->bbt_walk(transition_bbt, Temporal::BBT_Offset (0, bc.get_beats(), bc.get_ticks())));
|
||||
samplepos_t end_by_beatcnt = tmap->sample_at (tmap->bbt_walk (transition_bba, Temporal::BBT_Offset (0, bc.get_beats(), bc.get_ticks())));
|
||||
|
||||
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 SO %9 @ %2 / %3 / %4 ends: FL %5 (from %6) BC %7 DL %8\n",
|
||||
index(), transition_sample, transition_beats, transition_bbt,
|
||||
@ -2315,8 +2317,10 @@ 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)
|
||||
{
|
||||
Temporal::Beats end_by_follow_length = tmap->quarters_at (tmap->bbt_walk (transition_bbt, _follow_length));
|
||||
Temporal::Beats end_by_data_length = tmap->quarters_at (tmap->bbt_walk (transition_bbt, Temporal::BBT_Offset (0, data_length.get_beats(), data_length.get_ticks())));
|
||||
const Temporal::BBT_Argument transition_bba (timepos_t::zero(Temporal::BeatTime), 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())));
|
||||
|
||||
DEBUG_TRACE (DEBUG::Triggers, string_compose ("%1 ends: TB %2 FL %3 EBFL %4 DL %5 EBDL %6 tbbt %7 fl %8\n",
|
||||
index(), transition_beats, _follow_length, end_by_follow_length, data_length, end_by_data_length, transition_bbt, _follow_length));
|
||||
@ -2326,10 +2330,10 @@ MIDITrigger::compute_end (Temporal::TempoMap::SharedPtr const & tmap, Temporal::
|
||||
|
||||
if (internal_use_follow_length()) {
|
||||
final_beat = end_by_follow_length;
|
||||
effective_length = tmap->bbtwalk_to_quarters (transition_bbt, _follow_length);
|
||||
effective_length = tmap->bbtwalk_to_quarters (transition_bba, _follow_length);
|
||||
} else {
|
||||
final_beat = end_by_data_length;
|
||||
effective_length = tmap->bbtwalk_to_quarters (transition_bbt, Temporal::BBT_Offset (0, data_length.get_beats(), data_length.get_ticks()));
|
||||
effective_length = tmap->bbtwalk_to_quarters (transition_bba, Temporal::BBT_Offset (0, data_length.get_beats(), data_length.get_ticks()));
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -3192,7 +3196,7 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
||||
CueEvents::const_reverse_iterator c = cues.rbegin ();
|
||||
samplepos_t pos = c->time;
|
||||
TriggerPtr trig;
|
||||
Temporal::BBT_Time start_bbt;
|
||||
Temporal::BBT_Argument start_bbt;
|
||||
samplepos_t start_samples;
|
||||
Temporal::Beats effective_length;
|
||||
bool will_start;
|
||||
@ -3344,7 +3348,7 @@ TriggerBox::fast_forward (CueEvents const & cues, samplepos_t transport_position
|
||||
|
||||
if (start_samples < transport_position) {
|
||||
samplepos_t s = start_samples;
|
||||
BBT_Time ns = start_bbt;
|
||||
BBT_Argument ns = start_bbt;
|
||||
const BBT_Offset step (0, effective_length.get_beats(), effective_length.get_ticks());
|
||||
|
||||
do {
|
||||
|
@ -588,7 +588,7 @@ void
|
||||
BasicUI::jump_by_bars (int bars, LocateTransportDisposition ltd)
|
||||
{
|
||||
TempoMap::SharedPtr tmap (TempoMap::fetch());
|
||||
Temporal::BBT_Time bbt (tmap->bbt_at (timepos_t (session->transport_sample())));
|
||||
Temporal::BBT_Argument bbt (tmap->bbt_at (timepos_t (session->transport_sample())));
|
||||
|
||||
bbt.bars += bars;
|
||||
if (bbt.bars < 0) {
|
||||
|
@ -636,7 +636,7 @@ MeterPoint::get_state () const
|
||||
return base;
|
||||
}
|
||||
|
||||
Temporal::BBT_Time
|
||||
Temporal::BBT_Argument
|
||||
TempoMetric::bbt_at (timepos_t const & pos) const
|
||||
{
|
||||
if (pos.is_beats()) {
|
||||
@ -675,7 +675,9 @@ 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")));
|
||||
return _meter->bbt_add (reference_point->bbt(), bbt_offset);
|
||||
timepos_t ref (std::min (_meter->sclock(), _tempo->sclock()));
|
||||
|
||||
return BBT_Argument (ref, _meter->bbt_add (reference_point->bbt(), bbt_offset));
|
||||
}
|
||||
|
||||
superclock_t
|
||||
@ -1664,7 +1666,7 @@ TempoMap::remove_meter (MeterPoint const & mp, bool with_reset)
|
||||
}
|
||||
}
|
||||
|
||||
Temporal::BBT_Time
|
||||
Temporal::BBT_Argument
|
||||
TempoMap::bbt_at (timepos_t const & pos) const
|
||||
{
|
||||
if (pos.is_beats()) {
|
||||
@ -1673,16 +1675,20 @@ TempoMap::bbt_at (timepos_t const & pos) const
|
||||
return bbt_at (pos.superclocks());
|
||||
}
|
||||
|
||||
Temporal::BBT_Time
|
||||
Temporal::BBT_Argument
|
||||
TempoMap::bbt_at (superclock_t s) const
|
||||
{
|
||||
return metric_at (s).bbt_at (timepos_t::from_superclock (s));
|
||||
TempoMetric metric (metric_at (s));
|
||||
timepos_t ref (std::min (metric.tempo().sclock(), metric.meter().sclock()));
|
||||
return BBT_Argument (ref, metric.bbt_at (timepos_t::from_superclock (s)));
|
||||
}
|
||||
|
||||
Temporal::BBT_Time
|
||||
Temporal::BBT_Argument
|
||||
TempoMap::bbt_at (Temporal::Beats const & qn) const
|
||||
{
|
||||
return metric_at (qn).bbt_at (qn);
|
||||
TempoMetric metric (metric_at (qn));
|
||||
timepos_t ref (std::min (metric.tempo().sclock(), metric.meter().sclock()));
|
||||
return BBT_Argument (ref, metric.bbt_at (qn));
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -1940,7 +1946,7 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u
|
||||
TempoPoint const * tp = 0;
|
||||
MeterPoint const * mp = 0;
|
||||
Points::const_iterator p = _points.begin();
|
||||
BBT_Time bbt;
|
||||
BBT_Argument bbt;
|
||||
Beats beats;
|
||||
|
||||
/* Find relevant meter for nominal start point */
|
||||
@ -1980,7 +1986,7 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u
|
||||
* in effect at that time.
|
||||
*/
|
||||
|
||||
const BBT_Time new_bbt = metric.meter().round_up_to_beat (bbt);
|
||||
const BBT_Argument new_bbt (metric.reftime(), metric.meter().round_up_to_beat (bbt));
|
||||
|
||||
if (new_bbt != bbt) {
|
||||
|
||||
@ -2032,8 +2038,7 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u
|
||||
|
||||
if (bar != bbt) {
|
||||
|
||||
bbt = bar;
|
||||
|
||||
bbt = BBT_Argument (bbt.reference(), bar);
|
||||
|
||||
/* rebuild metric */
|
||||
|
||||
@ -2334,7 +2339,7 @@ std::operator<<(std::ostream& str, TempoMapPoint const & tmp)
|
||||
return str;
|
||||
}
|
||||
|
||||
BBT_Time
|
||||
BBT_Argument
|
||||
TempoMap::bbt_walk (BBT_Argument const & bbt, BBT_Offset const & o) const
|
||||
{
|
||||
BBT_Offset offset (o);
|
||||
@ -2348,7 +2353,7 @@ TempoMap::bbt_walk (BBT_Argument const & bbt, BBT_Offset const & o) const
|
||||
/* trivial (and common) case: single tempo, single meter */
|
||||
|
||||
if (_tempos.size() == 1 && _meters.size() == 1) {
|
||||
return _meters.front().bbt_add (bbt, o);
|
||||
return BBT_Argument (_meters.front().bbt_add (bbt, o));
|
||||
}
|
||||
|
||||
/* Find tempo,meter pair for bbt, and also for the next tempo and meter
|
||||
@ -2454,8 +2459,7 @@ TempoMap::bbt_walk (BBT_Argument const & bbt, BBT_Offset const & o) const
|
||||
start.ticks %= ticks_per_beat;
|
||||
}
|
||||
|
||||
|
||||
return start;
|
||||
return BBT_Argument (metric.reftime(), start);
|
||||
}
|
||||
|
||||
Temporal::Beats
|
||||
|
@ -33,7 +33,7 @@ struct LIBTEMPORAL_API BBT_Argument : public BBT_Time
|
||||
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) {}
|
||||
|
||||
/*explicit*/ BBT_Argument (BBT_Time const & bbt) : BBT_Time (bbt), _reference (Temporal::timepos_t (Temporal::BeatTime)) {}
|
||||
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) {}
|
||||
|
||||
Temporal::timepos_t reference() const { return _reference; }
|
||||
|
@ -470,6 +470,8 @@ class LIBTEMPORAL_API TempoMetric
|
||||
TempoMetric (TempoPoint const & t, MeterPoint const & m) : _tempo (&t), _meter (&m) {}
|
||||
virtual ~TempoMetric () {}
|
||||
|
||||
timepos_t reftime() const { return timepos_t (std::min (_tempo->sclock(), _meter->sclock())); }
|
||||
|
||||
TempoPoint const & tempo() const { return *_tempo; }
|
||||
MeterPoint const & meter() const { return *_meter; }
|
||||
|
||||
@ -483,7 +485,7 @@ class LIBTEMPORAL_API TempoMetric
|
||||
superclock_t superclock_at (Beats const & qn) const { return _tempo->superclock_at (qn); }
|
||||
samplepos_t sample_at (Beats const & qn) const { return _tempo->sample_at (qn); }
|
||||
Beats quarters_at (BBT_Time const & bbt) const { return _meter->quarters_at (bbt); }
|
||||
BBT_Time bbt_at (Beats const & beats) const { return _meter->bbt_at (beats); }
|
||||
BBT_Argument bbt_at (Beats const & beats) const { return BBT_Argument (reftime(), _meter->bbt_at (beats)); }
|
||||
|
||||
superclock_t superclocks_per_note_type () const { return _tempo->superclocks_per_note_type (); }
|
||||
superclock_t end_superclocks_per_note_type () const {return _tempo->end_superclocks_per_note_type (); }
|
||||
@ -494,9 +496,9 @@ class LIBTEMPORAL_API TempoMetric
|
||||
int note_type () const { return _tempo->note_type(); }
|
||||
int divisions_per_bar () const { return _meter->divisions_per_bar(); }
|
||||
int note_value() const { return _meter->note_value(); }
|
||||
BBT_Time bbt_add (BBT_Time const & bbt, BBT_Offset const & add) const { return _meter->bbt_add (bbt, add); }
|
||||
BBT_Time bbt_subtract (BBT_Time const & bbt, BBT_Offset const & sub) const { return _meter->bbt_subtract (bbt, sub); }
|
||||
BBT_Time round_to_bar (BBT_Time const & bbt) const { return _meter->round_to_bar (bbt); }
|
||||
BBT_Argument bbt_add (BBT_Time const & bbt, BBT_Offset const & add) const { return BBT_Argument (reftime(), _meter->bbt_add (bbt, add)); }
|
||||
BBT_Argument bbt_subtract (BBT_Time const & bbt, BBT_Offset const & sub) const { return BBT_Argument (reftime(), _meter->bbt_subtract (bbt, sub)); }
|
||||
BBT_Argument round_to_bar (BBT_Time const & bbt) const { return BBT_Argument (reftime(), _meter->round_to_bar (bbt)); }
|
||||
Beats to_quarters (BBT_Offset const & bbo) const { return _meter->to_quarters (bbo); }
|
||||
|
||||
/* combination methods that require both tempo and meter information */
|
||||
@ -519,7 +521,7 @@ class LIBTEMPORAL_API TempoMetric
|
||||
return int_div_round (superclocks_per_note_type_at_superclock (sc) * _tempo->note_type(), (int64_t) _meter->note_value());
|
||||
}
|
||||
|
||||
BBT_Time bbt_at (timepos_t const &) const;
|
||||
BBT_Argument bbt_at (timepos_t const &) const;
|
||||
superclock_t superclock_at (BBT_Time const &) const;
|
||||
|
||||
samplepos_t samples_per_bar (samplecnt_t sr) const {
|
||||
@ -849,12 +851,12 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
||||
LIBTEMPORAL_API double quarters_per_minute_at (timepos_t const & pos) const;
|
||||
|
||||
/* convenience function */
|
||||
LIBTEMPORAL_API BBT_Time round_to_bar (BBT_Argument const & bbt) const {
|
||||
return metric_at (bbt).meter().round_to_bar (bbt);
|
||||
LIBTEMPORAL_API BBT_Argument round_to_bar (BBT_Argument const & bbt) const {
|
||||
return metric_at (bbt).round_to_bar (bbt);
|
||||
}
|
||||
|
||||
LIBTEMPORAL_API BBT_Time bbt_at (timepos_t const &) const;
|
||||
LIBTEMPORAL_API BBT_Time bbt_at (Beats const &) const;
|
||||
LIBTEMPORAL_API BBT_Argument bbt_at (timepos_t const &) const;
|
||||
LIBTEMPORAL_API BBT_Argument bbt_at (Beats const &) const;
|
||||
|
||||
LIBTEMPORAL_API Beats quarters_at (BBT_Argument const &) const;
|
||||
LIBTEMPORAL_API Beats quarters_at (timepos_t const &) const;
|
||||
@ -880,7 +882,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
||||
|
||||
LIBTEMPORAL_API Temporal::timecnt_t convert_duration (Temporal::timecnt_t const & duration, Temporal::timepos_t const &, Temporal::TimeDomain domain) const;
|
||||
|
||||
LIBTEMPORAL_API BBT_Time bbt_walk (BBT_Argument const &, BBT_Offset const &) const;
|
||||
LIBTEMPORAL_API BBT_Argument bbt_walk (BBT_Argument const &, BBT_Offset const &) const;
|
||||
|
||||
LIBTEMPORAL_API void get_grid (TempoMapPoints & points, superclock_t start, superclock_t end, uint32_t bar_mod = 0, uint32_t beat_div = 1) const;
|
||||
LIBTEMPORAL_API uint32_t count_bars (Beats const & start, Beats const & end) const;
|
||||
@ -939,7 +941,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
||||
|
||||
void copy_points (TempoMap const & other);
|
||||
|
||||
BBT_Time bbt_at (superclock_t sc) const;
|
||||
BBT_Argument bbt_at (superclock_t sc) const;
|
||||
|
||||
template<typename T, typename T1> struct const_traits {
|
||||
typedef Points::const_iterator iterator_type;
|
||||
|
@ -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 (tm->bbt_walk (tm->bbt_at (*this), -offset)));
|
||||
return timepos_t (tm->superclock_at (BBT_Argument (*this, tm->bbt_walk (BBT_Argument (*this, 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 (tm->bbt_at (*this), -offset))));
|
||||
v = build (false, (tm->superclock_at (tm->bbt_walk (BBT_Argument (*this, 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 (tm->bbt_at (*this), offset)));
|
||||
v = build (false, tm->superclock_at (tm->bbt_walk (BBT_Argument (*this, tm->bbt_at (*this)), offset)));
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
Loading…
Reference in New Issue
Block a user