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 <stdbool.h>
16
17#include <glib/gi18n.h>
18
20typedef struct Plugin Plugin;
21
29{
30 AUDIO_FUNCTION_INVERT,
31 AUDIO_FUNCTION_NORMALIZE_PEAK,
32 AUDIO_FUNCTION_NORMALIZE_RMS,
33 AUDIO_FUNCTION_NORMALIZE_LUFS,
34 AUDIO_FUNCTION_LINEAR_FADE_IN,
35 AUDIO_FUNCTION_LINEAR_FADE_OUT,
36 AUDIO_FUNCTION_NUDGE_LEFT,
37 AUDIO_FUNCTION_NUDGE_RIGHT,
38 AUDIO_FUNCTION_REVERSE,
39 AUDIO_FUNCTION_PITCH_SHIFT,
40 AUDIO_FUNCTION_COPY_L_TO_R,
41
44
47
50
51 /* reserved */
52 AUDIO_FUNCTION_INVALID,
54
55static const char * audio_function_type_strings[] = {
56 N_ ("Invert"), N_ ("Normalize peak"), N_ ("Normalize RMS"),
57 N_ ("Normalize LUFS"), N_ ("Linear fade in"), N_ ("Linear fade out"),
58 N_ ("Nudge left"), N_ ("Nudge right"), N_ ("Reverse"),
59 N_ ("Pitch shift"), N_ ("Copy L to R"), N_ ("External program"),
60 N_ ("Guile script"), N_ ("Custom plugin"), N_ ("Invalid"),
61};
62
63typedef struct AudioFunctionOpts
64{
68 double amount;
69
71
72static inline const char *
73audio_function_type_to_string (AudioFunctionType type)
74{
75 return audio_function_type_strings[type];
76}
77
78char *
79audio_function_get_action_target_for_type (AudioFunctionType type);
80
87char *
90 const char * base_action);
91
92#define audio_function_get_detailed_action_for_type_default(type) \
93 audio_function_get_detailed_action_for_type (type, "app.editor-function")
94
95const char *
96audio_function_get_icon_name_for_type (AudioFunctionType type);
97
102static inline const char *
103audio_function_get_plugin_uri_for_type (AudioFunctionType type)
104{
105 switch (type)
106 {
107 default:
108 break;
109 }
110
111 return NULL;
112}
113
128bool
130 ArrangerSelections * sel,
133 const char * uri,
134 GError ** error);
135
140#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_CUSTOM_PLUGIN
Custom plugin.
@ AUDIO_FUNCTION_GUILE_SCRIPT
Guile script.
@ AUDIO_FUNCTION_EXT_PROGRAM
External program.
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