Implement egN_vel2freq and egN_vel2gain. Tighten EQ-change logic.
[calfbox.git] / scene.h
blob935763d3028cf29fd4b89efd7f05e7d7201b07e4
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"
24 #include "mididest.h"
26 CBOX_EXTERN_CLASS(cbox_scene)
28 struct cbox_aux_bus;
29 struct cbox_instrument;
30 struct cbox_midi_buffer;
31 struct cbox_recording_source;
32 struct cbox_song_playback;
34 struct cbox_scene
36 CBOX_OBJECT_HEADER()
37 struct cbox_command_target cmd_target;
38 gchar *name;
39 gchar *title;
41 GHashTable *instrument_hash;
42 struct cbox_rt *rt;
43 struct cbox_layer **layers;
44 int layer_count;
45 struct cbox_instrument **instruments;
46 int instrument_count;
47 struct cbox_aux_bus **aux_buses;
48 int aux_bus_count;
49 int transpose;
50 struct cbox_engine *engine;
51 struct cbox_midi_merger scene_input_merger;
52 struct cbox_midi_buffer midibuf_total;
54 struct cbox_midi_input **connected_inputs;
55 int connected_input_count;
57 gboolean enable_default_song_input, enable_default_external_input;
59 struct cbox_recording_source *rec_mono_inputs, *rec_mono_outputs;
60 struct cbox_recording_source *rec_stereo_inputs, *rec_stereo_outputs;
63 extern struct cbox_scene *cbox_scene_new(struct cbox_document *document, struct cbox_engine *engine);
64 extern gboolean cbox_scene_add_layer(struct cbox_scene *scene, struct cbox_layer *layer, GError **error);
65 extern gboolean cbox_scene_insert_layer(struct cbox_scene *scene, struct cbox_layer *layer, int pos, GError **error);
66 extern struct cbox_layer *cbox_scene_remove_layer(struct cbox_scene *scene, int pos);
67 extern void cbox_scene_move_layer(struct cbox_scene *scene, int oldpos, int newpos);
68 extern gboolean cbox_scene_load(struct cbox_scene *scene, const char *section, GError **error);
69 extern gboolean cbox_scene_remove_instrument(struct cbox_scene *scene, struct cbox_instrument *instrument);
70 extern struct cbox_aux_bus *cbox_scene_get_aux_bus(struct cbox_scene *scene, const char *name, int allow_load, GError **error);
71 extern void cbox_scene_render(struct cbox_scene *scene, uint32_t nframes, float *output_buffers[]);
72 extern void cbox_scene_clear(struct cbox_scene *scene);
73 extern void cbox_scene_update_connected_inputs(struct cbox_scene *scene);
74 extern struct cbox_instrument *cbox_scene_get_instrument_by_name(struct cbox_scene *scene, const char *name, gboolean load, GError **error);
75 extern struct cbox_instrument *cbox_scene_create_instrument(struct cbox_scene *scene, const char *instrument_name, const char *engine_name, GError **error);
78 #endif