Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
project_helper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#error \
5 "WARNING: THIS IS LEGACY CODE. IT IS NOT USED ANYMORE AND SHOULD NOT BE USED.
6
12
13#ifndef __TEST_HELPERS_PROJECT_H__
14# define __TEST_HELPERS_PROJECT_H__
15
16# include "zrythm-test-config.h"
17
18# include "engine/device_io/engine_dummy.h"
19# include "engine/session/graph_dispatcher.h"
20# include "engine/session/recording_manager.h"
21# include "gui/backend/backend/project/project_init_flow_manager.h"
22# include "gui/backend/backend/zrythm.h"
23# include "gui/backend/ui.h"
24# include "structure/arrangement/audio_region.h"
25# include "structure/arrangement/automation_region.h"
26# include "structure/arrangement/chord_region.h"
27# include "structure/arrangement/midi_note.h"
28# include "structure/arrangement/region.h"
29# include "structure/project/project.h"
30# include "structure/tracks/chord_track.h"
31# include "structure/tracks/marker_track.h"
32# include "structure/tracks/master_track.h"
33# include "structure/tracks/tempo_track.h"
34# include "structure/tracks/tracklist.h"
35# include "utils/gtest_wrapper.h"
36
37# include "tests/helpers/zrythm_helper.h"
38
44
46constexpr int MN_VAL = 78;
48constexpr int MN_VEL = 23;
49
51constexpr float AP_VAL1 = 0.6f;
53constexpr float AP_VAL2 = 0.9f;
54
56constexpr const char * MARKER_NAME = "Marker name";
57
58constexpr auto MUSICAL_SCALE_TYPE = MusicalScale::Type::Ionian;
59constexpr auto MUSICAL_SCALE_ROOT = MusicalNote::A;
60
61constexpr int MOVE_TICKS = 400;
62
63constexpr int TOTAL_TL_SELECTIONS = 6;
64
65constexpr const char * MIDI_REGION_NAME = "Midi region";
66constexpr const char * AUDIO_REGION_NAME = "Audio region";
67constexpr const char * MIDI_TRACK_NAME = "Midi track";
68constexpr const char * AUDIO_TRACK_NAME = "Audio track";
69
70/* initial positions */
71constexpr int MIDI_REGION_LANE = 2;
72constexpr int AUDIO_REGION_LANE = 3;
73
74/* target positions */
75constexpr const char * TARGET_MIDI_TRACK_NAME = "Target midi tr";
76constexpr const char * TARGET_AUDIO_TRACK_NAME = "Target audio tr";
77
78/* TODO test moving lanes */
79constexpr int TARGET_MIDI_REGION_LANE = 0;
80constexpr int TARGET_AUDIO_REGION_LANE = 5;
81
82fs::path
83test_project_save ();
84
85[[gnu::cold]] void
86test_project_reload (const fs::path &prj_file);
87
88void
89test_project_save_and_reload ();
90
95void
96test_project_stop_dummy_engine ();
97
98void
99test_project_check_vs_original_state (
100 Position * p1,
101 Position * p2,
102 int check_selections);
103
107class BootstrapTimelineFixture : public ZrythmFixture
108{
109public:
110 void SetUp () override;
111
117 void check_vs_original_state (bool check_selections);
118
119 void TearDown () override;
120
121 virtual ~BootstrapTimelineFixture () = default;
122
123public:
124 Position p1_;
125 Position p2_;
126};
127
131
132#endif