1 /*
2  * Copyright (C) 2020 Alexandros Theodotou <alex at zrythm dot org>
3  *
4  * This file is part of Zrythm
5  *
6  * Zrythm is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Affero General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Zrythm is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Affero General Public License for more details.
15  *
16  * You should have received a copy of the GNU Affero General Public License
17  * along with Zrythm.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 /**
21  * @file
22  *
23  * Automation functions.
24  *
25  * TODO move to a more appropriate directory.
26  */
27 
28 #ifndef __AUDIO_AUTOMATION_FUNCTION_H__
29 #define __AUDIO_AUTOMATION_FUNCTION_H__
30 
31 #include "utils/yaml.h"
32 
33 typedef struct ArrangerSelections ArrangerSelections;
34 
35 /**
36  * @addtogroup audio
37  *
38  * @{
39  */
40 
41 typedef enum AutomationFunctionType
42 {
43   AUTOMATION_FUNCTION_FLIP_HORIZONTAL,
44   AUTOMATION_FUNCTION_FLIP_VERTICAL,
45 } AutomationFunctionType;
46 
47 static const cyaml_strval_t
48   automation_function_type_strings[] =
49 {
50   { __("Flip H"), AUTOMATION_FUNCTION_FLIP_HORIZONTAL },
51   { __("Flip V"), AUTOMATION_FUNCTION_FLIP_VERTICAL },
52 };
53 
54 static inline const char *
automation_function_type_to_string(AutomationFunctionType type)55 automation_function_type_to_string (
56   AutomationFunctionType type)
57 {
58   return automation_function_type_strings[type].str;
59 }
60 
61 /**
62  * Applies the given action to the given selections.
63  *
64  * @param sel Selections to edit.
65  * @param type Function type.
66  */
67 int
68 automation_function_apply (
69   ArrangerSelections *   sel,
70   AutomationFunctionType type,
71   GError **              error);
72 
73 /**
74  * @}
75  */
76 
77 #endif
78