Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
transport_controller.h
1// SPDX-FileCopyrightText: © 2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "dsp/snap_grid.h"
7#include "dsp/transport.h"
8
9#include <QtQmlIntegration>
10
11namespace zrythm::controllers
12{
13
19class TransportController : public QObject
20{
21 Q_OBJECT
22 QML_ELEMENT
23 QML_UNCREATABLE ("")
24
25public:
26 explicit TransportController (
27 dsp::Transport &transport,
28 dsp::SnapGrid &snap_grid,
29 QObject * parent = nullptr)
30 : QObject (parent), transport_ (transport), snap_grid_ (snap_grid)
31 {
32 }
33
37 Q_INVOKABLE void moveBackward () [[clang::blocking]];
38
42 Q_INVOKABLE void moveForward () [[clang::blocking]];
43
44private:
47 static constexpr auto REPEATED_BACKWARD_MS = au::milli (units::seconds) (240);
48
49 dsp::Transport &transport_;
50 dsp::SnapGrid &snap_grid_;
51};
52
53} // namespace zrythm::controllers
Q_INVOKABLE void moveForward()
Moves the playhead forward to the next snap point.
Q_INVOKABLE void moveBackward()
Moves the playhead backward to the previous snap point.
Snap/grid information.
Definition snap_grid.h:22
The Transport class represents the transport controls and state for an audio engine.
Definition transport.h:44