Deluge Firmware 1.3.0
Build date: 2025.04.16
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 StereoSample;
24class InstrumentClip;
25class ArrangementRow;
26class Output;
27class Clip;
29
30class PlaybackMode {
31public:
32 PlaybackMode();
33 virtual ~PlaybackMode();
34 bool hasPlaybackActive();
35
36 virtual void setupPlayback() = 0; // Call this *before* resetPlayPos
37 virtual bool endPlayback() = 0; // Returns whether to do an instant song swap
38 virtual void doTickForward(int32_t posIncrement) = 0;
39 virtual void resetPlayPos(int32_t newPos, bool doingComplete = true, int32_t buttonPressLatency = 0) = 0;
40 virtual void resyncToSongTicks(Song* song) = 0;
41 virtual void reversionDone() = 0; // This is only to be called if playbackHandler.isEitherClockActive()
42 virtual bool isOutputAvailable(Output* output) = 0;
43 virtual bool considerLaunchEvent(int32_t numTicksBeingIncremented) {
44 return false;
45 } // Returns whether Song was swapped
46 virtual void stopOutputRecordingAtLoopEnd() = 0;
47 virtual int32_t
48 getPosAtWhichClipWillCut(ModelStackWithTimelineCounter const*
49 modelStack) = 0; // That's *cut* - as in, cut out abruptly. If it's looping, and the
50 // user isn't stopping it, that's not a cut.
51 virtual bool
52 willClipContinuePlayingAtEnd(ModelStackWithTimelineCounter const*
53 modelStack) = 0; // We say "continue playing" now, because we want to include a
54 // pingpong, which arguably doesn't fall under "loop".
55 virtual bool willClipLoopAtSomePoint(
57 modelStack) = 0; // This includes it "looping" in arranger before the Clip's full length due to that
58 // ClipInstance ending, and there being another instance of the same Clip right after.
59 virtual bool wantsToDoTempolessRecord(int32_t newPos) { return false; }
60 virtual void
61 reSyncClip(ModelStackWithTimelineCounter* modelStack, bool mustSetPosToSomething = false,
62 bool mayResumeClip = true) = 0; // Check playbackHandler.isEitherClockActive() before calling this.
63};
64
65extern PlaybackMode* currentPlaybackMode;
Definition clip.h:46
Definition instrument_clip.h:48
Definition model_stack.h:129
Definition output.h:81
Definition playback_mode.h:30
Definition song.h:104
Definition stereo_sample.h:25