Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
tracklist_selections_action.h
1// SPDX-FileCopyrightText: © 2019-2022, 2024-2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "dsp/port_connections_manager.h"
7#include "gui/backend/backend/actions/undoable_action.h"
8#include "gui/backend/backend/settings/plugin_configuration_manager.h"
9#include "gui/backend/io/file_descriptor.h"
10#include "structure/tracks/channel_send.h"
11#include "structure/tracks/track.h"
12#include "structure/tracks/track_span.h"
13#include "utils/color.h"
14
15namespace zrythm::gui::actions
16{
17
21class TracklistSelectionsAction : public QObject, public UndoableAction
22{
23 Q_OBJECT
24 QML_ELEMENT
25 DEFINE_UNDOABLE_ACTION_QML_PROPERTIES (TracklistSelectionsAction)
26
27 using TrackSpan = structure::tracks::TrackSpan;
28 using Track = structure::tracks::Track;
29 using TrackPtrVariant = structure::tracks::TrackPtrVariant;
30 using ChannelSend = structure::tracks::ChannelSend;
31
32public:
33 enum class Type
34 {
35 Copy,
36 CopyInside,
37 Create,
38 Delete,
39 Edit,
40 Move,
41 MoveInside,
42 Pin,
43 Unpin,
44 };
45
46 enum class EditType
47 {
48 Solo,
49 SoloLane,
50 Mute,
51 MuteLane,
52 Listen,
53 Enable,
54 Fold,
55 Volume,
56 Pan,
57
60
63
66
67 Color,
68 Comment,
69 Icon,
70
71 MidiFaderMode,
72 };
73
74 using Position = zrythm::dsp::Position;
75 using Color = zrythm::utils::Color;
76 using PortType = zrythm::dsp::PortType;
77 using PluginConfiguration = zrythm::plugins::PluginConfiguration;
78
79public:
80 TracklistSelectionsAction () = default;
81
95 Type type,
96 std::optional<TrackSpan> tls_before_var,
97 std::optional<TrackSpan> tls_after_var,
98 const PortConnectionsManager * port_connections_mgr,
99 std::optional<TrackPtrVariant> track_var,
100 Track::Type track_type,
101 const PluginConfiguration * pl_setting,
102 const FileDescriptor * file_descr,
103 int track_pos,
104 int lane_pos,
105 const Position * pos,
106 int num_tracks,
107 EditType edit_type,
108 int ival_after,
109 const Color * color_new,
110 float val_before,
111 float val_after,
112 const utils::Utf8String * new_txt,
113 bool already_edited);
114
120 Track::Type track_type,
121 const PluginConfiguration * pl_setting,
122 const FileDescriptor * file_descr,
123 int track_pos,
124 const Position * pos,
125 int num_tracks,
126 int disable_track_pos)
127 : TracklistSelectionsAction (
128 Type::Create,
129 std::nullopt,
130 std::nullopt,
131 nullptr,
132 std::nullopt,
133 track_type,
134 pl_setting,
135 file_descr,
136 track_pos,
137 -1,
138 pos,
139 num_tracks,
140 EditType::Color,
141 disable_track_pos,
142 nullptr,
143 0.f,
144 0.f,
145 nullptr,
146 false)
147 {
148 }
149
150 QString to_string () const final;
151
152 bool needs_transport_total_bar_update (bool perform) const override
153 {
154 if (tracklist_selections_action_type_ == Type::Edit)
155 {
156 if (
157 edit_type_ == EditType::Mute || edit_type_ == EditType::Solo
158 || edit_type_ == EditType::Listen || edit_type_ == EditType::Volume
159 || edit_type_ == EditType::Pan)
160 {
161 return false;
162 }
163 }
164
165 return true;
166 }
167
168 bool needs_pause () const override
169 {
170 if (tracklist_selections_action_type_ == Type::Edit)
171 {
172 if (
173 edit_type_ == EditType::Mute || edit_type_ == EditType::Solo
174 || edit_type_ == EditType::Listen || edit_type_ == EditType::Volume
175 || edit_type_ == EditType::Pan)
176 {
177 return false;
178 }
179 }
180 return true;
181 }
182
183 void get_plugins (std::vector<zrythm::plugins::Plugin *> &plugins) override
184 {
185// TODO
186#if 0
187 if (tls_before_)
188 {
189 TrackSpan{ *tls_before_ }.get_plugins (plugins);
190 }
191 if (tls_after_)
192 {
193 TrackSpan{ *tls_after_ }.get_plugins (plugins);
194 }
196 {
197 TrackSpan{ *foldable_tls_before_ }.get_plugins (plugins);
198 }
199#endif
200 }
201
202 friend void init_from (
203 TracklistSelectionsAction &obj,
204 const TracklistSelectionsAction &other,
205 utils::ObjectCloneType clone_type);
206
207private:
208 void init_loaded_impl () final;
209 void perform_impl () final;
210 void undo_impl () final;
211
216 void copy_track_positions_from_selections (
217 std::vector<int> &track_positions,
218 TrackSpan selections_var);
219
225 void reset_foldable_track_sizes ();
226
233 bool validate () const;
234
240 void create_track (int idx);
241
242 /* all these may throw ZrythmException */
243
244 void do_or_undo_create_or_delete (bool do_it, bool create);
245
249 void do_or_undo_move_or_copy (bool do_it, bool copy, bool inside);
250
251 void do_or_undo_edit (bool do_it);
252
253 void do_or_undo (bool do_it);
254
255public:
258
262 int track_pos_ = 0;
263
265 int lane_pos_ = 0;
266
269 Position pos_;
270
271 bool have_pos_ = false;
272
275
277 bool is_empty_ = false;
278
284 std::unique_ptr<PluginConfiguration> pl_setting_;
285
292
303
310 std::optional<dsp::FileAudioSourceUuidReference> pool_id_;
311
315 std::vector<std::optional<Track::Uuid>> out_track_uuids_;
316
323
324 EditType edit_type_{};
325
331 std::vector<int> track_positions_before_;
332 std::vector<int> track_positions_after_;
333
339 int num_tracks_ = 0;
340
342 std::optional<std::vector<TrackPtrVariant>> tls_before_;
343
345 std::optional<std::vector<TrackPtrVariant>> tls_after_;
346
351 std::optional<std::vector<TrackPtrVariant>> foldable_tls_before_;
352
353 /* --------------- DELTAS ---------------- */
354
360 std::vector<int> ival_before_;
361 int ival_after_ = 0;
362
363 /* -------------- end DELTAS ------------- */
364
365 std::vector<Color> colors_before_;
366 Color new_color_;
367
368 utils::Utf8String new_txt_;
369
371 bool already_edited_ = false;
372
374 float val_before_ = 0.f;
375 float val_after_ = 0.f;
376};
377
378class CreateTracksAction : public TracklistSelectionsAction
379{
380public:
387 Track::Type track_type,
388 const PluginConfiguration * pl_setting,
389 const FileDescriptor * file_descr,
390 int track_pos,
391 const Position * pos,
392 int num_tracks,
393 int disable_track_pos)
394 : TracklistSelectionsAction (
395 Type::Create,
396 std::nullopt,
397 std::nullopt,
398 nullptr,
399 std::nullopt,
400 track_type,
401 pl_setting,
402 file_descr,
403 track_pos,
404 -1,
405 pos,
406 num_tracks,
407 EditType::Color,
408 disable_track_pos,
409 nullptr,
410 0.f,
411 0.f,
412 nullptr,
413 false)
414 {
415 }
416};
417
422class CreatePluginTrackAction : public CreateTracksAction
423{
424public:
425 CreatePluginTrackAction (
426 Track::Type track_type,
427 const PluginConfiguration * pl_setting,
428 int track_pos,
429 int num_tracks = 1)
431 track_type,
432 pl_setting,
433 nullptr,
434 track_pos,
435 nullptr,
436 num_tracks,
437 -1)
438 {
439 }
440};
441
446class CreatePlainTrackAction : public CreatePluginTrackAction
447{
448public:
449 CreatePlainTrackAction (
450 Track::Type track_type,
451 int track_pos,
452 int num_tracks = 1)
453 : CreatePluginTrackAction (track_type, nullptr, track_pos, num_tracks)
454 {
455 }
456};
457
461class EditTracksAction : public TracklistSelectionsAction
462{
463public:
464 EditTracksAction (
465 EditType edit_type,
466 std::optional<TrackSpan> tls_before,
467 std::optional<TrackSpan> tls_after,
468 bool already_edited)
469 : TracklistSelectionsAction (
470 Type::Edit,
471 tls_before,
472 tls_after,
473 nullptr,
474 std::nullopt,
475 (Track::Type) 0,
476 nullptr,
477 nullptr,
478 -1,
479 -1,
480 nullptr,
481 -1,
482 edit_type,
483 0,
484 nullptr,
485 0.f,
486 0.f,
487 nullptr,
488 already_edited)
489 {
490 }
491};
492
496class SingleTrackFloatAction : public TracklistSelectionsAction
497{
498public:
499 SingleTrackFloatAction (
500 EditType type,
501 std::optional<TrackPtrVariant> track,
502 float val_before,
503 float val_after,
504 bool already_edited)
505 : TracklistSelectionsAction (
506 Type::Edit,
507 std::nullopt,
508 std::nullopt,
509 nullptr,
510 track,
511 (Track::Type) 0,
512 nullptr,
513 nullptr,
514 -1,
515 -1,
516 nullptr,
517 -1,
518 type,
519 0,
520 nullptr,
521 val_before,
522 val_after,
523 nullptr,
524 already_edited)
525 {
526 }
527};
528
532class SingleTrackIntAction : public TracklistSelectionsAction
533{
534public:
535 SingleTrackIntAction (
536 EditType type,
537 std::optional<TrackPtrVariant> track,
538 int val_after,
539 bool already_edited)
540 : TracklistSelectionsAction (
541 Type::Edit,
542 std::nullopt,
543 std::nullopt,
544 nullptr,
545 track,
546 (Track::Type) 0,
547 nullptr,
548 nullptr,
549 -1,
550 -1,
551 nullptr,
552 -1,
553 type,
554 val_after,
555 nullptr,
556 0.f,
557 0.f,
558 nullptr,
559 already_edited)
560 {
561 }
562};
563
567class MultiTrackIntAction : public TracklistSelectionsAction
568{
569protected:
570 MultiTrackIntAction (
571 EditType type,
572 std::optional<TrackSpan> tls_before,
573 int val_after,
574 bool already_edited)
575 : TracklistSelectionsAction (
576 Type::Edit,
577 tls_before,
578 std::nullopt,
579 nullptr,
580 std::nullopt,
581 (Track::Type) 0,
582 nullptr,
583 nullptr,
584 -1,
585 -1,
586 nullptr,
587 -1,
588 type,
589 val_after,
590 nullptr,
591 0.f,
592 0.f,
593 nullptr,
594 already_edited)
595 {
596 }
597};
598
599class MuteTracksAction : public MultiTrackIntAction
600{
601public:
602 MuteTracksAction (TrackSpan tls_before, bool mute_new)
603 : MultiTrackIntAction (EditType::Mute, tls_before, mute_new, false)
604 {
605 }
606};
607
608class MuteTrackAction : public MuteTracksAction
609{
610public:
611 MuteTrackAction (TrackPtrVariant track, bool mute_new)
612 : MuteTracksAction (TrackSpan{ track }, mute_new)
613 {
614 }
615};
616
617class TrackLaneIntAction : public TracklistSelectionsAction
618{
619protected:
620 TrackLaneIntAction (
621 EditType edit_type,
622 const structure::tracks::TrackLane &track_lane,
623 int value_after)
624 : TracklistSelectionsAction (
625 Type::Edit,
626 std::nullopt,
627 std::nullopt,
628 nullptr,
629 TrackPtrVariant{}, // TODO
630 // convert_to_variant<TrackPtrVariant> (track_lane.get_track ()),
631 (Track::Type) 0,
632 nullptr,
633 nullptr,
634 -1,
635 -1, // TODO
636 // track_lane.get_index_in_track (),
637 nullptr,
638 -1,
639 edit_type,
640 value_after,
641 nullptr,
642 0.f,
643 0.f,
644 nullptr,
645 false)
646 {
647 }
648};
649
650class MuteTrackLaneAction : public TrackLaneIntAction
651{
652public:
653 MuteTrackLaneAction (
654 const structure::tracks::TrackLane &track_lane,
655 bool mute_new)
656 : TrackLaneIntAction (EditType::MuteLane, track_lane, mute_new)
657 {
658 }
659};
660
661class SoloTracksAction : public MultiTrackIntAction
662{
663public:
664 SoloTracksAction (TrackSpan tls_before, bool solo_new)
665 : MultiTrackIntAction (EditType::Solo, tls_before, solo_new, false)
666 {
667 }
668};
669
670class SoloTrackAction : public SoloTracksAction
671{
672public:
673 SoloTrackAction (TrackPtrVariant track, bool solo_new)
674 : SoloTracksAction (TrackSpan{ track }, solo_new)
675 {
676 }
677};
678
679class SoloTrackLaneAction : public TrackLaneIntAction
680{
681public:
682 SoloTrackLaneAction (
683 const structure::tracks::TrackLane &track_lane,
684 bool solo_new)
685 : TrackLaneIntAction (EditType::SoloLane, track_lane, solo_new)
686 {
687 }
688};
689
690class ListenTracksAction : public MultiTrackIntAction
691{
692public:
693 ListenTracksAction (TrackSpan tls_before, bool listen_new)
694 : MultiTrackIntAction (EditType::Listen, tls_before, listen_new, false)
695 {
696 }
697};
698
699class ListenTrackAction : public ListenTracksAction
700{
701public:
702 ListenTrackAction (TrackPtrVariant track, bool listen_new)
703 : ListenTracksAction (TrackSpan (track), listen_new)
704 {
705 }
706};
707
708class EnableTracksAction : public MultiTrackIntAction
709{
710public:
711 EnableTracksAction (TrackSpan tls_before, bool enable_new)
712 : MultiTrackIntAction (EditType::Enable, tls_before, enable_new, false)
713 {
714 }
715};
716
717class EnableTrackAction : public EnableTracksAction
718{
719public:
720 EnableTrackAction (TrackPtrVariant track, bool enable_new)
721 : EnableTracksAction (TrackSpan (track), enable_new)
722 {
723 }
724};
725
726class FoldTracksAction : public MultiTrackIntAction
727{
728public:
729 FoldTracksAction (std::optional<TrackSpan> tls_before, bool fold_new)
730 : MultiTrackIntAction (EditType::Fold, tls_before, fold_new, false)
731 {
732 }
733};
734
735class TracksDirectOutAction : public TracklistSelectionsAction
736{
737public:
738 TracksDirectOutAction (
739 TrackSpan tls,
740 const PortConnectionsManager &port_connections_mgr,
741 std::optional<TrackPtrVariant> direct_out)
742 : TracklistSelectionsAction (
743 Type::Edit,
744 tls,
745 std::nullopt,
746 &port_connections_mgr,
747 std::nullopt,
748 (Track::Type) 0,
749 nullptr,
750 nullptr,
751 -1,
752 -1,
753 nullptr,
754 -1,
756 direct_out ? 561561156 /* random index for now */
757 : -1,
758 nullptr,
759 0.f,
760 0.f,
761 nullptr,
762 false)
763 {
764 }
765};
766
767class ChangeTracksDirectOutAction : public TracksDirectOutAction
768{
769public:
770 ChangeTracksDirectOutAction (
771 TrackSpan tls,
772 const PortConnectionsManager &port_connections_mgr,
773 TrackPtrVariant direct_out)
774 : TracksDirectOutAction (tls, port_connections_mgr, direct_out)
775 {
776 }
777};
778
779class RemoveTracksDirectOutAction : public TracksDirectOutAction
780{
781public:
782 RemoveTracksDirectOutAction (
783 TrackSpan tls,
784 const PortConnectionsManager &port_connections_mgr)
785 : TracksDirectOutAction (tls, port_connections_mgr, std::nullopt)
786 {
787 }
788};
789
790class EditTracksColorAction : public TracklistSelectionsAction
791{
792public:
793 EditTracksColorAction (TrackSpan tls, const Color &color)
794 : TracklistSelectionsAction (
795 Type::Edit,
796 tls,
797 std::nullopt,
798 nullptr,
799 std::nullopt,
800 {},
801 nullptr,
802 nullptr,
803 -1,
804 -1,
805 nullptr,
806 -1,
807 EditType::Color,
808 -1,
809 &color,
810 0.f,
811 0.f,
812 nullptr,
813 false)
814 {
815 }
816};
817
818class EditTrackColorAction : public EditTracksColorAction
819{
820public:
821 EditTrackColorAction (TrackPtrVariant track, const Color &color)
822 : EditTracksColorAction (TrackSpan (track), color)
823 {
824 }
825};
826
827class EditTracksTextAction : public TracklistSelectionsAction
828{
829protected:
830 EditTracksTextAction (
831 EditType edit_type,
832 TrackSpan tls,
833 const utils::Utf8String &txt)
834 : TracklistSelectionsAction (
835 Type::Edit,
836 tls,
837 std::nullopt,
838 nullptr,
839 std::nullopt,
840 {},
841 nullptr,
842 nullptr,
843 -1,
844 -1,
845 nullptr,
846 -1,
847 edit_type,
848 -1,
849 nullptr,
850 0.f,
851 0.f,
852 &txt,
853 false)
854 {
855 }
856};
857
858class EditTracksCommentAction : public EditTracksTextAction
859{
860public:
861 EditTracksCommentAction (TrackSpan tls, const utils::Utf8String &comment)
862 : EditTracksTextAction (EditType::Comment, tls, comment)
863 {
864 }
865};
866
867class EditTrackCommentAction : public EditTracksCommentAction
868{
869public:
870 EditTrackCommentAction (TrackPtrVariant track, const utils::Utf8String &comment)
871 : EditTracksCommentAction (TrackSpan (track), comment)
872 {
873 }
874};
875
876class EditTracksIconAction : public EditTracksTextAction
877{
878public:
879 EditTracksIconAction (TrackSpan tls, const utils::Utf8String &icon)
880 : EditTracksTextAction (EditType::Icon, tls, icon)
881 {
882 }
883};
884
885class EditTrackIconAction : public EditTracksIconAction
886{
887public:
888 EditTrackIconAction (TrackPtrVariant track, const utils::Utf8String &icon)
889 : EditTracksIconAction (TrackSpan (track), icon)
890 {
891 }
892};
893
894class RenameTrackAction : public TracklistSelectionsAction
895{
896public:
897 RenameTrackAction (
898 TrackPtrVariant track,
899 const PortConnectionsManager &port_connections_mgr,
900 const utils::Utf8String &name)
901 : TracklistSelectionsAction (
902 Type::Edit,
903 std::nullopt,
904 std::nullopt,
905 &port_connections_mgr,
906 track,
907 {},
908 nullptr,
909 nullptr,
910 -1,
911 -1,
912 nullptr,
913 -1,
915 -1,
916 nullptr,
917 -1,
918 0.f,
919 &name,
920 false)
921 {
922 }
923};
924
925class RenameTrackLaneAction : public TracklistSelectionsAction
926{
927public:
928 RenameTrackLaneAction (
929 const structure::tracks::TrackLane &track_lane,
930 const utils::Utf8String &name)
931 : TracklistSelectionsAction (
932 Type::Edit,
933 std::nullopt,
934 std::nullopt,
935 nullptr,
936 TrackPtrVariant{}, // TODO
937 // convert_to_variant<TrackPtrVariant> (track_lane.get_track ()),
938 {},
939 nullptr,
940 nullptr,
941 -1,
942 -1,
943 nullptr,
944 -1,
946 -1,
947 nullptr,
948 -1,
949 0.f,
950 &name,
951 false)
952 {
953 }
954};
955
956class MoveTracksAction : public TracklistSelectionsAction
957{
958public:
968 MoveTracksAction (TrackSpan tls, int track_pos)
969 : TracklistSelectionsAction (
970 Type::Move,
971 tls,
972 std::nullopt,
973 nullptr,
974 std::nullopt,
975 {},
976 nullptr,
977 nullptr,
978 track_pos,
979 -1,
980 nullptr,
981 -1,
982 {},
983 -1,
984 nullptr,
985 0.f,
986 0.f,
987 nullptr,
988 false)
989 {
990 }
991};
992
993class CopyTracksAction : public TracklistSelectionsAction
994{
995public:
996 CopyTracksAction (
997 TrackSpan tls,
998 const PortConnectionsManager &port_connections_mgr,
999 int track_pos)
1000 : TracklistSelectionsAction (
1001 Type::Copy,
1002 tls,
1003 std::nullopt,
1004 &port_connections_mgr,
1005 std::nullopt,
1006 (Track::Type) 0,
1007 nullptr,
1008 nullptr,
1009 track_pos,
1010 -1,
1011 nullptr,
1012 -1,
1013 (EditType) 0,
1014 -1,
1015 nullptr,
1016 0.f,
1017 0.f,
1018 nullptr,
1019 false)
1020 {
1021 }
1022};
1023
1024class MoveTracksInsideFoldableTrackAction : public TracklistSelectionsAction
1025{
1026public:
1038 MoveTracksInsideFoldableTrackAction (TrackSpan tls, int track_pos)
1039 : TracklistSelectionsAction (
1040 Type::MoveInside,
1041 tls,
1042 std::nullopt,
1043 nullptr,
1044 std::nullopt,
1045 (Track::Type) 0,
1046 nullptr,
1047 nullptr,
1048 track_pos,
1049 -1,
1050 nullptr,
1051 -1,
1052 (EditType) 0,
1053 -1,
1054 nullptr,
1055 0.f,
1056 0.f,
1057 nullptr,
1058 false)
1059 {
1060 }
1061};
1062
1063class CopyTracksInsideFoldableTrackAction : public TracklistSelectionsAction
1064{
1065public:
1066 CopyTracksInsideFoldableTrackAction (
1067 TrackSpan tls,
1068 const PortConnectionsManager &port_connections_mgr,
1069 int track_pos)
1070 : TracklistSelectionsAction (
1071 Type::CopyInside,
1072 tls,
1073 std::nullopt,
1074 &port_connections_mgr,
1075 std::nullopt,
1076 (Track::Type) 0,
1077 nullptr,
1078 nullptr,
1079 track_pos,
1080 -1,
1081 nullptr,
1082 -1,
1083 (EditType) 0,
1084 -1,
1085 nullptr,
1086 0.f,
1087 0.f,
1088 nullptr,
1089 false)
1090 {
1091 }
1092};
1093
1094class DeleteTracksAction : public TracklistSelectionsAction
1095{
1096public:
1097 DeleteTracksAction (
1098 TrackSpan tls,
1099 const PortConnectionsManager &port_connections_mgr)
1100 : TracklistSelectionsAction (
1101 Type::Delete,
1102 tls,
1103 std::nullopt,
1104 &port_connections_mgr,
1105 std::nullopt,
1106 (Track::Type) 0,
1107 nullptr,
1108 nullptr,
1109 -1,
1110 -1,
1111 nullptr,
1112 -1,
1113 (EditType) 0,
1114 -1,
1115 nullptr,
1116 0.f,
1117 0.f,
1118 nullptr,
1119 false)
1120 {
1121 }
1122};
1123
1124class PinOrUnpinTracksAction : public TracklistSelectionsAction
1125{
1126protected:
1127 PinOrUnpinTracksAction (
1128 TrackSpan tls,
1129 const PortConnectionsManager &port_connections_mgr,
1130 bool pin)
1131 : TracklistSelectionsAction (
1132 pin ? Type::Pin : Type::Unpin,
1133 tls,
1134 std::nullopt,
1135 &port_connections_mgr,
1136 std::nullopt,
1137 {},
1138 nullptr,
1139 nullptr,
1140 -1,
1141 -1,
1142 nullptr,
1143 -1,
1144 (EditType) 0,
1145 -1,
1146 nullptr,
1147 0.f,
1148 0.f,
1149 nullptr,
1150 false)
1151 {
1152 }
1153};
1154
1155class PinTracksAction : public PinOrUnpinTracksAction
1156{
1157public:
1158 PinTracksAction (
1159 TrackSpan tls,
1160 const PortConnectionsManager &port_connections_mgr)
1161 : PinOrUnpinTracksAction (tls, port_connections_mgr, true)
1162 {
1163 }
1164};
1165
1166class UnpinTracksAction : public PinOrUnpinTracksAction
1167{
1168public:
1169 UnpinTracksAction (
1170 TrackSpan tls,
1171 const PortConnectionsManager &port_connections_mgr)
1172 : PinOrUnpinTracksAction (tls, port_connections_mgr, false)
1173 {
1174 }
1175};
1176
1177}; // namespace zrythm::gui::actions
Descriptor of a file.
Represents the position of an object.
Definition position.h:72
CreateTracksAction(Track::Type track_type, const PluginConfiguration *pl_setting, const FileDescriptor *file_descr, int track_pos, const Position *pos, int num_tracks, int disable_track_pos)
Create a Tracks Action object.
MoveTracksAction(TrackSpan tls, int track_pos)
Move tls to track_pos.
MoveTracksInsideFoldableTrackAction(TrackSpan tls, int track_pos)
Move inside a foldable track.
int num_fold_change_tracks_
Number of tracks under folder affected.
fs::path file_basename_
The basename of the file, if any.
TracklistSelectionsAction(Track::Type track_type, const PluginConfiguration *pl_setting, const FileDescriptor *file_descr, int track_pos, const Position *pos, int num_tracks, int disable_track_pos)
Constructor for a Create action.
bool is_empty_
Flag to know if we are making an empty track.
std::unique_ptr< PluginConfiguration > pl_setting_
PluginConfiguration, if making an instrument or bus track from a plugin.
Position pos_
Position to add the audio region to, if applicable.
utils::Utf8String base64_midi_
If this is an action to create a MIDI track from a MIDI file, this is the base64 representation so th...
bool needs_pause() const override
Returns whether the action requires pausing the engine.
bool needs_transport_total_bar_update(bool perform) const override
Returns whether the total transport bars need to be recalculated.
QString to_string() const final
Stringizes the action to be used in Undo/Redo buttons.
std::optional< std::vector< TrackPtrVariant > > tls_before_
Clone of the TracklistSelections, if applicable.
std::optional< std::vector< TrackPtrVariant > > tls_after_
Clone of the TracklistSelections, if applicable.
TracklistSelectionsAction(Type type, std::optional< TrackSpan > tls_before_var, std::optional< TrackSpan > tls_after_var, const PortConnectionsManager *port_connections_mgr, std::optional< TrackPtrVariant > track_var, Track::Type track_type, const PluginConfiguration *pl_setting, const FileDescriptor *file_descr, int track_pos, int lane_pos, const Position *pos, int num_tracks, EditType edit_type, int ival_after, const Color *color_new, float val_before, float val_after, const utils::Utf8String *new_txt, bool already_edited)
Creates a new TracklistSelectionsAction.
std::vector< std::optional< Track::Uuid > > out_track_uuids_
Direct out tracks of the original tracks.
std::optional< dsp::FileAudioSourceUuidReference > pool_id_
If this is an action to create an Audio track from an audio file, this is the pool ID of the audio fi...
std::optional< std::vector< TrackPtrVariant > > foldable_tls_before_
Foldable tracks before the change, used when undoing to set the correct sizes.
void perform()
Performs the action.
Configuration for instantiating a plugin descriptor.
A container of MIDI or Audio regions.
Definition track_lane.h:28
Track span that offers helper methods on a range of tracks.
Definition track_span.h:19
void get_plugins(T &container)
Fills in the given array with all plugins in the tracklist.
Definition track_span.h:182
Represents a track in the project.
Definition track.h:54
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:38