2 Calf Box, an open source musical instrument.
3 Copyright (C) 2010-2011 Krzysztof Foltman
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef CBOX_WAVEBANK_H
20 #define CBOX_WAVEBANK_H
25 #define MAX_INTERPOLATION_ORDER 3
27 #define CBOX_WAVEFORM_ERROR cbox_waveform_error_quark()
29 enum CboxWaveformError
31 CBOX_WAVEFORM_ERROR_FAILED
,
34 struct cbox_waveform_level
47 size_t preloaded_frames
;
48 gchar
*canonical_name
;
51 uint32_t loop_start
, loop_end
;
53 struct cbox_waveform_level
*levels
;
57 extern struct cbox_command_target cbox_waves_cmd_target
;
59 extern void cbox_wavebank_init(void);
60 extern struct cbox_waveform
*cbox_wavebank_get_waveform(const char *context_name
, const char *sample_dir
, const char *filename
, GError
**error
);
61 extern struct cbox_waveform
*cbox_wavebank_peek_waveform_by_id(int id
);
62 extern void cbox_wavebank_foreach(void (*cb
)(void *user_data
, struct cbox_waveform
*waveform
), void *user_data
);
63 extern void cbox_wavebank_add_std_waveform(const char *name
, float (*getfunc
)(float v
, void *user_data
), void *user_data
, int levels
);
64 extern int cbox_wavebank_get_count(void);
65 extern int64_t cbox_wavebank_get_bytes(void);
66 extern int64_t cbox_wavebank_get_maxbytes(void);
67 extern void cbox_wavebank_close(void);
69 extern void cbox_waveform_ref(struct cbox_waveform
*waveform
);
70 extern void cbox_waveform_unref(struct cbox_waveform
*waveform
);