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
9
10#ifndef __TEST_HELPERS_PROJECT_H__
11#define __TEST_HELPERS_PROJECT_H__
12
13#include "zrythm-test-config.h"
14
15#include "engine/device_io/engine_dummy.h"
16#include "engine/session/graph_dispatcher.h"
17#include "engine/session/recording_manager.h"
18#include "gui/backend/backend/project.h"
20#include "gui/backend/backend/zrythm.h"
21#include "gui/backend/ui.h"
22#include "structure/arrangement/audio_region.h"
23#include "structure/arrangement/automation_region.h"
24#include "structure/arrangement/chord_region.h"
25#include "structure/arrangement/midi_note.h"
26#include "structure/arrangement/region.h"
27#include "structure/tracks/chord_track.h"
28#include "structure/tracks/marker_track.h"
29#include "structure/tracks/master_track.h"
30#include "structure/tracks/tempo_track.h"
31#include "structure/tracks/tracklist.h"
32#include "utils/gtest_wrapper.h"
33
34#include "tests/helpers/zrythm_helper.h"
35
41
43constexpr int MN_VAL = 78;
45constexpr int MN_VEL = 23;
46
48constexpr float AP_VAL1 = 0.6f;
50constexpr float AP_VAL2 = 0.9f;
51
53constexpr const char * MARKER_NAME = "Marker name";
54
55constexpr auto MUSICAL_SCALE_TYPE = MusicalScale::Type::Ionian;
56constexpr auto MUSICAL_SCALE_ROOT = MusicalNote::A;
57
58constexpr int MOVE_TICKS = 400;
59
60constexpr int TOTAL_TL_SELECTIONS = 6;
61
62constexpr const char * MIDI_REGION_NAME = "Midi region";
63constexpr const char * AUDIO_REGION_NAME = "Audio region";
64constexpr const char * MIDI_TRACK_NAME = "Midi track";
65constexpr const char * AUDIO_TRACK_NAME = "Audio track";
66
67/* initial positions */
68constexpr int MIDI_REGION_LANE = 2;
69constexpr int AUDIO_REGION_LANE = 3;
70
71/* target positions */
72constexpr const char * TARGET_MIDI_TRACK_NAME = "Target midi tr";
73constexpr const char * TARGET_AUDIO_TRACK_NAME = "Target audio tr";
74
75/* TODO test moving lanes */
76constexpr int TARGET_MIDI_REGION_LANE = 0;
77constexpr int TARGET_AUDIO_REGION_LANE = 5;
78
79fs::path
80test_project_save ();
81
82[[gnu::cold]] void
83test_project_reload (const fs::path &prj_file);
84
85void
86test_project_save_and_reload ();
87
92void
94
95void
96test_project_check_vs_original_state (
97 Position * p1,
98 Position * p2,
99 int check_selections);
100
104class BootstrapTimelineFixture : public ZrythmFixture
105{
106public:
107 void SetUp () override;
108
114 void check_vs_original_state (bool check_selections);
115
116 void TearDown () override;
117
118 virtual ~BootstrapTimelineFixture () = default;
119
120public:
121 Position p1_;
122 Position p2_;
123};
124
128
129#endif
Bootstraps the test with test data.
void check_vs_original_state(bool check_selections)
Checks that the objects are back to their original state.
constexpr int MN_VAL
MidiNote value to use.
constexpr int MN_VEL
MidiNote velocity to use.
constexpr float AP_VAL1
First AP value.
void test_project_stop_dummy_engine()
Stop dummy audio engine processing so we can process manually.
constexpr const char * MARKER_NAME
Marker name.
constexpr float AP_VAL2
Second AP value.
User Interface utils (legacy code).