Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 #ifndef BKE_SOUND_H 00028 #define BKE_SOUND_H 00029 00036 #define SOUND_WAVE_SAMPLES_PER_SECOND 250 00037 00038 struct PackedFile; 00039 struct bSound; 00040 struct ListBase; 00041 struct Main; 00042 struct Sequence; 00043 00044 typedef struct SoundWaveform 00045 { 00046 int length; 00047 float *data; 00048 } SoundWaveform; 00049 00050 void sound_init_once(void); 00051 00052 void sound_init(struct Main *main); 00053 00054 void sound_init_main(struct Main *bmain); 00055 00056 void sound_exit(void); 00057 00058 void sound_force_device(int device); 00059 int sound_define_from_str(const char *str); 00060 00061 struct bSound* sound_new_file(struct Main *main, const char *filename); 00062 00063 // XXX unused currently 00064 #if 0 00065 struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source); 00066 00067 struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end); 00068 #endif 00069 00070 void sound_delete(struct Main *bmain, struct bSound* sound); 00071 00072 void sound_cache(struct bSound* sound); 00073 00074 void sound_cache_notifying(struct Main* main, struct bSound* sound); 00075 00076 void sound_delete_cache(struct bSound* sound); 00077 00078 void sound_load(struct Main *main, struct bSound* sound); 00079 00080 void sound_free(struct bSound* sound); 00081 00082 #ifdef AUD_CAPI 00083 AUD_Device* sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume); 00084 #endif 00085 00086 void sound_create_scene(struct Scene *scene); 00087 00088 void sound_destroy_scene(struct Scene *scene); 00089 00090 void sound_mute_scene(struct Scene *scene, int muted); 00091 00092 void sound_update_fps(struct Scene *scene); 00093 00094 void sound_update_scene_listener(struct Scene *scene); 00095 00096 void* sound_scene_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip); 00097 void* sound_scene_add_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence); 00098 00099 void* sound_add_scene_sound(struct Scene *scene, struct Sequence* sequence, int startframe, int endframe, int frameskip); 00100 void* sound_add_scene_sound_defaults(struct Scene *scene, struct Sequence* sequence); 00101 00102 void sound_remove_scene_sound(struct Scene *scene, void* handle); 00103 00104 void sound_mute_scene_sound(void* handle, char mute); 00105 00106 void sound_move_scene_sound(struct Scene *scene, void* handle, int startframe, int endframe, int frameskip); 00107 void sound_move_scene_sound_defaults(struct Scene *scene, struct Sequence *sequence); 00108 00109 void sound_update_scene_sound(void* handle, struct bSound* sound); 00110 00111 void sound_set_cfra(int cfra); 00112 00113 void sound_set_scene_volume(struct Scene *scene, float volume); 00114 00115 void sound_set_scene_sound_volume(void* handle, float volume, char animated); 00116 00117 void sound_set_scene_sound_pitch(void* handle, float pitch, char animated); 00118 00119 void sound_set_scene_sound_pan(void* handle, float pan, char animated); 00120 00121 void sound_update_sequencer(struct Main* main, struct bSound* sound); 00122 00123 void sound_play_scene(struct Scene *scene); 00124 00125 void sound_stop_scene(struct Scene *scene); 00126 00127 void sound_seek_scene(struct Main *bmain, struct Scene *scene); 00128 00129 float sound_sync_scene(struct Scene *scene); 00130 00131 int sound_scene_playing(struct Scene *scene); 00132 00133 void sound_free_waveform(struct bSound* sound); 00134 00135 void sound_read_waveform(struct bSound* sound); 00136 00137 void sound_update_scene(struct Scene* scene); 00138 00139 void* sound_get_factory(void* sound); 00140 00141 #endif