Merge with trunk r37757.
authorJoerg Mueller <nexyon@gmail.com>
Thu, 23 Jun 2011 17:30:56 +0000 (17:30 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Thu, 23 Jun 2011 17:30:56 +0000 (17:30 +0000)
1  2 
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/editors/space_graph/graph_edit.c
source/blender/makesrna/intern/rna_scene.c
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_SoundActuator.h

index 9b86b8752db543376994bc2c9279349b2e313989,0eb2392b012ec01367621c50e2658afe491558cc..eb8703877ba572e58f9430c8cbcda019794719f5
  
  static int force_device = -1;
  
 -
+ struct bSound* sound_new_file(struct Main *bmain, const char *filename)
+ {
+       bSound* sound = NULL;
+       char str[FILE_MAX];
+       char *path;
+       int len;
+       strcpy(str, filename);
+       path = /*bmain ? bmain->name :*/ G.main->name;
+       BLI_path_abs(str, path);
+       len = strlen(filename);
+       while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\')
+               len--;
+       sound = alloc_libblock(&bmain->sound, ID_SO, filename+len);
+       BLI_strncpy(sound->name, filename, FILE_MAX);
+ // XXX unused currently       sound->type = SOUND_TYPE_FILE;
+       sound_load(bmain, sound);
+       if(!sound->playback_handle)
+       {
+               free_libblock(&bmain->sound, sound);
+               sound = NULL;
+       }
+       return sound;
+ }
+ void sound_free(struct bSound* sound)
+ {
+       if (sound->packedfile)
+       {
+               freePackedFile(sound->packedfile);
+               sound->packedfile = NULL;
+       }
+ #ifdef WITH_AUDASPACE
+       if(sound->handle)
+       {
+               AUD_unload(sound->handle);
+               sound->handle = NULL;
+               sound->playback_handle = NULL;
+       }
++
++      if(sound->cache)
++      {
++              AUD_unload(sound->cache);
++      }
+ #endif // WITH_AUDASPACE
+ }
+ #ifdef WITH_AUDASPACE
  #ifdef WITH_JACK
  static void sound_sync_callback(void* data, int mode, float time)
  {
@@@ -543,7 -511,33 +550,38 @@@ int sound_get_channels(struct bSound* s
        return info.specs.channels;
  }
  
 +void* sound_get_factory(void* sound)
 +{
 +      return ((struct bSound*) sound)->playback_handle;
 +}
++
+ #else // WITH_AUDASPACE
+ #include "BLI_utildefines.h"
+ int sound_define_from_str(const char *UNUSED(str)) { return -1;}
+ void sound_force_device(int UNUSED(device)) {}
+ void sound_init_once(void) {}
+ void sound_init(struct Main *UNUSED(bmain)) {}
+ void sound_exit(void) {}
+ void sound_cache(struct bSound* UNUSED(sound), int UNUSED(ignore)) { }
+ void sound_delete_cache(struct bSound* UNUSED(sound)) {}
+ void sound_load(struct Main *UNUSED(bmain), struct bSound* UNUSED(sound)) {}
+ void sound_create_scene(struct Scene *UNUSED(scene)) {}
+ void sound_destroy_scene(struct Scene *UNUSED(scene)) {}
+ void sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
+ void* sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+ void* sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+ void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {}
+ void sound_mute_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), char UNUSED(mute)) {}
+ void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {}
+ 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)) {}
+ float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
+ int sound_scene_playing(struct Scene *UNUSED(scene)) { return 0; }
+ int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
+ int sound_get_channels(struct bSound* UNUSED(sound)) { return 1; }
+ #endif // WITH_AUDASPACE
index 0ce57a57fe72342a425c9f816ee932c40558a9d4,4db53999f10eb6bea2aec247c2add55c601cb0d8..ae4387c12f98e3795351d56522100f3caf2adf79
@@@ -859,12 -866,8 +865,12 @@@ int start_ffmpeg(struct Scene *scene, R
                specs.format = AUD_FORMAT_S16;
                specs.rate = rd->ffcodecdata.audio_mixrate;
                audio_mixdown_device = sound_mixdown(scene, specs, rd->sfra, rd->ffcodecdata.audio_volume);
 +#ifdef FFMPEG_CODEC_TIME_BASE
 +              c->time_base.den = specs.rate;
 +              c->time_base.num = 1;
 +#endif
        }
+ #endif
        return success;
  }
  
index 6fe793bd4753c6124a7fbe99ffb32635e31d1344,b5a63f44729a80b5a1867eb4d39629ec0bf9428a..ecb73cb0ae9b8db6eaf753d5df99bf25339202ca
@@@ -40,18 -40,16 +40,17 @@@ set(IN
        ../../../source/blender/blenkernel
        ../../../source/blender/python
        ../../../source/blender/python/generic
 -      ../../../source/blender 
 -      ../../../source/blender/makesdna 
 -      ../../../source/gameengine/Rasterizer 
 +      ../../../source/blender
 +      ../../../source/blender/makesdna
 +      ../../../source/blender/makesrna
 +      ../../../source/gameengine/Rasterizer
        ../../../source/gameengine/GameLogic
 -      ../../../source/gameengine/Expressions 
 +      ../../../source/gameengine/Expressions
        ../../../source/gameengine/Ketsji/KXNetwork
        ../../../source/gameengine/Network
 -      ../../../source/gameengine/SceneGraph 
 +      ../../../source/gameengine/SceneGraph
        ../../../source/gameengine/Physics/common
        ../../../source/gameengine/Network/LoopBackNetwork
-       ../../../intern/audaspace/intern
        ../../../source/blender/blenloader
        ../../../source/blender/gpu
  )