Etterna 0.74.4
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TimingData Class Reference

Holds data for translating beats<->seconds. More...

#include <TimingData.h>

Collaboration diagram for TimingData:
Collaboration graph
[legend]

Classes

struct  GetBeatArgs
 
struct  GetBeatStarts
 
struct  lookup_item_t
 

Public Types

using beat_start_lookup_t = std::vector< lookup_item_t >
 

Public Member Functions

 TimingData (float fOffset=0.F)
 Sets up initial timing data with a defined offset.
 
void Copy (const TimingData &other)
 
void Clear ()
 
 TimingData (const TimingData &cpy)
 
auto operator= (const TimingData &cpy) -> TimingData &
 
auto operator= (TimingData &&other) noexcept -> TimingData &
 
void PrepareLookup ()
 
void ReleaseLookup ()
 
auto GetSegmentIndexAtRow (TimingSegmentType tst, int row) const -> int
 
auto GetSegmentIndexAtBeat (TimingSegmentType tst, float beat) const -> int
 
auto GetNextSegmentBeatAtRow (TimingSegmentType tst, int row) const -> float
 
auto GetNextSegmentBeatAtBeat (TimingSegmentType tst, float beat) const -> float
 
auto GetPreviousSegmentBeatAtRow (TimingSegmentType tst, int row) const -> float
 
auto GetPreviousSegmentBeatAtBeat (TimingSegmentType tst, float beat) const -> float
 
auto empty () const -> bool
 
void CopyRange (int start_row, int end_row, TimingSegmentType copy_type, int dest_row, TimingData &dest) const
 
void ShiftRange (int start_row, int end_row, TimingSegmentType shift_type, int shift_amount)
 
void ClearRange (int start_row, int end_row, TimingSegmentType clear_type)
 
void GetActualBPM (float &fMinBPMOut, float &fMaxBPMOut, float highest=FLT_MAX) const
 Gets the actual BPM of the song, while respecting a limit.
 
auto GetSegmentAtRow (int iNoteRow, TimingSegmentType tst) const -> const TimingSegment *
 Retrieve the TimingSegment at the specified row.
 
auto GetSegmentAtRow (int iNoteRow, TimingSegmentType tst) -> TimingSegment *
 
auto GetSegmentAtBeat (float fBeat, TimingSegmentType tst) const -> const TimingSegment *
 Retrieve the TimingSegment at the given beat.
 
 DefineSegment (BPM, BPM)
 
 DefineSegment (Stop, STOP)
 
 DefineSegment (Delay, DELAY)
 
 DefineSegment (Warp, WARP)
 
 DefineSegment (Label, LABEL)
 
 DefineSegment (Tickcount, TICKCOUNT)
 
 DefineSegment (Combo, COMBO)
 
 DefineSegment (Speed, SPEED)
 
 DefineSegment (Scroll, SCROLL)
 
 DefineSegment (Fake, FAKE)
 
 DefineSegment (TimeSignature, TIME_SIG)
 
auto GetBPMAtRow (int iNoteRow) const -> float
 
auto GetBPMAtBeat (float fBeat) const -> float
 
void SetBPMAtRow (int iNoteRow, float fBPM)
 
void SetBPMAtBeat (float fBeat, float fBPM)
 
auto GetStopAtRow (int iNoteRow) const -> float
 
auto GetStopAtBeat (float fBeat) const -> float
 
void SetStopAtRow (int iNoteRow, float fSeconds)
 
void SetStopAtBeat (float fBeat, float fSeconds)
 
auto GetDelayAtRow (int iNoteRow) const -> float
 
auto GetDelayAtBeat (float fBeat) const -> float
 
void SetDelayAtRow (int iNoteRow, float fSeconds)
 
void SetDelayAtBeat (float fBeat, float fSeconds)
 
void SetTimeSignatureAtRow (int iNoteRow, int iNum, int iDen)
 
void SetTimeSignatureAtBeat (float fBeat, int iNum, int iDen)
 
auto GetWarpAtRow (int iNoteRow) const -> float
 
auto GetWarpAtBeat (float fBeat) const -> float
 
void SetWarpAtRow (int iRow, float fLength)
 
void SetWarpAtBeat (float fBeat, float fLength)
 
auto GetTickcountAtRow (int iNoteRow) const -> int
 
auto GetTickcountAtBeat (float fBeat) const -> int
 
void SetTickcountAtRow (int iNoteRow, int iTicks)
 
void SetTickcountAtBeat (float fBeat, int iTicks)
 
auto GetComboAtRow (int iNoteRow) const -> int
 
auto GetComboAtBeat (float fBeat) const -> int
 
