Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
change_track_comment_command.h
1// SPDX-FileCopyrightText: © 2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <utility>
7
8#include "structure/tracks/track.h"
9
10#include <QUndoCommand>
11
12namespace zrythm::commands
13{
14class ChangeTrackCommentCommand : public QUndoCommand
15{
16
17public:
18 ChangeTrackCommentCommand (structure::tracks::Track &track, QString comment)
19 : QUndoCommand (QObject::tr ("Change Track Comment")), track_ (track),
20 comment_after_ (std::move (comment))
21 {
22 }
23
24 void undo () override { track_.setComment (comment_before_); }
25 void redo () override
26 {
27 comment_before_ = track_.comment ();
28 track_.setComment (comment_after_);
29 }
30
31private:
33 QString comment_before_;
34 QString comment_after_;
35};
36
37} // namespace zrythm::commands
Represents a track in the project.
Definition track.h:54