Deluge Firmware
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
PlaybackHandler Class Reference

#include <playbackhandler.h>

Collaboration diagram for PlaybackHandler:
Collaboration graph

Public Member Functions

 PlaybackHandler ()
 
void routine ()
 
void playButtonPressed (int buttonPressLatency)
 
void recordButtonPressed ()
 
void setupPlaybackUsingInternalClock (int buttonPressLatencyForTempolessRecord=0, bool allowCountIn=true)
 
void setupPlaybackUsingExternalClock (bool switchingFromInternalClock=false, bool fromContinueCommand=false)
 
void setupPlayback (int newPlaybackState, int32_t playFromPos, bool doOneLastAudioRoutineCall=false, bool shouldShiftAccordingToClipInstance=true, int buttonPressLatencyForTempolessRecord=0)
 
void endPlayback ()
 
void inputTick (bool fromTriggerClock=false, uint32_t time=0)
 
void startMessageReceived ()
 
void continueMessageReceived ()
 
void stopMessageReceived ()
 
void clockMessageReceived (uint32_t time)
 
void tempoEncoderAction (int8_t offset, bool encoderButtonPressed, bool shiftButtonPressed)
 
bool isCurrentlyRecording ()
 
void positionPointerReceived (uint8_t data1, uint8_t data2)
 
void programChangeReceived (int channel, int program)
 
void doSongSwap (bool preservePlayPosition=false)
 
void forceResetPlayPos (Song *song)
 
void expectEvent ()
 
void setMidiInClockEnabled (bool newValue)
 
int32_t getActualArrangementRecordPos ()
 
int32_t getArrangementRecordPosAtLastActionedSwungTick ()
 
void slowRoutine ()
 
void scheduleSwungTickFromExternalClock ()
 
int getNumSwungTicksInSinceLastTimerTick (uint32_t *timeRemainder=NULL)
 
int getNumSwungTicksInSinceLastActionedSwungTick (uint32_t *timeRemainder=NULL)
 
int64_t getActualSwungTickCount (uint32_t *timeRemainder=NULL)
 
int64_t getCurrentInternalTickCount (uint32_t *remainder=NULL)
 
void scheduleSwungTick ()
 
int32_t getInternalTickTime (int64_t internalTickCount)
 
void scheduleTriggerClockOutTick ()
 
void scheduleMIDIClockOutTick ()
 
void scheduleNextTimerTick (uint32_t doubleSwingInterval)
 
void setLedStates ()
 
void tapTempoAutoSwitchOff ()
 
void reassessInputTickScaling ()
 
void resyncInternalTicksToInputTicks (Song *song)
 
bool shouldRecordNotesNow ()
 
void stopAnyRecording ()
 
uint32_t getTimePerInternalTick ()
 
uint64_t getTimePerInternalTickBig ()
 
float getTimePerInternalTickFloat ()
 
uint32_t getTimePerInternalTickInverse (bool getStickyValue=false)
 
void tapTempoButtonPress ()
 
void doTriggerClockOutTick ()
 
void doMIDIClockOutTick ()
 
void resyncAnalogOutTicksToInternalTicks ()
 
void resyncMIDIClockOutTicksToInternalTicks ()
 
void analogClockRisingEdge (uint32_t time)
 
void toggleMetronomeStatus ()
 
void displayTempoByCalculation ()
 
void displaySwingAmount ()
 
void setMidiOutClockMode (bool newValue)
 
void pitchBendReceived (MIDIDevice *fromDevice, uint8_t channel, uint8_t data1, uint8_t data2, bool *doingMidiThru)
 
void midiCCReceived (MIDIDevice *fromDevice, uint8_t channel, uint8_t ccNumber, uint8_t value, bool *doingMidiThru)
 
void aftertouchReceived (MIDIDevice *fromDevice, int channel, int value, int noteCode, bool *doingMidiThru)
 
void loopCommand (int overdubNature)
 
void grabTempoFromClip (Clip *clip)
 
int32_t getTimeLeftInCountIn ()
 