auto GetMissComboAtRow (int iNoteRow) const -> int
 
auto GetMissComboAtBeat (float fBeat) const -> int
 
auto GetLabelAtRow (int iNoteRow) const -> const std::string &
 
auto GetLabelAtBeat (float fBeat) const -> const std::string &
 
void SetLabelAtRow (int iNoteRow, const std::string &sLabel)
 
void SetLabelAtBeat (float fBeat, const std::string &sLabel)
 
auto DoesLabelExist (const std::string &sLabel) const -> bool
 
auto GetSpeedPercentAtRow (int iNoteRow) const -> float
 
auto GetSpeedPercentAtBeat (float fBeat) const -> float
 
auto GetSpeedWaitAtRow (int iNoteRow) const -> float
 
auto GetSpeedWaitAtBeat (float fBeat) const -> float
 
auto GetSpeedModeAtRow (int iNoteRow) const -> SpeedSegment::BaseUnit
 
auto GetSpeedModeAtBeat (float fBeat) const -> SpeedSegment::BaseUnit
 
void SetSpeedAtRow (int iNoteRow, float fPercent, float fWait, SpeedSegment::BaseUnit unit)
 
void SetSpeedAtBeat (float fBeat, float fPercent, float fWait, SpeedSegment::BaseUnit unit)
 
void SetSpeedPercentAtRow (int iNoteRow, float fPercent)
 
void SetSpeedWaitAtRow (int iNoteRow, float fWait)
 
void SetSpeedModeAtRow (int iNoteRow, SpeedSegment::BaseUnit unit)
 
void SetSpeedPercentAtBeat (float fBeat, float fPercent)
 
void SetSpeedWaitAtBeat (float fBeat, float fWait)
 
void SetSpeedModeAtBeat (float fBeat, SpeedSegment::BaseUnit unit)
 
auto GetDisplayedSpeedPercent (float fBeat, float fMusicSeconds) const -> float
 
auto GetScrollAtRow (int iNoteRow) const -> float
 
auto GetScrollAtBeat (float fBeat) const -> float
 
void SetScrollAtRow (int iNoteRow, float fPercent)
 
void SetScrollAtBeat (float fBeat, float fPercent)
 
auto GetFakeAtRow (int iRow) const -> float
 
auto GetFakeAtBeat (float fBeat) const -> float
 
auto IsWarpAtRow (int iRow) const -> bool
 
auto IsWarpAtBeat (float fBeat) const -> bool
 
auto IsFakeAtRow (int iRow) const -> bool
 
auto IsFakeAtBeat (float fBeat) const -> bool
 
auto IsJudgableAtRow (int row) const -> bool
 Determine if this notes on this row can be judged.
 
auto IsJudgableAtBeat (float beat) const -> bool
 
void MultiplyBPMInBeatRange (int iStartIndex, int iEndIndex, float fFactor)
 
void NoteRowToMeasureAndBeat (int iNoteRow, int &iMeasureIndexOut, int &iBeatIndexOut, int &iRowsRemainder) const
 
void GetBeatInternal (GetBeatStarts &start, GetBeatArgs &args, unsigned int max_segment) const
 
auto GetElapsedTimeInternal (GetBeatStarts &start, float beat, unsigned int max_segment) const -> float
 
void GetBeatAndBPSFromElapsedTime (GetBeatArgs &args) const
 
auto GetBeatFromElapsedTime (float elapsed_time) const -> float
 
auto GetElapsedTimeFromBeat (float fBeat) const -> float
 
void GetBeatAndBPSFromElapsedTimeNoOffset (GetBeatArgs &args) const
 
auto GetBeatFromElapsedTimeNoOffset (float elapsed_time) const -> float
 
auto GetElapsedTimeFromBeatNoOffset (float fBeat) const -> float
 
auto GetDisplayedBeat (float fBeat) const -> float
 
auto HasBpmChanges () const -> bool
 
auto HasStops () const -> bool
 
auto HasDelays () const -> bool
 
auto HasWarps () const -> bool
 
auto HasFakes () const -> bool
 
auto HasSpeedChanges () const -> bool
 
auto HasScrollChanges () const -> bool
 
auto operator== (const TimingData &other) const -> bool
 Compare two sets of timing data to see if they are equal.
 
auto operator!= (const TimingData &other) const -> bool
 Compare two sets of timing data to see if they are not equal.
 
void ScaleRegion (float fScale=1, int iStartRow=0, int iEndRow=MAX_NOTE_ROW, bool bAdjustBPM=false)
 
void InsertRows (int iStartRow, int iRowsToAdd)
 
void DeleteRows (int iStartRow, int iRowsToDelete)
 
