2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
27 #ifndef __BKE_SOUND_H__
28 #define __BKE_SOUND_H__
36 #define SOUND_WAVE_SAMPLES_PER_SECOND 250
39 # ifdef WITH_EXTERNAL_AUDASPACE
40 # include <audaspace/AUD_Device.h>
48 typedef struct SoundWaveform {
53 void BKE_sound_init_once(void);
54 void BKE_sound_exit_once(void);
56 void BKE_sound_init(struct Main *main);
58 void BKE_sound_init_main(struct Main *bmain);
60 void BKE_sound_exit(void);
62 void BKE_sound_force_device(int device);
63 int BKE_sound_define_from_str(const char *str);
65 struct bSound *BKE_sound_new_file(struct Main *main, const char *filename);
67 // XXX unused currently
69 struct bSound *BKE_sound_new_buffer(struct Main *bmain, struct bSound *source);
71 struct bSound *BKE_sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end);
74 void BKE_sound_delete(struct Main *bmain, struct bSound *sound);
76 void BKE_sound_cache(struct bSound *sound);
78 void BKE_sound_delete_cache(struct bSound *sound);
80 void BKE_sound_load(struct Main *main, struct bSound *sound);
82 void BKE_sound_free(struct bSound *sound);
84 #if defined(__AUD_C_API_H__) || defined(WITH_EXTERNAL_AUDASPACE)
85 AUD_Device *BKE_sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume);
88 void BKE_sound_create_scene(struct Scene *scene);
90 void BKE_sound_destroy_scene(struct Scene *scene);
92 void BKE_sound_mute_scene(struct Scene *scene, int muted);
94 void BKE_sound_update_fps(struct Scene *scene);
96 void BKE_sound_update_scene_listener(struct Scene *scene);
98 void *BKE_sound_scene_add_scene_sound(struct Scene *scene, struct Sequence *sequence, int startframe, int endframe, int frameskip);
99 void *BKE_sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence);
101 void *BKE_sound_add_scene_sound(struct Scene *scene, struct Sequence *sequence, int startframe, int endframe, int frameskip);
102 void *BKE_sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence);
104 void BKE_sound_remove_scene_sound(struct Scene *scene, void *handle);
106 void BKE_sound_mute_scene_sound(void *handle, char mute);
108 void BKE_sound_move_scene_sound(struct Scene *scene, void *handle, int startframe, int endframe, int frameskip);
109 void BKE_sound_move_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence);
111 void BKE_sound_update_scene_sound(void *handle, struct bSound *sound);
113 void BKE_sound_set_cfra(int cfra);
115 void BKE_sound_set_scene_volume(struct Scene *scene, float volume);
117 void BKE_sound_set_scene_sound_volume(void *handle, float volume, char animated);
119 void BKE_sound_set_scene_sound_pitch(void *handle, float pitch, char animated);
121 void BKE_sound_set_scene_sound_pan(void *handle, float pan, char animated);
123 void BKE_sound_update_sequencer(struct Main *main, struct bSound *sound);
125 void BKE_sound_play_scene(struct Scene *scene);
127 void BKE_sound_stop_scene(struct Scene *scene);
129 void BKE_sound_seek_scene(struct Main *bmain, struct Scene *scene);
131 float BKE_sound_sync_scene(struct Scene *scene);
133 int BKE_sound_scene_playing(struct Scene *scene);
135 void BKE_sound_free_waveform(struct bSound *sound);
137 void BKE_sound_read_waveform(struct bSound *sound, short *stop);
139 void BKE_sound_update_scene(struct Main *bmain, struct Scene *scene);
141 void *BKE_sound_get_factory(void *sound);
143 float BKE_sound_get_length(struct bSound *sound);
145 bool BKE_sound_is_jack_supported(void);
147 #endif /* __BKE_SOUND_H__ */