Debian Codegraph @

modules/lsp-runtime-lib/include/lsp-plug.in/fmt/Hydrogen.h

raw
1 /*
2 * Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2025 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-runtime-lib
6 * Created on: 11 июл. 2020 г.
7 *
8 * lsp-runtime-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-runtime-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef LSP_PLUG_IN_FMT_HYDROGEN_H_
23 #define LSP_PLUG_IN_FMT_HYDROGEN_H_
24
25 #include <lsp-plug.in/common/types.h>
26 #include <lsp-plug.in/common/status.h>
27 #include <lsp-plug.in/io/Path.h>
28 #include <lsp-plug.in/io/File.h>
29 #include <lsp-plug.in/io/IInStream.h>
30 #include <lsp-plug.in/io/IInSequence.h>
31 #include <lsp-plug.in/lltl/parray.h>
32
33 namespace lsp
34 {
35 namespace hydrogen
36 {
37 typedef struct layer_t
38 {
39 private:
40 layer_t & operator = (const layer_t &);
41
42 public:
43 LSPString file_name;
44 float min;
45 float max;
46 float gain;
47 float pitch;
48
49 public:
50 explicit layer_t();
51 ~layer_t();
52 } layer_t;
53
54 typedef struct instrument_t
55 {
56 private:
57 instrument_t & operator = (const instrument_t &);
58
59 public:
60 ssize_t id;
61 LSPString file_name;
62 LSPString name;
63 float volume;
64 bool muted;
65 bool locked;
66 float pan_left;
67 float pan_right;
68 float random_pitch_factor;
69 float gain;
70 bool filter_active;
71 float filter_cutoff;
72 float filter_resonance;
73 float attack;
74 float decay;
75 float sustain;
76 float release;
77 ssize_t mute_group;
78 bool stop_note;
79 ssize_t midi_out_channel;
80 ssize_t midi_out_note;
81 ssize_t midi_in_channel;
82 ssize_t midi_in_note;
83 float fx1_level;
84 float fx2_level;
85 float fx3_level;
86 float fx4_level;
87
88 lltl::parray<layer_t> layers;
89
90 public:
91 explicit instrument_t();
92 ~instrument_t();
93 } instrument_t;
94
95 typedef struct drumkit_t
96 {
97 private:
98 drumkit_t & operator = (const drumkit_t &);
99
100 public:
101 LSPString name;
102 LSPString author;
103 LSPString info;
104 LSPString license;
105 lltl::parray<instrument_t> instruments;
106
107 public:
108 explicit drumkit_t();
109 ~drumkit_t();
110
111 void swap(drumkit_t *dst);
112 } drumkit_t;
113
114
115 /**
116 * Load drumkit file
117 * @param path UTF-8 encoded location of the file
118 * @param dst pointer to store drumkit data
119 * @return status of operation
120 */
121 status_t load(const char *path, drumkit_t *dst);
122
123 /**
124 * Load drumkit file
125 * @param path location of the file
126 * @param dst pointer to store drumkit data
127 * @return status of operation
128 */
129 status_t load(const LSPString *path, drumkit_t *dst);
130
131 /**
132 * Load drumkit file
133 * @param path location of the file
134 * @param dst pointer to store drumkit data
135 * @return status of operation
136 */
137 status_t load(const io::Path *path, drumkit_t *dst);
138
139 /**
140 * Load drumkit from character input stream
141 * @param is input stream pointer
142 * @param dst pointer to store drumkit data
143 * @return status of operation
144 */
145 status_t load(io::IInStream *is, drumkit_t *dst);
146
147 /**
148 * Load drumkit from character input stream
149 * @param is input sequence pointer
150 * @param dst pointer to store drumkit data
151 * @return status of operation
152 */
153 status_t load(io::IInSequence *is, drumkit_t *dst);
154
155 } /* namespace hydrogen */
156 } /* namespace lsp */
157
158 #endif /* LSP_PLUG_IN_FMT_HYDROGEN_H_ */