4#ifndef __ACTIONS_TRANSPORT_ACTION_H__
5#define __ACTIONS_TRANSPORT_ACTION_H__
7#include "gui/backend/backend/actions/undoable_action.h"
8#include "utils/icloneable.h"
9#include "utils/types.h"
11namespace zrythm::gui::actions
17class TransportAction :
public QObject,
public UndoableAction
21 DEFINE_UNDOABLE_ACTION_QML_PROPERTIES (TransportAction)
31 TransportAction (QObject * parent =
nullptr);
44 QObject * parent =
nullptr);
60 QObject * parent =
nullptr);
62 friend void init_from (
64 const TransportAction &other,
70 void init_loaded_impl ()
override { }
71 void undo_impl ()
override;
72 void perform_impl ()
override;
74 bool need_update_positions_from_ticks ()
76 return type_ == Type::TempoChange || type_ == Type::BeatsPerBarChange;
79 void do_or_undo (
bool do_it);
82 Type type_ = Type::TempoChange;
84 bpm_t bpm_before_ = 0.0;
85 bpm_t bpm_after_ = 0.0;
TransportAction(Type type, int before, int after, bool already_done, QObject *parent=nullptr)
Construct a new Transport object for a beat unit/beats per bar change.
TransportAction(bpm_t bpm_before, bpm_t bpm_after, bool already_done, QObject *parent=nullptr)
Construct a new Transport Action object for a BPM change.
QString to_string() const override
Stringizes the action to be used in Undo/Redo buttons.
bool musical_mode_
Whether musical mode was enabled when this action was made.
bool already_done_
Flag whether the action was already performed the first time.
Type
Type of UndoableAction.