Attempt at fixing premature release of notes on update_playback.
[calfbox.git] / scene.h
bloba8d0e499d2c7be7d435ece3ee755fa485b043db9
1 /*
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_SCENE_H
20 #define CBOX_SCENE_H
22 #include "cmd.h"
23 #include "dom.h"
25 CBOX_EXTERN_CLASS(cbox_scene)
27 struct cbox_aux_bus;
28 struct cbox_instrument;
29 struct cbox_midi_buffer;
30 struct cbox_recording_source;
31 struct cbox_song_playback;
33 struct cbox_scene
35 CBOX_OBJECT_HEADER()
36 struct cbox_command_target cmd_target;
37 gchar *name;
38 gchar *title;
40 GHashTable *instrument_hash;
41 struct cbox_rt *rt;
42 struct cbox_layer **layers;
43 int layer_count;
44 struct cbox_instrument **instruments;
45 int instrument_count;
46 struct cbox_aux_bus **aux_buses;
47 int aux_bus_count;
48 int transpose;
49 int owns_rt;
50 struct cbox_song_playback *spb;
52 struct cbox_recording_source *rec_mono_inputs, *rec_mono_outputs;
53 struct cbox_recording_source *rec_stereo_inputs, *rec_stereo_outputs;
56 extern struct cbox_scene *cbox_scene_new(struct cbox_document *document, struct cbox_rt *rt, int owns_rt);
57 extern gboolean cbox_scene_add_layer(struct cbox_scene *scene, struct cbox_layer *layer, GError **error);
58 extern gboolean cbox_scene_insert_layer(struct cbox_scene *scene, struct cbox_layer *layer, int pos, GError **error);
59 extern struct cbox_layer *cbox_scene_remove_layer(struct cbox_scene *scene, int pos);
60 extern void cbox_scene_move_layer(struct cbox_scene *scene, int oldpos, int newpos);
61 extern gboolean cbox_scene_load(struct cbox_scene *scene, const char *section, GError **error);
62 extern gboolean cbox_scene_remove_instrument(struct cbox_scene *scene, struct cbox_instrument *instrument);
63 extern struct cbox_aux_bus *cbox_scene_get_aux_bus(struct cbox_scene *scene, const char *name, int allow_load, GError **error);
64 extern void cbox_scene_render(struct cbox_scene *scene, uint32_t nframes, struct cbox_midi_buffer *midibuf_total, float *output_buffers[]);
65 extern void cbox_scene_clear(struct cbox_scene *scene);
66 extern struct cbox_instrument *cbox_scene_get_instrument_by_name(struct cbox_scene *scene, const char *name, gboolean load, GError **error);
67 extern struct cbox_instrument *cbox_scene_create_instrument(struct cbox_scene *scene, const char *instrument_name, const char *engine_name, GError **error);
70 #endif