22#ifndef TRANSPORT_POSITION_H
23#define TRANSPORT_POSITION_H
124 static long long computeFrameFromTick(
double fTick,
double* fTickMismatch,
int nSampleRate = 0 );
126 friend bool operator==( std::shared_ptr<TransportPosition> lhs,
127 std::shared_ptr<TransportPosition> rhs );
128 friend bool operator!=( std::shared_ptr<TransportPosition> lhs,
129 std::shared_ptr<TransportPosition> rhs );
139 QString
toQString(
const QString& sPrefix =
"",
bool bShort =
true )
const override;
151 void set( std::shared_ptr<TransportPosition> pOther );
154 void setFrame(
long long nNewFrame );
155 void setTick(
double fNewTick );
157 void setBpm(
float fNewBpm );
183 static long long computeFrame(
double fTick,
float fTickSize );
193 static double computeTick(
long long nFrame,
float fTickSize );
427 return static_cast<long>(std::floor(
m_fTick ));
PatternList is a collection of patterns.
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, switching to Timeline,...
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
friend class AudioEngineTests
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,...
friend class JackAudioDriver
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)
friend bool operator==(std::shared_ptr< TransportPosition > lhs, std::shared_ptr< TransportPosition > rhs)
friend bool operator!=(std::shared_ptr< TransportPosition > lhs, std::shared_ptr< TransportPosition > rhs)
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.