wavelength 1.0.0
Loading...
Searching...
No Matches
tickobjvector.h File Reference
#include <algorithm>
#include <functional>
#include <vector>
#include "mid/tickobj.h"
Include dependency graph for tickobjvector.h:

Go to the source code of this file.

Functions

template<typename T>
bool TickObjLess (TickObj< T > first, TickObj< T > second)
 Order two entries by song position.
template<typename T>
bool TickObjBefore (int nTick, TickObj< T > entry)
 Report whether a song position comes strictly before an entry.
template<typename T>
bool TickObjAfter (TickObj< T > entry, int nTick)
 Report whether an entry comes strictly before a song position.
template<typename T>
std::vector< TickObj< T > >::iterator UpperBoundByEntry (std::vector< TickObj< T > > &values, const TickObj< T > &value)
 Find the first entry a value strictly precedes.
template<typename T>
std::vector< TickObj< T > >::iterator LowerBoundByEntry (std::vector< TickObj< T > > &values, const TickObj< T > &value)
 Find the first entry a value does not follow.
template<typename T>
std::vector< TickObj< T > >::const_iterator UpperBoundByTick (const std::vector< TickObj< T > > &values, int nTick)
 Find the first entry a song position strictly precedes.
template<typename T>
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.
template<typename T>
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.
template<typename T>
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.
template<typename T>
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.
template<typename T, typename Compare>
void InsertOrdered (const T &value, std::vector< T > &values, Compare compare)
 Insert a value at its lower bound under a comparator, before every equal value.
template<typename T>
void InsertOrdered (const T &value, std::vector< T > &values)
 Insert a value at its lower bound, before every equal value.
template<typename T, typename Compare>
void AddOrdered (const T &value, std::vector< T > &values, Compare compare)
 Append a value that does not sort before the last one, and otherwise insert it at its lower bound.
template<typename T>
void AddOrdered (const T &value, std::vector< T > &values)
 Append a value that does not sort before the last one, and otherwise insert it at its lower bound.
template<typename T, typename Compare>
std::vector< T >::const_iterator FindOrdered (const T &key, const std::vector< T > &values, Compare compare)
 Find the last value that does not sort after a key.
template<typename T>
std::vector< T >::const_iterator FindOrdered (const T &key, const std::vector< T > &values)
 Find the last value that does not sort after a key.
template<typename T>
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.
template<typename T>
void InsertAtLowerBound (std::vector< TickObj< T > > &values, const TickObj< T > &value)
 Insert an entry before every entry at the same position, always searching first.
template<typename T>
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.

Function Documentation

◆ TickObjLess()

template<typename T>
bool TickObjLess ( TickObj< T > first,
TickObj< T > second )

Order two entries by song position.

Instantiated for TickObj<float> at 0x001b7068 in the Phrase unit, and three times in the TrackData unit.

Parameters
firstThe first entry.
secondThe second entry.
Returns
Whether first comes strictly before second.

◆ TickObjBefore()

template<typename T>
bool TickObjBefore ( int nTick,
TickObj< T > entry )

Report whether a song position comes strictly before an entry.

Parameters
nTickThe song position, in MIDI ticks.
entryThe entry.
Returns
Whether nTick comes strictly before entry.

◆ TickObjAfter()

template<typename T>
bool TickObjAfter ( TickObj< T > entry,
int nTick )

Report whether an entry comes strictly before a song position.

Parameters
entryThe entry.
nTickThe song position, in MIDI ticks.
Returns
Whether entry comes strictly before nTick.

◆ UpperBoundByEntry()

template<typename T>
std::vector< TickObj< T > >::iterator UpperBoundByEntry ( std::vector< TickObj< T > > & values,
const TickObj< T > & value )

Find the first entry a value strictly precedes.

Parameters
valuesThe entries, sorted by position.
valueThe value to place.
Returns
The upper bound of value.

◆ LowerBoundByEntry()

template<typename T>
std::vector< TickObj< T > >::iterator LowerBoundByEntry ( std::vector< TickObj< T > > & values,
const TickObj< T > & value )

Find the first entry a value does not follow.

Parameters
valuesThe entries, sorted by position.
valueThe value to place.
Returns
The lower bound of value.

◆ UpperBoundByTick()

template<typename T>
std::vector< TickObj< T > >::const_iterator UpperBoundByTick ( const std::vector< TickObj< T > > & values,
int nTick )

Find the first entry a song position strictly precedes.

Parameters
valuesThe entries, sorted by position.
nTickThe song position, in MIDI ticks.
Returns
The upper bound of nTick.

◆ LowerBoundByTick()

template<typename T>
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.

Parameters
valuesThe entries, sorted by position.
nTickThe song position, in MIDI ticks.
Returns
The lower bound of nTick.

◆ FindAtOrBefore()

template<typename T>
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.

Parameters
valuesThe entries, sorted by position.
nTickThe song position, in MIDI ticks.
Returns
The entry, or the end when every entry follows nTick.

◆ FindAtOrAfter()

template<typename T>
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.

Parameters
valuesThe entries, sorted by position.
nTickThe song position, in MIDI ticks.
Returns
The entry, or the end when every entry precedes nTick.

◆ InsertSorted()

template<typename T>
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.

An entry that does not precede the last one is appended without a search.

Parameters
valuesThe entries, sorted by position.
valueThe entry to insert.

◆ InsertOrdered() [1/2]

template<typename T, typename Compare>
void InsertOrdered ( const T & value,
std::vector< T > & values,
Compare compare )

Insert a value at its lower bound under a comparator, before every equal value.

