temporal: adjust cut buffer API to better deal with start/end "guard points"

This commit is contained in:
Paul Davis 2023-06-05 17:27:12 -06:00
parent 7789df5b1c
commit f5f87f86d4
2 changed files with 95 additions and 10 deletions

View file

@ -1156,12 +1156,21 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
class LIBTEMPORAL_API TempoMapCutBuffer
{
public:
TempoMapCutBuffer (timecnt_t const &, TempoMetric const &, TempoMetric const &);
TempoMapCutBuffer (timecnt_t const &);
~TempoMapCutBuffer ();
timecnt_t duration() const { return _duration; }
TempoMetric const & metric_at_start () const { return _start_metric; }
TempoMetric const & metric_at_end () const { return _end_metric; }
void add_start_tempo (Tempo const & t);
void add_end_tempo (Tempo const & t);
void add_start_meter (Meter const & t);
void add_end_meter (Meter const & t);
Tempo const * tempo_at_start () const { return _start_tempo; }
Tempo const * tempo_at_end () const { return _end_tempo; }
Meter const * meter_at_start () const { return _start_meter; }
Meter const * meter_at_end () const { return _end_meter; }
typedef boost::intrusive::list<TempoPoint, boost::intrusive::base_hook<tempo_hook>> Tempos;
typedef boost::intrusive::list<MeterPoint, boost::intrusive::base_hook<meter_hook>> Meters;
@ -1182,8 +1191,10 @@ class LIBTEMPORAL_API TempoMapCutBuffer
Points const & points() const { return _points; }
private:
TempoMetric _start_metric;
TempoMetric _end_metric;
Tempo* _start_tempo;
Tempo* _end_tempo;
Meter* _start_meter;
Meter* _end_meter;
timecnt_t _duration;
Tempos _tempos;