void noteMessageReceived (MIDIDevice *fromDevice, bool on, int channel, int note, int velocity, bool *doingMidiThru)
 
bool subModeAllowsRecording ()
 
void songSelectReceived (uint8_t songId)
 
float calculateBPM (float timePerInternalTick)
 
void switchToArrangement ()
 
void switchToSession ()
 
void finishTempolessRecording (bool startPlaybackAgain, int buttonLatencyForTempolessRecord, bool shouldExitRecordMode=true)
 
void actionTimerTick ()
 
void actionTimerTickPart2 ()
 
void actionSwungTick ()
 
void scheduleSwungTickFromInternalClock ()
 
bool currentlySendingMIDIOutputClocks ()
 
bool isEitherClockActive ()
 

Public Attributes

bool midiClockOutTickScheduled
 
uint32_t timeNextMIDIClockOutTick
 
int64_t lastMIDIClockOutTickDone
 
uint8_t playbackState
 
bool usingAnalogClockInput
 
uint8_t recording
 
bool ignoringMidiClockInput
 
int32_t posToNextContinuePlaybackFrom
 
uint32_t timeLastMIDIStartOrContinueMessageSent
 
int64_t lastTimerTickActioned
 
int64_t nextTimerTickScheduled
 
uint64_t timeNextTimerTickBig
 
uint64_t timeLastTimerTickBig
 
uint32_t timeLastInputTicks [NUM_INPUT_TICKS_FOR_MOVING_AVERAGE]
 
uint32_t timePerInputTickMovingAverage
 
uint8_t numInputTickTimesCounted
 
bool tempoMagnitudeMatchingActiveNow
 
unsigned long timeVeryFirstInputTick
 
int64_t lastInputTickReceived
 
unsigned long targetedTimePerInputTick
 
bool swungTickScheduled
 
uint32_t scheduledSwungTickTime
 
int64_t lastSwungTickActioned
 
bool triggerClockOutTickScheduled
 
uint32_t timeNextTriggerClockOutTick
 
int64_t lastTriggerClockOutTickDone
 
uint32_t analogOutTicksPPQN
 
uint32_t analogInTicksPPQN
 
uint32_t timeLastAnalogClockInputRisingEdge
 
bool analogClockInputAutoStart
 
bool songSwapShouldPreserveTempo
 
bool metronomeOn
 
bool midiOutClockEnabled
 
bool midiInClockEnabled
 
bool tempoMagnitudeMatchingEnabled
 
bool countInEnabled
 
int32_t swungTicksTilNextEvent
 
int32_t ticksLeftInCountIn
 
int currentVisualCountForCountIn
 
int32_t metronomeOffset
 
int32_t arrangementPosToStartAtOnSwitch
 
bool stopOutputRecordingAtLoopEnd
 

Constructor & Destructor Documentation

◆ PlaybackHandler()

PlaybackHandler::PlaybackHandler ( )

Member Function Documentation

◆ actionSwungTick()

void PlaybackHandler::actionSwungTick ( )

◆ actionTimerTick()

void PlaybackHandler::actionTimerTick ( )

◆ actionTimerTickPart2()

void PlaybackHandler::actionTimerTickPart2 ( )

◆ aftertouchReceived()

void PlaybackHandler::aftertouchReceived ( MIDIDevice fromDevice,
int  channel,
int  value,
int  noteCode,
bool *  doingMidiThru 
)

◆ analogClockRisingEdge()

void PlaybackHandler::analogClockRisingEdge ( uint32_t  time)

◆ calculateBPM()

float PlaybackHandler::calculateBPM ( float  timePerInternalTick)

◆ clockMessageReceived()

void PlaybackHandler::clockMessageReceived ( uint32_t  time)

◆ continueMessageReceived()

void PlaybackHandler::continueMessageReceived ( )

◆ currentlySendingMIDIOutputClocks()

bool PlaybackHandler::currentlySendingMIDIOutputClocks ( )

◆ displaySwingAmount()

void PlaybackHandler::displaySwingAmount ( )

◆ displayTempoByCalculation()

void PlaybackHandler::displayTempoByCalculation ( )

