resonance 1.0.1
Loading...
Searching...
No Matches
tickobjvector.h File Reference
#include <algorithm>
#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>
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.
Ghidra address:
NTSC-U/C: 0x001b7068
Ghidra address:
PAL: 0x001bce40
Ghidra address:
NTSC-U/C: 0x001d7f70
Ghidra address:
PAL: 0x001dde50
Ghidra address:
NTSC-U/C: 0x001d7f80
Ghidra address:
PAL: 0x001dde60
Ghidra address:
NTSC-U/C: 0x001d7f90
Ghidra address:
PAL: 0x001dde70
Ghidra address:
NTSC-U/C: 0x001a9860
Ghidra address:
PAL: 0x001af5c8

◆ 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.
Ghidra address:
NTSC-U/C: 0x001b70e0
Ghidra address:
PAL: 0x001bceb8
Ghidra address:
NTSC-U/C: 0x001d8028
Ghidra address:
PAL: 0x001ddf08
Ghidra address:
NTSC-U/C: 0x001d8038
Ghidra address:
PAL: 0x001ddf18
Ghidra address:
NTSC-U/C: 0x001d8048
Ghidra address:
PAL: 0x001ddf28

◆ 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.
Ghidra address:
NTSC-U/C: 0x001d80a0
Ghidra address:
PAL: 0x001ddf80
Ghidra address:
NTSC-U/C: 0x001a9a10
Ghidra address:
PAL: 0x001af778

◆ 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.
Ghidra address:
NTSC-U/C: 0x001b5b40
Ghidra address:
PAL: 0x001bb918
Ghidra address:
NTSC-U/C: 0x001d6898
Ghidra address:
PAL: 0x001dc778
Ghidra address:
NTSC-U/C: 0x001d6a48
Ghidra address:
PAL: 0x001dc928

◆ 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.
Ghidra address:
NTSC-U/C: 0x001a91a8
Ghidra address:
PAL: 0x001aef10
Ghidra address:
NTSC-U/C: 0x001d5b98
Ghidra address:
PAL: 0x001dba78
Ghidra address:
NTSC-U/C: 0x001d61d8
Ghidra address:
PAL: 0x001dc0b8

◆ 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.
Ghidra address:
NTSC-U/C: 0x001b6278
Ghidra address:
PAL: 0x001bc050
Ghidra address:
NTSC-U/C: 0x001d7050
Ghidra address:
PAL: 0x001dcf30
Ghidra address:
NTSC-U/C: 0x001d7108
Ghidra address:
PAL: 0x001dcfe8
Ghidra address:
NTSC-U/C: 0x001d71c0
Ghidra address:
PAL: 0x001dd0a0

◆ 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.
Ghidra address:
NTSC-U/C: 0x001d7278
Ghidra address:
PAL: 0x001dd158

◆ 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.
Ghidra address:
NTSC-U/C: 0x001b7290
Ghidra address:
PAL: 0x001bd068
Ghidra address:
NTSC-U/C: 0x001d80e8
Ghidra address:
PAL: 0x001ddfc8
Ghidra address:
NTSC-U/C: 0x001d8130
Ghidra address:
PAL: 0x001de010
Ghidra address:
NTSC-U/C: 0x001d8058
Ghidra address:
PAL: 0x001ddf38

◆ 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.
Ghidra address:
NTSC-U/C: 0x001d80b0
Ghidra address:
PAL: 0x001ddf90

◆ 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.
Ghidra address:
NTSC-U/C: 0x001b5e80
Ghidra address:
PAL: 0x001bbc58
Ghidra address:
NTSC-U/C: 0x001a90c0
Ghidra address:
PAL: 0x001aee28
Ghidra address:
NTSC-U/C: 0x001d6960
Ghidra address:
PAL: 0x001dc840
Ghidra address:
NTSC-U/C: 0x001d6b10
Ghidra address:
PAL: 0x001dc9f0

◆ 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.
Ghidra address:
NTSC-U/C: 0x001d5f00
Ghidra address:
PAL: 0x001dbde0
Ghidra address:
NTSC-U/C: 0x001d6540
Ghidra address:
PAL: 0x001dc420

◆ 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.
Ghidra address:
NTSC-U/C: 0x001a9a20
Ghidra address:
PAL: 0x001af788

◆ 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.
Ghidra address:
NTSC-U/C: 0x001d7fa0
Ghidra address:
PAL: 0x001dde80
Ghidra address:
NTSC-U/C: 0x001d7fc8
Ghidra address:
PAL: 0x001ddea8
Ghidra address:
NTSC-U/C: 0x001d8000
Ghidra address:
PAL: 0x001ddee0