[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22007] branches/soundsystem/source/ blender: Sound Branch:
Jörg Müller
nexyon at gmail.com
Wed Jul 29 10:02:51 CEST 2009
Revision: 22007
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22007
Author: nexyon
Date: 2009-07-29 10:02:50 +0200 (Wed, 29 Jul 2009)
Log Message:
-----------
Sound Branch:
Readded scrubbing.
Modified Paths:
--------------
branches/soundsystem/source/blender/blenkernel/BKE_sound.h
branches/soundsystem/source/blender/blenkernel/intern/sound.c
branches/soundsystem/source/blender/editors/animation/anim_ops.c
Modified: branches/soundsystem/source/blender/blenkernel/BKE_sound.h
===================================================================
--- branches/soundsystem/source/blender/blenkernel/BKE_sound.h 2009-07-29 04:53:10 UTC (rev 22006)
+++ branches/soundsystem/source/blender/blenkernel/BKE_sound.h 2009-07-29 08:02:50 UTC (rev 22007)
@@ -74,6 +74,8 @@
void sound_update_playing(struct bContext *C);
+void sound_scrub(struct bContext *C);
+
void sound_stop_all(struct bContext *C);
#endif
Modified: branches/soundsystem/source/blender/blenkernel/intern/sound.c
===================================================================
--- branches/soundsystem/source/blender/blenkernel/intern/sound.c 2009-07-29 04:53:10 UTC (rev 22006)
+++ branches/soundsystem/source/blender/blenkernel/intern/sound.c 2009-07-29 08:02:50 UTC (rev 22007)
@@ -14,6 +14,7 @@
#include "DNA_scene_types.h"
#include "DNA_sound_types.h"
#include "DNA_packedFile_types.h"
+#include "DNA_screen_types.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
@@ -481,3 +482,32 @@
AUD_unlock();
}
+
+void sound_scrub(struct bContext *C)
+{
+ SoundHandle *handle;
+ Scene* scene = CTX_data_scene(C);
+ int cfra = CFRA;
+ float fps = FPS;
+
+ if(scene->audio.flag & AUDIO_SCRUB && !CTX_wm_screen(C)->animtimer)
+ {
+ AUD_lock();
+
+ for(handle = scene->sound_handles.first; handle; handle = handle->next)
+ {
+ if(cfra >= handle->startframe && cfra < handle->endframe && !handle->mute)
+ {
+ if(handle->source && handle->source->snd_sound)
+ {
+ int frameskip = handle->frameskip + cfra - handle->startframe;
+ AUD_Sound* limiter = AUD_limitSound(handle->source->snd_sound, frameskip / fps, (frameskip + 1)/fps);
+ AUD_play(limiter, 0);
+ AUD_unload(limiter);
+ }
+ }
+ }
+
+ AUD_unlock();
+ }
+}
Modified: branches/soundsystem/source/blender/editors/animation/anim_ops.c
===================================================================
--- branches/soundsystem/source/blender/editors/animation/anim_ops.c 2009-07-29 04:53:10 UTC (rev 22006)
+++ branches/soundsystem/source/blender/editors/animation/anim_ops.c 2009-07-29 08:02:50 UTC (rev 22007)
@@ -57,7 +57,7 @@
#include "ED_screen.h"
// AUD_XXX
-//#include "BKE_sound.h"
+#include "BKE_sound.h"
/* ********************** frame change operator ***************************/
@@ -95,8 +95,7 @@
CFRA= cfra;
// AUD_XXX
-/* if(scene->audio.flag & AUDIO_SCRUB)
- seq_update_audio(C, CFRA);*/
+ sound_scrub(C);
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
}
More information about the Bf-blender-cvs
mailing list