22#ifndef TRANSPORT_POSITION_H
23#define TRANSPORT_POSITION_H
122 static long long computeFrameFromTick(
double fTick,
double* fTickMismatch,
int nSampleRate = 0 );
132 QString
toQString(
const QString& sPrefix =
"",
bool bShort =
true )
const override;
143 void set( std::shared_ptr<TransportPosition> pOther );
146 void setFrame(
long long nNewFrame );
147 void setTick(
double fNewTick );
149 void setBpm(
float fNewBpm );
175 static long long computeFrame(
double fTick,
float fTickSize );
185 static double computeTick(
long long nFrame,
float fTickSize );
418 return static_cast<long>(std::floor(
m_fTick ));
Defined in here since it requires access to methods and variables private to the #AudioEngine class.
The audio engine deals with two distinct #TransportPosition.
PatternList is a collection of patterns.
Object holding most of the information about the transport state of the AudioEngine.
double getDoubleTick() const
double m_fTickOffsetQueuing
Tick offset introduced when changing the tempo of the song.
long long m_nFrameOffsetTempo
Frame offset introduced when changing the tempo of the song.
TransportPosition(const QString sLabel="")
void setPatternStartTick(long nPatternStartTick)
const PatternList * getNextPatterns() const
void setColumn(int nColumn)
long m_nPatternTickPosition
Ticks passed since m_nPatternStartTick.
double m_fTickMismatch
Number of ticks m_nFrame is ahead/behind of m_fTick.
int m_nColumn
Specifies the column transport is located in and can be used as the index of the current PatternList/...
long m_nPatternStartTick
Dicstance in ticks between the beginning of the song and the beginning of the current column (m_nColu...
static double computeTick(long long nFrame, float fTickSize)
Converts frames into ticks under the assumption of a constant fTickSize (sample rate,...
static long long computeFrameFromTick(double fTick, double *fTickMismatch, int nSampleRate=0)
Calculates frame equivalent of fTick.
float getTickSize() const
float m_fBpm
Current tempo in beats per minute.
int m_nBeat
Last bar passed since m_nBar.
long long m_nLastLeadLagFactor
long long getFrame() const
void setTickOffsetSongSize(double fTickOffset)
long getTick() const
Retrieve a rounded version of m_fTick.
void setNextPatterns(PatternList *pPatternList)
void setTick(double fNewTick)
const QString getLabel() const
void setPatternTickPosition(long nPatternTickPosition)
double getTickOffsetQueuing() const
void set(std::shared_ptr< TransportPosition > pOther)
Copying the content of one position into the other is a lot cheaper than performing computations,...
long getPatternTickPosition() const
void setFrame(long long nNewFrame)
void setTickOffsetQueuing(double nTickOffset)
const PatternList * getPlayingPatterns() const
int m_nPatternSize
Maximum size of all patterns in m_pPlayingPatterns.
int m_nBar
Last beat (column + 1) passed.
PatternList * m_pPlayingPatterns
Contains all Patterns currently played back.
void setFrameOffsetTempo(long long nFrameOffset)
void setTickSize(float fNewTickSize)
static double computeTickFromFrame(long long nFrame, int nSampleRate=0)
Calculates tick equivalent of nFrame.
int getPatternSize() const
void setLastLeadLagFactor(long long nValue)
long long m_nFrame
Current transport position in number of frames since the beginning of the song.
void setBpm(float fNewBpm)
double m_fTickOffsetSongSize
Tick offset introduced when changing the size of the song.
long long getLastLeadLagFactor() const
float m_fTickSize
Number of frames that make up one tick.
QString toQString(const QString &sPrefix="", bool bShort=true) const override
Formatted string version for debugging purposes.
void setPlayingPatterns(PatternList *pPatternList)
double m_fTick
Current transport position in number of ticks since the beginning of the song.
void setPatternSize(int nPatternSize)
long getPatternStartTick() const
static long long computeFrame(double fTick, float fTickSize)
Converts ticks into frames under the assumption of a constant fTickSize (sample rate,...
PatternList * m_pNextPatterns
Patterns used to toggle the ones in m_pPlayingPatterns in Song::PatternMode::Stacked.
long long getFrameOffsetTempo() const
double getTickOffsetSongSize() const
double getTickMismatch() const
const QString m_sLabel
Identifier of the transport position.