◆ doMIDIClockOutTick()

void PlaybackHandler::doMIDIClockOutTick ( )

◆ doSongSwap()

void PlaybackHandler::doSongSwap ( bool  preservePlayPosition = false)

◆ doTriggerClockOutTick()

void PlaybackHandler::doTriggerClockOutTick ( )

◆ endPlayback()

void PlaybackHandler::endPlayback ( )

◆ expectEvent()

void PlaybackHandler::expectEvent ( )

◆ finishTempolessRecording()

void PlaybackHandler::finishTempolessRecording ( bool  startPlaybackAgain,
int  buttonLatencyForTempolessRecord,
bool  shouldExitRecordMode = true 
)

◆ forceResetPlayPos()

void PlaybackHandler::forceResetPlayPos ( Song song)

◆ getActualArrangementRecordPos()

int32_t PlaybackHandler::getActualArrangementRecordPos ( )

◆ getActualSwungTickCount()

int64_t PlaybackHandler::getActualSwungTickCount ( uint32_t *  timeRemainder = NULL)

◆ getArrangementRecordPosAtLastActionedSwungTick()

int32_t PlaybackHandler::getArrangementRecordPosAtLastActionedSwungTick ( )

◆ getCurrentInternalTickCount()

int64_t PlaybackHandler::getCurrentInternalTickCount ( uint32_t *  remainder = NULL)

◆ getInternalTickTime()

int32_t PlaybackHandler::getInternalTickTime ( int64_t  internalTickCount)

◆ getNumSwungTicksInSinceLastActionedSwungTick()

int PlaybackHandler::getNumSwungTicksInSinceLastActionedSwungTick ( uint32_t *  timeRemainder = NULL)

◆ getNumSwungTicksInSinceLastTimerTick()

int PlaybackHandler::getNumSwungTicksInSinceLastTimerTick ( uint32_t *  timeRemainder = NULL)

◆ getTimeLeftInCountIn()

int32_t PlaybackHandler::getTimeLeftInCountIn ( )

◆ getTimePerInternalTick()

uint32_t PlaybackHandler::getTimePerInternalTick ( )

◆ getTimePerInternalTickBig()

uint64_t PlaybackHandler::getTimePerInternalTickBig ( )

◆ getTimePerInternalTickFloat()

float PlaybackHandler::getTimePerInternalTickFloat ( )

◆ getTimePerInternalTickInverse()

uint32_t PlaybackHandler::getTimePerInternalTickInverse ( bool  getStickyValue = false)

◆ grabTempoFromClip()

void PlaybackHandler::grabTempoFromClip ( Clip clip)

◆ inputTick()

void PlaybackHandler::inputTick ( bool  fromTriggerClock = false,
uint32_t  time = 0 
)

◆ isCurrentlyRecording()

bool PlaybackHandler::isCurrentlyRecording ( )

◆ isEitherClockActive()

bool PlaybackHandler::isEitherClockActive ( )
inline

◆ loopCommand()

void PlaybackHandler::loopCommand ( int  overdubNature)

◆ midiCCReceived()

void PlaybackHandler::midiCCReceived ( MIDIDevice fromDevice,
uint8_t  channel,
uint8_t  ccNumber,
uint8_t  value,
bool *  doingMidiThru 
)

◆ noteMessageReceived()

void PlaybackHandler::noteMessageReceived ( MIDIDevice fromDevice,
bool  on,
int  channel,
int  note,
int  velocity,
bool *  doingMidiThru 
)

◆ pitchBendReceived()

void PlaybackHandler::pitchBendReceived ( MIDIDevice fromDevice,
uint8_t  channel,
uint8_t  data1,
uint8_t  data2,
bool *  doingMidiThru 
)

◆ playButtonPressed()

void PlaybackHandler::playButtonPressed ( int  buttonPressLatency)

◆ positionPointerReceived()

void PlaybackHandler::positionPointerReceived ( uint8_t  data1,
uint8_t  data2 
)

◆ programChangeReceived()

void PlaybackHandler::programChangeReceived ( int  channel,
int  program 
)

◆ reassessInputTickScaling()

void PlaybackHandler::reassessInputTickScaling ( )

◆ recordButtonPressed()

void PlaybackHandler::recordButtonPressed ( )

◆ resyncAnalogOutTicksToInternalTicks()

void PlaybackHandler::resyncAnalogOutTicksToInternalTicks ( )

◆ resyncInternalTicksToInputTicks()

void PlaybackHandler::resyncInternalTicksToInputTicks ( Song song)

◆ resyncMIDIClockOutTicksToInternalTicks()

void PlaybackHandler::resyncMIDIClockOutTicksToInternalTicks ( )

◆ routine()

void PlaybackHandler::routine ( )

◆ scheduleMIDIClockOutTick()

void PlaybackHandler::scheduleMIDIClockOutTick ( )

◆ scheduleNextTimerTick()

void PlaybackHandler::scheduleNextTimerTick ( uint32_t  doubleSwingInterval)

◆ scheduleSwungTick()

void PlaybackHandler::scheduleSwungTick ( )

◆ scheduleSwungTickFromExternalClock()

void PlaybackHandler::scheduleSwungTickFromExternalClock ( )

◆ scheduleSwungTickFromInternalClock()

void PlaybackHandler::scheduleSwungTickFromInternalClock ( )

◆ scheduleTriggerClockOutTick()

void PlaybackHandler::scheduleTriggerClockOutTick ( )

◆ setLedStates()

void PlaybackHandler::setLedStates ( )

◆ setMidiInClockEnabled()

void PlaybackHandler::setMidiInClockEnabled ( bool  newValue)

◆ setMidiOutClockMode()

void PlaybackHandler::setMidiOutClockMode ( bool  newValue)

◆ setupPlayback()

void PlaybackHandler::setupPlayback ( int  newPlaybackState,
int32_t  playFromPos,
bool  doOneLastAudioRoutineCall = false,
bool  shouldShiftAccordingToClipInstance = true,
int  buttonPressLatencyForTempolessRecord = 0 
)

◆ setupPlaybackUsingExternalClock()

void PlaybackHandler::setupPlaybackUsingExternalClock ( bool  switchingFromInternalClock = false,
bool  fromContinueCommand = false 
)

◆ setupPlaybackUsingInternalClock()

void PlaybackHandler::setupPlaybackUsingInternalClock ( int  buttonPressLatencyForTempolessRecord = 0,
bool  allowCountIn = true 
)

◆ shouldRecordNotesNow()

bool PlaybackHandler::shouldRecordNotesNow ( )

◆ slowRoutine()

void PlaybackHandler::slowRoutine ( )

◆ songSelectReceived()

void PlaybackHandler::songSelectReceived ( uint8_t  songId)

◆ startMessageReceived()

void PlaybackHandler::startMessageReceived ( )

◆ stopAnyRecording()

void PlaybackHandler::stopAnyRecording ( )

◆ stopMessageReceived()

void PlaybackHandler::stopMessageReceived ( )

◆ subModeAllowsRecording()

bool PlaybackHandler::subModeAllowsRecording ( )

◆ switchToArrangement()

void PlaybackHandler::switchToArrangement ( )

◆ switchToSession()

void PlaybackHandler::switchToSession ( )

◆ tapTempoAutoSwitchOff()

void PlaybackHandler::tapTempoAutoSwitchOff ( )

◆ tapTempoButtonPress()

void PlaybackHandler::tapTempoButtonPress ( )

◆ tempoEncoderAction()

void PlaybackHandler::tempoEncoderAction ( int8_t  offset,
bool  encoderButtonPressed,
bool  shiftButtonPressed 
)

◆ toggleMetronomeStatus()

void PlaybackHandler::toggleMetronomeStatus ( )

Member Data Documentation

◆ analogClockInputAutoStart

bool PlaybackHandler::analogClockInputAutoStart

◆ analogInTicksPPQN

uint32_t PlaybackHandler::analogInTicksPPQN

◆ analogOutTicksPPQN

uint32_t PlaybackHandler::analogOutTicksPPQN

◆ arrangementPosToStartAtOnSwitch