The addresses are of the instantiations for the entries of PitchTrackRiffData::RiffSet, ScratchTrackData::ScratcherSet, AxeHarmony, and AxeTrackData::ContourSet, in that order.

Parameters
valueThe value to insert.
valuesThe values, sorted under compare.
compareThe ordering.
Ghidra address:
NTSC-U/C: 0x0033d520
Ghidra address:
PAL: 0x003aaa58
Ghidra address:
NTSC-U/C: 0x00340148
Ghidra address:
PAL: 0x003ad680
Ghidra address:
NTSC-U/C: 0x00348b80
Ghidra address:
PAL: 0x003b5fb0
Ghidra address:
NTSC-U/C: 0x003490a8
Ghidra address:
PAL: 0x003b64d8

◆ InsertOrdered() [2/2]

template<typename T>
void InsertOrdered ( const T & value,
std::vector< T > & values )

Insert a value at its lower bound, before every equal value.

The addresses are of the instantiations for the entries of PitchTrackRiffData::RiffSet, ScratchTrackData::ScratcherSet, AxeHarmony, and AxeTrackData::ContourSet, in that order.

Parameters
valueThe value to insert.
valuesThe values, sorted.
Ghidra address:
NTSC-U/C: 0x0033d920
Ghidra address:
PAL: 0x003aae58
Ghidra address:
NTSC-U/C: 0x00340478
Ghidra address:
PAL: 0x003ad9b0
Ghidra address:
NTSC-U/C: 0x00348e20
Ghidra address:
PAL: 0x003b6250
Ghidra address:
NTSC-U/C: 0x003493d8
Ghidra address:
PAL: 0x003b6808

◆ AddOrdered() [1/2]

template<typename T, typename Compare>
void AddOrdered ( const T & value,
std::vector< T > & values,
Compare compare )

Append a value that does not sort before the last one, and otherwise insert it at its lower bound.

The comparator decides only whether to append. The insertion orders the values by their own less-than. The addresses are of the instantiations for the entries of ScratchTrackData::ScratcherSet, AxeHarmony, and AxeTrackData::ContourSet, in that order.

Parameters
valueThe value to add.
valuesThe values, sorted under compare.
compareThe ordering.
Ghidra address:
NTSC-U/C: 0x00340498
Ghidra address:
PAL: 0x003ad9d0
Ghidra address:
NTSC-U/C: 0x00348e40
Ghidra address:
PAL: 0x003b6270
Ghidra address:
NTSC-U/C: 0x003493f8
Ghidra address:
PAL: 0x003b6828

◆ AddOrdered() [2/2]

template<typename T>
void AddOrdered ( const T & value,
std::vector< T > & values )

Append a value that does not sort before the last one, and otherwise insert it at its lower bound.

The addresses are of the instantiations for the entries of ScratchTrackData::ScratcherSet, AxeHarmony, and AxeTrackData::ContourSet, in that order.

Parameters
valueThe value to add.
valuesThe values, sorted.
Ghidra address:
NTSC-U/C: 0x003406d0
Ghidra address:
PAL: 0x003adc08
Ghidra address:
NTSC-U/C: 0x00349038
Ghidra address:
PAL: 0x003b6468
Ghidra address:
NTSC-U/C: 0x00349630
Ghidra address:
PAL: 0x003b6a60

◆ FindOrdered() [1/2]

template<typename T, typename Compare>
std::vector< T >::const_iterator FindOrdered ( const T & key,
const std::vector< T > & values,
Compare compare )

Find the last value that does not sort after a key.

The addresses are of the instantiations for the entries of ScratchTrackData::ScratcherSet, AxeTrackData::ContourSet, and AxeHarmony, in that order.

Parameters
keyThe key.
valuesThe values, sorted under compare.
compareThe ordering.
Returns
The value, or the end when every value sorts after key.
Ghidra address:
NTSC-U/C: 0x00340088
Ghidra address:
PAL: 0x003ad5c0
Ghidra address:
NTSC-U/C: 0x003496a0
Ghidra address:
PAL: 0x003b6ad0
Ghidra address:
NTSC-U/C: 0x00349760
Ghidra address:
PAL: 0x003b6b90

◆ FindOrdered() [2/2]

template<typename T>
std::vector< T >::const_iterator FindOrdered ( const T & key,
const std::vector< T > & values )

Find the last value that does not sort after a key.

The addresses are of the instantiations for the entries of ScratchTrackData::ScratcherSet, AxeTrackData::ContourSet, and AxeHarmony, in that order.

Parameters
keyThe key.
valuesThe values, sorted.
Returns
The value, or the end when every value sorts after key.
Ghidra address:
NTSC-U/C: 0x003400d8
Ghidra address:
PAL: 0x003ad610
Ghidra address:
NTSC-U/C: 0x003496f0
Ghidra address:
PAL: 0x003b6b20
Ghidra address:
NTSC-U/C: 0x003497b0
Ghidra address:
PAL: 0x003b6be0

◆ SetAtTick()

template<typename T>
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.

Parameters
valuesThe entries, sorted by position.
valueThe value.
nTickThe song position, in MIDI ticks.

◆ InsertAtLowerBound()

template<typename T>
void InsertAtLowerBound ( std::vector< TickObj< T > > & values,
const TickObj< T > & value )

Insert an entry before every entry at the same position, always searching first.

MultiMuse::Add() takes this path when it is told not to try appending.

Parameters
valuesThe entries, sorted by position.
valueThe entry to insert.

◆ InsertAtTick()

template<typename T>
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.

Parameters
valuesThe entries, sorted by position.
valueThe value.
nTickThe song position, in MIDI ticks.