Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
audio_function.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020-2023 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
12#ifndef __AUDIO_AUDIO_FUNCTION_H__
13#define __AUDIO_AUDIO_FUNCTION_H__
14
15#include <glib/gi18n.h>
16
18typedef struct Plugin Plugin;
19
27{
28 AUDIO_FUNCTION_INVERT,
29 AUDIO_FUNCTION_NORMALIZE_PEAK,
30 AUDIO_FUNCTION_NORMALIZE_RMS,
31 AUDIO_FUNCTION_NORMALIZE_LUFS,
32 AUDIO_FUNCTION_LINEAR_FADE_IN,
33 AUDIO_FUNCTION_LINEAR_FADE_OUT,
34 AUDIO_FUNCTION_NUDGE_LEFT,
35 AUDIO_FUNCTION_NUDGE_RIGHT,
36 AUDIO_FUNCTION_REVERSE,
37 AUDIO_FUNCTION_PITCH_SHIFT,
38 AUDIO_FUNCTION_COPY_L_TO_R,
39
42
45
48
49 /* reserved */
50 AUDIO_FUNCTION_INVALID,
51};
52
53static const char * audio_function_type_strings[] = {
54 N_ ("Invert"), N_ ("Normalize peak"), N_ ("Normalize RMS"),
55 N_ ("Normalize LUFS"), N_ ("Linear fade in"), N_ ("Linear fade out"),
56 N_ ("Nudge left"), N_ ("Nudge right"), N_ ("Reverse"),
57 N_ ("Pitch shift"), N_ ("Copy L to R"), N_ ("External program"),
58 N_ ("Guile script"), N_ ("Custom plugin"), N_ ("Invalid"),
59};
60
61typedef struct AudioFunctionOpts
62{
66 double amount;
67
69
70static inline const char *
71audio_function_type_to_string (AudioFunctionType type)
72{
73 return audio_function_type_strings[static_cast<int> (type)];
74}
75
76char *
77audio_function_get_action_target_for_type (AudioFunctionType type);
78
85char *
88 const char * base_action);
89
90#define audio_function_get_detailed_action_for_type_default(type) \
91 audio_function_get_detailed_action_for_type (type, "app.editor-function")
92
93const char *
94audio_function_get_icon_name_for_type (AudioFunctionType type);
95
100static inline const char *
101audio_function_get_plugin_uri_for_type (AudioFunctionType type)
102{
103 switch (type)
104 {
105 default:
106 break;
107 }
108
109 return NULL;
110}
111
126bool
128 ArrangerSelections * sel,
131 const char * uri,
132 GError ** error);
133
138#endif
char * audio_function_get_detailed_action_for_type(AudioFunctionType type, const char *base_action)
Returns a detailed action name to be used for actionable widgets or menus.
bool audio_function_apply(ArrangerSelections *sel, AudioFunctionType type, AudioFunctionOpts opts, const char *uri, GError **error)
Applies the given action to the given selections.
AudioFunctionType
@ AUDIO_FUNCTION_GUILE_SCRIPT
Guile script.
@ AUDIO_FUNCTION_EXT_PROGRAM
External program.
@ AUDIO_FUNCTION_CUSTOM_PLUGIN
Custom plugin.
double amount
Amount related to the current function (e.g.
The base plugin Inheriting plugins must have this as a child.
Definition plugin.h:74