Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
audio_function.h
1// SPDX-FileCopyrightText: © 2020-2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "structure/arrangement/arranger_object.h"
7#include "utils/format.h"
8#include "utils/logger.h"
9
10namespace zrythm::structure::arrangement
11{
12
13enum class AudioFunctionType
14{
15 Invert,
16 NormalizePeak,
17 NormalizeRMS,
18 NormalizeLUFS,
19 LinearFadeIn,
20 LinearFadeOut,
21 NudgeLeft,
22 NudgeRight,
23 Reverse,
24 PitchShift,
25 CopyLtoR,
26
28 ExternalProgram,
29
31 Script,
32
34 CustomPlugin,
35
36 /* reserved */
37 Invalid,
38};
39
41{
42public:
46 double amount_ = 0;
47};
48
50audio_function_get_action_target_for_type (AudioFunctionType type);
51
58audio_function_get_detailed_action_for_type (
59 AudioFunctionType type,
60 const utils::Utf8String &base_action);
61
62#define audio_function_get_detailed_action_for_type_default(type) \
63 audio_function_get_detailed_action_for_type (type, "app.editor-function")
64
66audio_function_get_icon_name_for_type (AudioFunctionType type);
67
79void
80audio_function_apply (
81 ArrangerObject::Uuid region_id,
82 std::pair<units::precise_tick_t, units::precise_tick_t> selected_range,
83 AudioFunctionType type,
85 std::optional<utils::Utf8String> uri);
86}
87
88DEFINE_ENUM_FORMATTER (
89 zrythm::structure::arrangement::AudioFunctionType,
90 AudioFunctionType,
91 QT_TR_NOOP_UTF8 ("Invert"),
92 QT_TR_NOOP_UTF8 ("Normalize peak"),
93 QT_TR_NOOP_UTF8 ("Normalize RMS"),
94 QT_TR_NOOP_UTF8 ("Normalize LUFS"),
95 QT_TR_NOOP_UTF8 ("Linear fade in"),
96 QT_TR_NOOP_UTF8 ("Linear fade out"),
97 QT_TR_NOOP_UTF8 ("Nudge left"),
98 QT_TR_NOOP_UTF8 ("Nudge right"),
99 QT_TR_NOOP_UTF8 ("Reverse"),
100 QT_TR_NOOP_UTF8 ("Pitch shift"),
101 QT_TR_NOOP_UTF8 ("Copy L to R"),
102 QT_TR_NOOP_UTF8 ("External program"),
103 QT_TR_NOOP_UTF8 ("Guile script"),
104 QT_TR_NOOP_UTF8 ("Custom plugin"),
105 QT_TR_NOOP_UTF8 ("Invalid"));
double amount_
Amount related to the current function (e.g.
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:38