Deluge Firmware 1.3.0
Build date: 2025.09.27
Loading...
Searching...
No Matches
playback_mode.h
1/*
2 * Copyright © 2018-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include <cstdint>
21
22class Song;
23class InstrumentClip;
24class ArrangementRow;
25class Output;
26class Clip;
28
29class PlaybackMode {
30public:
31 PlaybackMode();
32 virtual ~PlaybackMode();
33 bool hasPlaybackActive();
34
35 virtual void setupPlayback() = 0; // Call this *before* resetPlayPos
36 virtual bool endPlayback() = 0; // Returns whether to do an instant song swap
37 virtual void doTickForward(int32_t posIncrement) = 0;
38 virtual void resetPlayPos(int32_t newPos, bool doingComplete = true, int32_t buttonPressLatency = 0) = 0;
39 virtual void resyncToSongTicks(Song* song) = 0;
40 virtual void reversionDone() = 0; // This is only to be called if playbackHandler.isEitherClockActive()
41 virtual bool isOutputAvailable(Output* output) = 0;
42 virtual bool considerLaunchEvent(int32_t numTicksBeingIncremented) {
43 return false;
44 } // Returns whether Song was swapped
45 virtual void stopOutputRecordingAtLoopEnd() = 0;
46 virtual int32_t
47 getPosAtWhichClipWillCut(ModelStackWithTimelineCounter const*
48 modelStack) = 0; // That's *cut* - as in, cut out abruptly. If it's looping, and the
49 // user isn't stopping it, that's not a cut.
50 virtual bool
51 willClipContinuePlayingAtEnd(ModelStackWithTimelineCounter const*
52 modelStack) = 0; // We say "continue playing" now, because we want to include a
53 // pingpong, which arguably doesn't fall under "loop".
54 virtual bool willClipLoopAtSomePoint(
56 modelStack) = 0; // This includes it "looping" in arranger before the Clip's full length due to that
57 // ClipInstance ending, and there being another instance of the same Clip right after.
58 virtual bool wantsToDoTempolessRecord(int32_t newPos) { return false; }
59 virtual void
60 reSyncClip(ModelStackWithTimelineCounter* modelStack, bool mustSetPosToSomething = false,
61 bool mayResumeClip = true) = 0; // Check playbackHandler.isEitherClockActive() before calling this.
62};
63
64extern PlaybackMode* currentPlaybackMode;
Definition clip.h:46
Definition instrument_clip.h:47
Definition model_stack.h:129
Definition output.h:79
Definition playback_mode.h:29
Definition song.h:104