96 return std::upper_bound(values.begin(), values.end(), value,
TickObjLess<T>);
115 return std::lower_bound(values.begin(), values.end(), value,
TickObjLess<T>);
134typename std::vector<TickObj<T> >::const_iterator
136 return std::upper_bound(values.begin(), values.end(), nTick,
TickObjBefore<T>);
149typename std::vector<TickObj<T> >::const_iterator
151 return std::lower_bound(values.begin(), values.end(), nTick,
TickObjAfter<T>);
170typename std::vector<TickObj<T> >::const_iterator
172 if (values.begin() == values.end()) {
176 if (upper == values.begin()) {
192typename std::vector<TickObj<T> >::const_iterator
194 if (values.begin() == values.end()) {
218 if (values.size() != 0 && !(value.
mPosition.
mTick < values.back().mPosition.mTick)) {
219 values.push_back(value);
241 typename std::vector<TickObj<T> >::iterator it =
LowerBoundByEntry(values, entry);
242 if (it != values.end() && it->mPosition.mTick == nTick) {
246 values.insert(it, entry);
int mTick
The position, in MIDI ticks at 480 per quarter note.
Definition tick.h:153
One value at one song position.
Definition tickobj.h:20
T mValue
Definition tickobj.h:22
Sch::Tick mPosition
Definition tickobj.h:21
std::vector< TickObj< T > >::const_iterator UpperBoundByTick(const std::vector< TickObj< T > > &values, int nTick)
Find the first entry a song position strictly precedes.
Definition tickobjvector.h:135
bool TickObjAfter(TickObj< T > entry, int nTick)
Report whether an entry comes strictly before a song position.
Definition tickobjvector.h:76
std::vector< TickObj< T > >::const_iterator LowerBoundByTick(const std::vector< TickObj< T > > &values, int nTick)
Find the first entry at or after a song position.
Definition tickobjvector.h:150
void InsertSorted(std::vector< TickObj< T > > &values, const TickObj< T > &value)
Insert an entry at its sorted place, after every entry at the same position.
Definition tickobjvector.h:217
std::vector< TickObj< T > >::iterator LowerBoundByEntry(std::vector< TickObj< T > > &values, const TickObj< T > &value)
Find the first entry a value does not follow.
Definition tickobjvector.h:113
std::vector< TickObj< T > >::const_iterator FindAtOrAfter(const std::vector< TickObj< T > > &values, int nTick)
Find the first entry at or after a song position.
Definition tickobjvector.h:193
void InsertAtLowerBound(std::vector< TickObj< T > > &values, const TickObj< T > &value)
Insert an entry before every entry at the same position, always searching first.
Definition tickobjvector.h:260
std::vector< TickObj< T > >::iterator UpperBoundByEntry(std::vector< TickObj< T > > &values, const TickObj< T > &value)
Find the first entry a value strictly precedes.
Definition tickobjvector.h:94
bool TickObjLess(TickObj< T > first, TickObj< T > second)
Order two entries by song position.
Definition tickobjvector.h:40
void InsertAtTick(std::vector< TickObj< T > > &values, const T &value, int nTick)
Insert a value at a song position, after every entry at the same position.
Definition tickobjvector.h:278
void SetAtTick(std::vector< TickObj< T > > &values, const T &value, int nTick)
Store a value at a song position, overwriting the first entry already at that position.
Definition tickobjvector.h:237
bool TickObjBefore(int nTick, TickObj< T > entry)
Report whether a song position comes strictly before an entry.
Definition tickobjvector.h:60
std::vector< TickObj< T > >::const_iterator FindAtOrBefore(const std::vector< TickObj< T > > &values, int nTick)
Find the last entry at or before a song position.
Definition tickobjvector.h:171