Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r--source/blender/blenkernel/intern/sound.c48
1 files changed, 34 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index cdb509ab8e1..ff518d69e21 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -39,8 +39,10 @@
#include "BKE_sequencer.h"
#include "BKE_scene.h"
+#ifdef WITH_AUDASPACE
// evil global ;-)
static int sound_cfra;
+#endif
struct bSound* sound_new_file(struct Main *bmain, const char *filename)
{
@@ -201,7 +203,7 @@ void sound_exit(void)
// XXX unused currently
#if 0
-struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
+struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source)
{
bSound* sound = NULL;
@@ -209,23 +211,23 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
strcpy(name, "buf_");
strcpy(name + 4, source->id.name);
- sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name);
+ sound = alloc_libblock(&bmain->sound, ID_SO, name);
sound->child_sound = source;
sound->type = SOUND_TYPE_BUFFER;
- sound_load(CTX_data_main(C), sound);
+ sound_load(bmain, sound);
if(!sound->playback_handle)
{
- free_libblock(&CTX_data_main(C)->sound, sound);
+ free_libblock(&bmain->sound, sound);
sound = NULL;
}
return sound;
}
-struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, float start, float end)
+struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end)
{
bSound* sound = NULL;
@@ -233,18 +235,18 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa
strcpy(name, "lim_");
strcpy(name + 4, source->id.name);
- sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name);
+ sound = alloc_libblock(&bmain->sound, ID_SO, name);
sound->child_sound = source;
sound->start = start;
sound->end = end;
sound->type = SOUND_TYPE_LIMITER;
- sound_load(CTX_data_main(C), sound);
+ sound_load(bmain, sound);
if(!sound->playback_handle)
{
- free_libblock(&CTX_data_main(C)->sound, sound);
+ free_libblock(&bmain->sound, sound);
sound = NULL;
}
@@ -252,13 +254,13 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa
}
#endif
-void sound_delete(struct bContext *C, struct bSound* sound)
+void sound_delete(struct Main *bmain, struct bSound* sound)
{
if(sound)
{
sound_free(sound);
- free_libblock(&CTX_data_main(C)->sound, sound);
+ free_libblock(&bmain->sound, sound);
}
}
@@ -536,10 +538,11 @@ void sound_stop_scene(struct Scene *scene)
}
}
-void sound_seek_scene(struct bContext *C)
+void sound_seek_scene(struct Main *bmain, struct Scene *scene)
{
- struct Scene *scene = CTX_data_scene(C);
AUD_Status status;
+ bScreen *screen;
+ int animation_playing;
AUD_lock();
@@ -558,7 +561,12 @@ void sound_seek_scene(struct bContext *C)
AUD_pause(scene->sound_scene_handle);
}
- if(scene->audio.flag & AUDIO_SCRUB && !CTX_wm_screen(C)->animtimer)
+ animation_playing = 0;
+ for(screen=bmain->screen.first; screen; screen=screen->id.next)
+ if(screen->animtimer)
+ animation_playing = 1;
+
+ if(scene->audio.flag & AUDIO_SCRUB && !animation_playing)
{
if(scene->audio.flag & AUDIO_SYNC)
{
@@ -756,9 +764,21 @@ void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), i
static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
void sound_play_scene(struct Scene *UNUSED(scene)) {}
void sound_stop_scene(struct Scene *UNUSED(scene)) {}
-void sound_seek_scene(struct bContext *UNUSED(C)) {}
+void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
+void sound_read_waveform(struct bSound* sound) { (void)sound; }
+void sound_init_main(struct Main *bmain) { (void)bmain; }
+void sound_set_cfra(int cfra) { (void)cfra; }
+void sound_update_sequencer(struct Main* main, struct bSound* sound) { (void)main; (void)sound; }
+void sound_update_scene(struct Scene* scene) { (void)scene; }
+void sound_update_scene_sound(void* handle, struct bSound* sound) { (void)handle; (void)sound; }
+void sound_update_scene_listener(struct Scene *scene) { (void)scene; }
+void sound_update_fps(struct Scene *scene) { (void)scene; }
+void sound_set_scene_sound_volume(void* handle, float volume, char animated) { (void)handle; (void)volume; (void)animated; }
+void sound_set_scene_sound_pan(void* handle, float pan, char animated) { (void)handle; (void)pan; (void)animated; }
+void sound_set_scene_volume(struct Scene *scene, float volume) { (void)scene; (void)volume; }
+void sound_set_scene_sound_pitch(void* handle, float pitch, char animated) { (void)handle; (void)pitch; (void)animated; }
#endif // WITH_AUDASPACE