Reverting Cam's audio code changes from revision 32517. Part of it has been reverted...
authorJoerg Mueller <nexyon@gmail.com>
Sun, 17 Oct 2010 09:01:37 +0000 (09:01 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Sun, 17 Oct 2010 09:01:37 +0000 (09:01 +0000)
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/sound.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/sound/sound_ops.c
source/blender/makesrna/intern/rna_sound.c

index 09cea572deb3b1a8e826ee65201683f081c9ba6b..190b0400aff7826ed22c92b35c44380163b5d899 100644 (file)
@@ -62,7 +62,7 @@ void sound_cache(struct bSound* sound, int ignore);
 
 void sound_delete_cache(struct bSound* sound);
 
-void sound_load(struct bSound* sound);
+void sound_load(struct Main *main, struct bSound* sound);
 
 void sound_free(struct bSound* sound);
 
index 783402888361ac4928e800dcd87ad8e4d129b6d3..5bbb3506a780fb343fa0785a92d15367ca9700c4 100644 (file)
@@ -486,7 +486,7 @@ int unpackSound(ReportList *reports, bSound *sound, int how)
                        freePackedFile(sound->packedfile);
                        sound->packedfile = 0;
 
-                       sound_load(sound);
+                       sound_load(NULL, sound);
 
                        ret_value = RET_OK;
                }
index b2e5209a4fcad9407c7ac3d6b49ea94b29f65472..5c3047942f77c9933b6967d07fd271f6bb88ecc9 100644 (file)
@@ -143,7 +143,7 @@ struct bSound* sound_new_file(struct Main *bmain, char* filename)
        BLI_strncpy(sound->name, filename, FILE_MAX);
 // XXX unused currently        sound->type = SOUND_TYPE_FILE;
 
-       sound_load(sound);
+       sound_load(bmain, sound);
 
        if(!sound->playback_handle)
        {
@@ -169,7 +169,7 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source)
        sound->child_sound = source;
        sound->type = SOUND_TYPE_BUFFER;
 
-       sound_load(sound);
+       sound_load(CTX_data_main(C), sound);
 
        if(!sound->playback_handle)
        {
@@ -195,7 +195,7 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa
        sound->end = end;
        sound->type = SOUND_TYPE_LIMITER;
 
-       sound_load(sound);
+       sound_load(CTX_data_main(C), sound);
 
        if(!sound->playback_handle)
        {
@@ -236,7 +236,7 @@ void sound_delete_cache(struct bSound* sound)
        }
 }
 
-void sound_load(struct bSound* sound)
+void sound_load(struct Main *UNUSED(bmain), struct bSound* sound)
 {
        if(sound)
        {
@@ -266,6 +266,7 @@ void sound_load(struct bSound* sound)
                        if(sound->id.lib)
                                path = sound->id.lib->filepath;
                        else
+                               // XXX this should be fixed!
                                path = /*bmain ? bmain->name :*/ G.sce;
 
                        BLI_path_abs(fullpath, path);
index 7c8c7eb6e5db751b58435bb12baa653ba1b6e1e9..ebd407e7e215c8786547b2867c5e9a3ef173c32b 100644 (file)
@@ -5308,7 +5308,7 @@ static void lib_link_sound(FileData *fd, Main *main)
                        sound->id.flag -= LIB_NEEDLINK;
                        sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system
                        
-                       sound_load(sound);
+                       sound_load(main, sound);
 
                        if(sound->cache)
                                sound_cache(sound, 1);
index 2be3a51869bddbfb7b0b819df06d225f6fe516a4..18f35502f8b7c965ac42d47e4f86598d7d11a1ce 100644 (file)
@@ -180,7 +180,7 @@ static int pack_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
 
        sound->packedfile= newPackedFile(op->reports, sound->name);
-       sound_load(sound);
+       sound_load(CTX_data_main(C), sound);
 
        return OPERATOR_FINISHED;
 }
index 0c21783722652c3c61f797aa8c8a027dcb4c8dfc..674fbbad9c6f615be52fd3603ce35d7a57d5c1de 100644 (file)
@@ -38,7 +38,7 @@
 
 static void rna_Sound_filepath_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
-       sound_load((bSound*)ptr->data);
+       sound_load(bmain, (bSound*)ptr->data);
 }
 
 static int rna_Sound_caching_get(PointerRNA *ptr)