[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11708] branches/soc-2007-hcube/source/ blender/src/seqaudio.c: Scrubbing is implemented now.

Csaba Hruska csaba.hruska at gmail.com
Sun Aug 19 18:42:20 CEST 2007


Revision: 11708
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11708
Author:   hcube
Date:     2007-08-19 18:42:19 +0200 (Sun, 19 Aug 2007)

Log Message:
-----------
Scrubbing is implemented now.

Modified Paths:
--------------
    branches/soc-2007-hcube/source/blender/src/seqaudio.c

Modified: branches/soc-2007-hcube/source/blender/src/seqaudio.c
===================================================================
--- branches/soc-2007-hcube/source/blender/src/seqaudio.c	2007-08-19 16:24:52 UTC (rev 11707)
+++ branches/soc-2007-hcube/source/blender/src/seqaudio.c	2007-08-19 16:42:19 UTC (rev 11708)
@@ -103,7 +103,7 @@
 	*/
 }
 
-static void do_seqaudio_update( Sequence *seq )
+static void do_seqaudio_update( Sequence *seq, int doScrub )
 {
 /*
 		if(seq->startofs && seq->startstill) seq->startstill= 0;
@@ -120,7 +120,7 @@
 	{
 		if( seq->type == SEQ_META )
 		{
-			do_seqaudio_update( seq->seqbase.first );
+			do_seqaudio_update( seq->seqbase.first, doScrub );
 		}
 		
 		if( (seq->type == SEQ_RAM_SOUND) || (seq->type == SEQ_HD_SOUND) )
@@ -151,6 +151,16 @@
 						audio_sound_play( seq->sound );
 						audio_sound_setframeposition( seq->sound, (int)startPos );
 					}
+					else
+					{
+						// do scrubbing here
+						if( doScrub == TRUE )
+						{
+							float framePos = seq->startofs + CFRA - seq->startdisp;
+							framePos *= ((float)seq->sound->sample->rate) / ((float)G.scene->r.frs_sec);
+							audio_sound_setframeposition( seq->sound, (int)framePos );
+						}
+					}
 				}
 				else
 				{
@@ -176,7 +186,7 @@
 	{
 		return;
 	}
-	do_seqaudio_update( ed->seqbasep->first );
+	do_seqaudio_update( ed->seqbasep->first, FALSE );
 }
 
 int seqaudio_getframeposition(void)
@@ -196,6 +206,15 @@
 
 void seqaudio_setframeposition(int framePos)
 {
+	Editing *ed;
+	
+	assert( gSeqAudioState == SEQAUDIO_STOP || gSeqAudioState == SEQAUDIO_PLAY );
+	ed = G.scene->ed;
+	if( !audio_isinitialized() || !ed )
+	{
+		return;
+	}
+	do_seqaudio_update( ed->seqbasep->first, TRUE );
 }
 
 int seqaudio_mixdown(char *fileName, int sampleRate)





More information about the Bf-blender-cvs mailing list