void SortSegments (TimingSegmentType tst)
 
auto GetTimingSegments (TimingSegmentType tst) const -> const std::vector< TimingSegment * > &
 
auto GetTimingSegments (TimingSegmentType tst) -> std::vector< TimingSegment * > &
 
void TidyUpData (bool allowEmpty)
 Tidy up the timing data, e.g. provide default BPMs, labels, tickcounts.
 
void PushSelf (lua_State *L)
 
auto ToVectorString (TimingSegmentType tst, int dec=6) const -> std::vector< std::string >
 
auto BuildAndGetEtaner (const std::vector< int > &nerv) -> const std::vector< float > &
 
auto BuildAndGetEtar (int lastrow) -> const std::vector< float > &
 
void SetElapsedTimesAtAllRows (std::vector< float > &etar)
 
auto GetElapsedTimesAtAllRows () const -> std::vector< float >
 
void UnsetElapsedTimesAtAllRows ()
 
void UnsetEtaner ()
 
auto WhereUAtBro (float beat) const -> float
 
auto WhereUAtBro (float beat) -> float
 
auto WhereUAtBroNoOffset (float beat) const -> float
 
auto WhereUAtBroNoOffset (float beat) -> float
 
auto WhereUAtBro (int row) -> float
 
auto ConvertReplayNoteRowsToTimestamps (const std::vector< int > &nrv, float rate) -> std::vector< float >
 

Public Attributes

beat_start_lookup_t m_beat_start_lookup
 
beat_start_lookup_t m_time_start_lookup
 
std::string m_sFile
 The file of the song/steps that use this TimingData.
 
float m_fBeat0OffsetInSeconds {}
 The initial offset of a song.
 
std::vector< float > ElapsedTimesAtAllRows
 
std::vector< float > ElapsedTimesAtNonEmptyRows
 

Protected Member Functions

void AddSegment (const TimingSegment *seg)
 

Protected Attributes

std::vector< TimingSegment * > m_avpTimingSegments [NUM_TimingSegmentType]
 

Detailed Description

Holds data for translating beats<->seconds.

Constructor & Destructor Documentation

◆ TimingData()

TimingData::TimingData ( float  fOffset = 0.F)
explicit

Sets up initial timing data with a defined offset.

Parameters
fOffsetthe offset from the 0th beat.

Member Function Documentation

◆ GetActualBPM()

void TimingData::GetActualBPM ( float &  fMinBPMOut,
float &  fMaxBPMOut,
float  highest = FLT_MAX 
) const

Gets the actual BPM of the song, while respecting a limit.

The high limit is due to the implementation of mMods.

Parameters
fMinBPMOutthe minimium specified BPM.
fMaxBPMOutthe maximum specified BPM.
highestthe highest allowed max BPM.

◆ GetSegmentAtBeat()

auto TimingData::GetSegmentAtBeat ( float  fBeat,
TimingSegmentType  tst 
) const -> const TimingSegment*
inline

Retrieve the TimingSegment at the given beat.

Parameters
fBeatthe beat that has a TimingSegment.
tstthe TimingSegmentType requested.
Returns
the segment in question.

◆ GetSegmentAtRow()

const TimingSegment * TimingData::GetSegmentAtRow ( int  iNoteRow,
TimingSegmentType  tst 
) const -> const TimingSegment*

Retrieve the TimingSegment at the specified row.

Parameters
iNoteRowthe row that has a TimingSegment.
tstthe TimingSegmentType requested.
Returns
the segment in question.

◆ IsJudgableAtRow()

auto TimingData::IsJudgableAtRow ( int  row) const -> bool
inline

Determine if this notes on this row can be judged.

Parameters
rowthe row to focus on.
Returns
true if the row can be judged, false otherwise.

◆ operator!=()

auto TimingData::operator!= ( const TimingData other) const -> bool
inline

Compare two sets of timing data to see if they are not equal.

Parameters
otherthe other TimingData.
Returns
the inequality or lack thereof of the two TimingData.

◆ operator==()

auto TimingData::operator== ( const TimingData other) const -> bool
inline

Compare two sets of timing data to see if they are equal.

Parameters
otherthe other TimingData.
Returns
the equality or lack thereof of the two TimingData.

◆ TidyUpData()

void TimingData::TidyUpData ( bool  allowEmpty)

Tidy up the timing data, e.g. provide default BPMs, labels, tickcounts.

Parameters
allowEmptytrue if completely empty TimingData should be left alone, false if it should be changed

Member Data Documentation

◆ m_sFile

std::string TimingData::m_sFile

The file of the song/steps that use this TimingData.

This is for informational purposes only.


The documentation for this class was generated from the following files: