Deluge Firmware 1.3.0
Build date: 2025.07.11
Loading...
Searching...
No Matches
PlaybackHandler Class Reference

Public Member Functions

void midiRoutine ()
void routine ()
void playButtonPressed (int32_t buttonPressLatency)
void recordButtonPressed ()
void setupPlaybackUsingInternalClock (int32_t buttonPressLatencyForTempolessRecord=0, bool allowCountIn=true, bool restartingPlayback=false, bool restartingPlaybackAtBeginning=false)
void setupPlaybackUsingExternalClock (bool switchingFromInternalClock=false, bool fromContinueCommand=false)
void setupPlayback (int32_t newPlaybackState, int32_t playFromPos, bool doOneLastAudioRoutineCall=false, bool shouldShiftAccordingToClipInstance=true, int32_t 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 doSongSwap (bool preservePlayPosition=false)
void forceResetPlayPos (Song *song, bool restartingPlaybackAtBeginning=false)
void expectEvent ()
void setMidiInClockEnabled (bool newValue)
int32_t getActualArrangementRecordPos ()
int32_t getArrangementRecordPosAtLastActionedSwungTick ()
void slowRoutine ()
void scheduleSwungTickFromExternalClock ()
int32_t getNumSwungTicksInSinceLastTimerTick (uint32_t *timeRemainder=nullptr)
int32_t getNumSwungTicksInSinceLastActionedSwungTick (uint32_t *timeRemainder=nullptr)
int64_t getActualSwungTickCount (uint32_t *timeRemainder=nullptr)
int64_t getCurrentInternalTickCount (uint32_t *remainder=nullptr)
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 (bool useNormalTapTempoBehaviour)
void doTriggerClockOutTick ()
void doMIDIClockOutTick ()
void resyncAnalogOutTicksToInternalTicks ()
void resyncMIDIClockOutTicksToInternalTicks ()
void analogClockRisingEdge (uint32_t time)
void toggleMetronomeStatus ()
void commandDisplayTempo ()
void setMidiOutClockMode (bool newValue)
void pitchBendReceived (MIDICable &cable, uint8_t channel, uint8_t data1, uint8_t data2, bool *doingMidiThru)
void midiCCReceived (MIDICable &cable, uint8_t channel, uint8_t ccNumber, uint8_t value, bool *doingMidiThru)
void programChangeReceived (MIDICable &cable, int32_t channel, int32_t program)
void aftertouchReceived (MIDICable &cable, int32_t channel, int32_t value, int32_t noteCode, bool *doingMidiThru)
void loopCommand (OverDubType overdubNature)
void grabTempoFromClip (Clip *clip)
int32_t getTimeLeftInCountIn ()
void noteMessageReceived (MIDICable &cable, bool on, int32_t channel, int32_t note, int32_t velocity, bool *doingMidiThru)
bool subModeAllowsRecording ()
float calculateBPM (float timePerInternalTick)
void switchToArrangement ()
void switchToSession ()
void finishTempolessRecording (bool startPlaybackAgain, int32_t buttonLatencyForTempolessRecord, bool shouldExitRecordMode=true)
void actionTimerTick ()
void actionTimerTickPart2 ()
void actionSwungTick ()
void scheduleSwungTickFromInternalClock ()
bool currentlySendingMIDIOutputClocks ()
bool isExternalClockActive ()
bool isInternalClockActive ()
bool isEitherClockActive ()
void commandDisplaySwingAmount ()
void commandEditSwingAmount (int8_t offset)
void commandDisplaySwingInterval ()
void commandEditSwingInterval (int8_t offset)
void commandNudgeClock (int8_t offset)
void commandEditClockOutScale (int8_t offset)
void commandEditTempoCoarse (int8_t offset)
void commandEditTempoFine (int8_t offset)
void commandDisplayTempo (int8_t offset)
void commandClearTempoAutomation ()
void getTempoStringForOLED (float tempoBPM, StringBuf &buffer)
void tryLoopCommand (GlobalMIDICommand command)
float calculateBPMForDisplay ()

Public Attributes

bool midiClockOutTickScheduled
uint32_t timeNextMIDIClockOutTick
int64_t lastMIDIClockOutTickDone
uint8_t playbackState
bool usingAnalogClockInput
RecordingMode recording
bool ignoringMidiClockInput
int32_t posToNextContinuePlaybackFrom
uint32_t timeLastMIDIStartOrContinueMessageSent
int64_t lastTimerTickActioned
int64_t nextTimerTickScheduled
uint64_t timeNextTimerTickBig
uint64_t timeLastTimerTickBig
uint32_t timeLastInputTicks [kNumInputTicksForMovingAverage]
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
uint8_t countInBars
int32_t swungTicksTilNextEvent
int32_t ticksLeftInCountIn
int32_t currentVisualCountForCountIn
int32_t metronomeOffset
int32_t arrangementPosToStartAtOnSwitch
bool stopOutputRecordingAtLoopEnd

Private Member Functions

uint32_t timerTicksToOutputTicks (uint32_t timerTicks)
void resetTimePerInternalTickMovingAverage ()
void getCurrentTempoParams (int32_t *magnitude, int8_t *whichValue)
void displayTempoFromParams (int32_t magnitude, int8_t whichValue)
void displayTempoBPM (float tempoBPM)
void getAnalogOutTicksToInternalTicksRatio (uint32_t *internalTicksPer, uint32_t *analogOutTicksPer)
void getMIDIClockOutTicksToInternalTicksRatio (uint32_t *internalTicksPer, uint32_t *midiClockOutTicksPer)
void getInternalTicksToInputTicksRatio (uint32_t *inputTicksPer, uint32_t *internalTicksPer)
void sendOutPositionViaMIDI (int32_t pos, bool outputClocksWereSwitchedOff=false)
bool startIgnoringMidiClockInputIfNecessary ()
uint32_t setTempoFromAudioClipLength (uint64_t loopLengthSamples, Action *action)
bool offerNoteToLearnedThings (MIDICable &cable, bool on, int32_t channel, int32_t note)
bool tryGlobalMIDICommands (MIDICable &cable, int32_t channel, int32_t note)
bool tryGlobalMIDICommandsOff (MIDICable &cable, int32_t channel, int32_t note)
void decideOnCurrentPlaybackMode ()
float getCurrentInternalTickFloatFollowingExternalClock ()
void scheduleTriggerClockOutTickParamsKnown (uint32_t analogOutTicksPer, uint64_t fractionLastTimerTick, uint64_t fractionNextAnalogOutTick)
void scheduleMIDIClockOutTickParamsKnown (uint32_t midiClockOutTicksPer, uint64_t fractionLastTimerTick, uint64_t fractionNextMIDIClockOutTick)

Private Attributes

uint32_t timePerInternalTickMovingAverage
uint32_t veryCurrentTimePerInternalTickInverse
uint32_t stickyCurrentTimePerInternalTickInverse
uint32_t lowpassedTimePerInternalTick
uint32_t slowpassedTimePerInternalTick
uint32_t stickyTimePerInternalTick
uint16_t tapTempoNumPresses
uint32_t tapTempoFirstPressTime
int32_t numOutputClocksWaitingToBeSent
int32_t numInputTicksToSkip
uint32_t skipAnalogClocks
uint32_t skipMidiClocks

Member Function Documentation

◆ commandDisplaySwingAmount()

void PlaybackHandler::commandDisplaySwingAmount ( )

On OLED displayes both Swing amount and interval, on 7seg only the amount.

◆ commandDisplaySwingInterval()

void PlaybackHandler::commandDisplaySwingInterval ( )

On OLED displayes both Swing amount and interval, on 7seg only the interval.


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