From 3307d6d5097b12f9601a31c1d41b2fbab5228f9a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Feb 2010 19:54:18 +0000 Subject: [PATCH] building without jack was broken --- intern/audaspace/intern/AUD_C-API.cpp | 4 ++-- intern/audaspace/intern/AUD_C-API.h | 2 ++ source/blender/blenkernel/intern/sound.c | 25 +++++++++++++----------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index d2540d59eda..f7394e36c4d 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -805,14 +805,14 @@ float AUD_getSequencerPosition(AUD_Handle* handle) } } +#ifdef WITH_JACK void AUD_setSyncCallback(AUD_syncFunction function, void* data) { -#ifdef WITH_JACK AUD_JackDevice* device = dynamic_cast(AUD_device); if(device) device->setSyncCallback(function, data); -#endif } +#endif int AUD_doesPlayback() { diff --git a/intern/audaspace/intern/AUD_C-API.h b/intern/audaspace/intern/AUD_C-API.h index a252ad904b6..a7372c29885 100644 --- a/intern/audaspace/intern/AUD_C-API.h +++ b/intern/audaspace/intern/AUD_C-API.h @@ -392,7 +392,9 @@ extern void AUD_seekSequencer(AUD_Handle* handle, float time); extern float AUD_getSequencerPosition(AUD_Handle* handle); +#ifdef WITH_JACK extern void AUD_setSyncCallback(AUD_syncFunction function, void* data); +#endif extern int AUD_doesPlayback(); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index a1a6880569b..93b1ef379d8 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -41,10 +41,10 @@ static int force_device = -1; static void sound_sync_callback(void* data, int mode, float time) { - struct Main* main = (struct Main*)data; + struct Main* bmain = (struct Main*)data; struct Scene* scene; - scene = main->scene.first; + scene = bmain->scene.first; while(scene) { if(scene->audio.flag & AUDIO_SYNC) @@ -78,7 +78,7 @@ void sound_force_device(int device) force_device = device; } -void sound_init(struct Main *main) +void sound_init(struct Main *bmain) { AUD_DeviceSpecs specs; int device, buffersize; @@ -106,7 +106,10 @@ void sound_init(struct Main *main) if(!AUD_init(device, specs, buffersize)) AUD_init(AUD_NULL_DEVICE, specs, buffersize); - AUD_setSyncCallback(sound_sync_callback, main); + +#ifdef WITH_JACK + AUD_setSyncCallback(sound_sync_callback, bmain); +#endif } void sound_exit() @@ -114,7 +117,7 @@ void sound_exit() AUD_exit(); } -struct bSound* sound_new_file(struct Main *main, char* filename) +struct bSound* sound_new_file(struct Main *bmain, char* filename) { bSound* sound = NULL; @@ -122,21 +125,21 @@ struct bSound* sound_new_file(struct Main *main, char* filename) int len; strcpy(str, filename); - BLI_convertstringcode(str, main->name); + BLI_convertstringcode(str, bmain->name); len = strlen(filename); while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\') len--; - sound = alloc_libblock(&main->sound, ID_SO, filename+len); + sound = alloc_libblock(&bmain->sound, ID_SO, filename+len); strcpy(sound->name, filename); // XXX unused currently sound->type = SOUND_TYPE_FILE; - sound_load(main, sound); + sound_load(bmain, sound); if(!sound->playback_handle) { - free_libblock(&main->sound, sound); + free_libblock(&bmain->sound, sound); sound = NULL; } @@ -225,7 +228,7 @@ void sound_delete_cache(struct bSound* sound) } } -void sound_load(struct Main *main, struct bSound* sound) +void sound_load(struct Main *bmain, struct bSound* sound) { if(sound) { @@ -255,7 +258,7 @@ void sound_load(struct Main *main, struct bSound* sound) if(sound->id.lib) path = sound->id.lib->filename; else - path = main ? main->name : G.sce; + path = bmain ? bmain->name : G.sce; BLI_convertstringcode(fullpath, path);