temporal: the second variant of shift() (untested)
This commit is contained in:
parent
e6b6340f3e
commit
d761ccb59b
|
@ -945,8 +945,7 @@ void
|
||||||
TempoMap::paste (TempoMapCutBuffer const & cb, timepos_t const & position, bool ripple)
|
TempoMap::paste (TempoMapCutBuffer const & cb, timepos_t const & position, bool ripple)
|
||||||
{
|
{
|
||||||
if (ripple) {
|
if (ripple) {
|
||||||
|
shift (position, cb.duration());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool replaced_ignored;
|
bool replaced_ignored;
|
||||||
|
@ -1010,30 +1009,24 @@ TempoMap::paste (TempoMapCutBuffer const & cb, timepos_t const & position, bool
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void
|
void
|
||||||
TempoMap::shift (timepos_t const & at, timecnt_t const & by)
|
TempoMap::shift (timepos_t const & at, timecnt_t const & by)
|
||||||
{
|
{
|
||||||
if (by.time_domain() == BeatTime) {
|
superclock_t distance = by.superclocks ();
|
||||||
|
superclock_t at_superclocks = by.superclocks ();
|
||||||
|
Points::iterator p = _points.begin();
|
||||||
|
|
||||||
} else {
|
while (p->sclock() < at_superclocks) {
|
||||||
superclock_t distance = by.superclocks ();
|
++p;
|
||||||
superclock_t at_superclocks = by.superclocks ();
|
|
||||||
Points::iterator p = _points.begin();
|
|
||||||
|
|
||||||
while (p.sclock() < at_superclocks) {
|
|
||||||
++p;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p == _points.end()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
p->set (at_superclocks + distance, p->beats(), p->bbt());
|
|
||||||
reset_starting_at (at_superclocks);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p == _points.end()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
p->set (at_superclocks + distance, p->beats(), p->bbt());
|
||||||
|
reset_starting_at (at_superclocks);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TempoMap::shift (timepos_t const & at, BBT_Offset const & offset)
|
TempoMap::shift (timepos_t const & at, BBT_Offset const & offset)
|
||||||
|
|
|
@ -822,7 +822,8 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
|
||||||
LIBTEMPORAL_API TempoMapCutBuffer* copy (timepos_t const & start, timepos_t const & end);
|
LIBTEMPORAL_API TempoMapCutBuffer* copy (timepos_t const & start, timepos_t const & end);
|
||||||
LIBTEMPORAL_API void paste (TempoMapCutBuffer const &, timepos_t const & position, bool ripple);
|
LIBTEMPORAL_API void paste (TempoMapCutBuffer const &, timepos_t const & position, bool ripple);
|
||||||
|
|
||||||
LIBTEMPORAL_API void shift (timepos_t const & at, BBT_Offset const &);
|
LIBTEMPORAL_API void shift (timepos_t const & at, BBT_Offset const & by);
|
||||||
|
LIBTEMPORAL_API void shift (timepos_t const & at, timecnt_t const & by);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename TimeType, typename Comparator> TempoPoint const & _tempo_at (TimeType when, Comparator cmp) const {
|
template<typename TimeType, typename Comparator> TempoPoint const & _tempo_at (TimeType when, Comparator cmp) const {
|
||||||
|
|
Loading…
Reference in New Issue