int32_t PlaybackHandler::arrangementPosToStartAtOnSwitch

◆ countInEnabled

bool PlaybackHandler::countInEnabled

◆ currentVisualCountForCountIn

int PlaybackHandler::currentVisualCountForCountIn

◆ ignoringMidiClockInput

bool PlaybackHandler::ignoringMidiClockInput

◆ lastInputTickReceived

int64_t PlaybackHandler::lastInputTickReceived

◆ lastMIDIClockOutTickDone

int64_t PlaybackHandler::lastMIDIClockOutTickDone

◆ lastSwungTickActioned

int64_t PlaybackHandler::lastSwungTickActioned

◆ lastTimerTickActioned

int64_t PlaybackHandler::lastTimerTickActioned

◆ lastTriggerClockOutTickDone

int64_t PlaybackHandler::lastTriggerClockOutTickDone

◆ metronomeOffset

int32_t PlaybackHandler::metronomeOffset

◆ metronomeOn

bool PlaybackHandler::metronomeOn

◆ midiClockOutTickScheduled

bool PlaybackHandler::midiClockOutTickScheduled

◆ midiInClockEnabled

bool PlaybackHandler::midiInClockEnabled

◆ midiOutClockEnabled

bool PlaybackHandler::midiOutClockEnabled

◆ nextTimerTickScheduled

int64_t PlaybackHandler::nextTimerTickScheduled

◆ numInputTickTimesCounted

uint8_t PlaybackHandler::numInputTickTimesCounted

◆ playbackState

uint8_t PlaybackHandler::playbackState

◆ posToNextContinuePlaybackFrom

int32_t PlaybackHandler::posToNextContinuePlaybackFrom

◆ recording

uint8_t PlaybackHandler::recording

◆ scheduledSwungTickTime

uint32_t PlaybackHandler::scheduledSwungTickTime

◆ songSwapShouldPreserveTempo

bool PlaybackHandler::songSwapShouldPreserveTempo

◆ stopOutputRecordingAtLoopEnd

bool PlaybackHandler::stopOutputRecordingAtLoopEnd

◆ swungTickScheduled

bool PlaybackHandler::swungTickScheduled

◆ swungTicksTilNextEvent

int32_t PlaybackHandler::swungTicksTilNextEvent

◆ targetedTimePerInputTick

unsigned long PlaybackHandler::targetedTimePerInputTick

◆ tempoMagnitudeMatchingActiveNow

bool PlaybackHandler::tempoMagnitudeMatchingActiveNow

◆ tempoMagnitudeMatchingEnabled

bool PlaybackHandler::tempoMagnitudeMatchingEnabled

◆ ticksLeftInCountIn

int32_t PlaybackHandler::ticksLeftInCountIn

◆ timeLastAnalogClockInputRisingEdge

uint32_t PlaybackHandler::timeLastAnalogClockInputRisingEdge

◆ timeLastInputTicks

uint32_t PlaybackHandler::timeLastInputTicks[NUM_INPUT_TICKS_FOR_MOVING_AVERAGE]

◆ timeLastMIDIStartOrContinueMessageSent

uint32_t PlaybackHandler::timeLastMIDIStartOrContinueMessageSent

◆ timeLastTimerTickBig

uint64_t PlaybackHandler::timeLastTimerTickBig

◆ timeNextMIDIClockOutTick

uint32_t PlaybackHandler::timeNextMIDIClockOutTick

◆ timeNextTimerTickBig

uint64_t PlaybackHandler::timeNextTimerTickBig

◆ timeNextTriggerClockOutTick

uint32_t PlaybackHandler::timeNextTriggerClockOutTick

◆ timePerInputTickMovingAverage

uint32_t PlaybackHandler::timePerInputTickMovingAverage

◆ timeVeryFirstInputTick

unsigned long PlaybackHandler::timeVeryFirstInputTick

◆ triggerClockOutTickScheduled

bool PlaybackHandler::triggerClockOutTickScheduled

◆ usingAnalogClockInput

bool PlaybackHandler::usingAnalogClockInput

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