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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-05 23:34:27 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-05 23:34:27 +0400
commit59a823c48aec80a48b39e27f8474302caf2dbf26 (patch)
tree16c70594284aaa154b99f8b91e605b447955001f /source/blender/blenkernel
parenta6d9a5a972595c898e596deb95eb683430621188 (diff)
Code cleanup: remove context from RNA update functions, only one left.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_sound.h9
-rw-r--r--source/blender/blenkernel/intern/sequencer.c3
-rw-r--r--source/blender/blenkernel/intern/sound.c34
3 files changed, 26 insertions, 20 deletions
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index fac5bf1cfd2..3728dd41089 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -39,7 +39,6 @@
struct PackedFile;
struct bSound;
-struct bContext;
struct ListBase;
struct Main;
struct Sequence;
@@ -65,12 +64,12 @@ struct bSound* sound_new_file(struct Main *main, const char *filename);
// 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);
-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);
#endif
-void sound_delete(struct bContext *C, struct bSound* sound);
+void sound_delete(struct Main *bmain, struct bSound* sound);
void sound_cache(struct bSound* sound);
@@ -124,7 +123,7 @@ void sound_play_scene(struct Scene *scene);
void sound_stop_scene(struct Scene *scene);
-void sound_seek_scene(struct bContext *C);
+void sound_seek_scene(struct Main *bmain, struct Scene *scene);
float sound_sync_scene(struct Scene *scene);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 9ef30bdd49b..dbb2e7860c5 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -3603,6 +3603,7 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
#ifdef WITH_AUDASPACE
Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load)
{
+ Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C); /* only for sound */
Editing *ed= seq_give_editing(scene, TRUE);
bSound *sound;
@@ -3624,7 +3625,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
info = AUD_getInfo(sound->playback_handle);
if (info.specs.channels == AUD_CHANNELS_INVALID) {
- sound_delete(C, sound);
+ sound_delete(bmain, sound);
//if(op)
// BKE_report(op->reports, RPT_ERROR, "Unsupported audio format");
return NULL;
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 74f4830b86c..ff518d69e21 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -203,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;
@@ -211,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;
@@ -235,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;
}
@@ -254,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);
}
}
@@ -538,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();
@@ -560,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)
{
@@ -758,7 +764,7 @@ 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; }