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/>.
25 struct cbox_recording_source
;
27 CBOX_EXTERN_CLASS(cbox_recorder
)
33 struct cbox_command_target cmd_target
;
35 gboolean (*attach
)(struct cbox_recorder
*handler
, struct cbox_recording_source
*src
, GError
**error
);
36 void (*record_block
)(struct cbox_recorder
*handler
, const float **buffers
, uint32_t numsamples
);
37 gboolean (*detach
)(struct cbox_recorder
*handler
, GError
**error
);
38 void (*destroy
)(struct cbox_recorder
*handler
);
41 struct cbox_recording_source
43 struct cbox_command_target cmd_target
;
44 struct cbox_scene
*scene
;
46 struct cbox_recorder
**handlers
;
48 uint32_t max_numsamples
;
52 #define IS_RECORDING_SOURCE_CONNECTED(src) ((src).handler_count != 0)
54 extern void cbox_recording_source_init(struct cbox_recording_source
*src
, struct cbox_scene
*scene
, uint32_t max_numsamples
, int channels
);
55 extern gboolean
cbox_recording_source_attach(struct cbox_recording_source
*src
, struct cbox_recorder
*rec
, GError
**error
);
56 extern int cbox_recording_source_detach(struct cbox_recording_source
*src
, struct cbox_recorder
*rec
, GError
**error
);
57 extern void cbox_recording_source_push(struct cbox_recording_source
*src
, const float **buffers
, uint32_t numsamples
);
58 extern void cbox_recording_source_uninit(struct cbox_recording_source
*src
);
60 extern struct cbox_recorder
*cbox_recorder_new_stream(struct cbox_rt
*rt
, const char *filename
);