[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11623] branches/soc-2007-hcube/source/ blender/src/seqaudio.c: Added sound strip support: start/end offset
Csaba Hruska
csaba.hruska at gmail.com
Thu Aug 16 11:42:22 CEST 2007
Revision: 11623
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11623
Author: hcube
Date: 2007-08-16 11:42:22 +0200 (Thu, 16 Aug 2007)
Log Message:
-----------
Added sound strip support: start/end offset
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-16 07:41:48 UTC (rev 11622)
+++ branches/soc-2007-hcube/source/blender/src/seqaudio.c 2007-08-16 09:42:22 UTC (rev 11623)
@@ -99,6 +99,17 @@
static void do_seqaudio_update( Sequence *seq )
{
+/*
+ if(seq->startofs && seq->startstill) seq->startstill= 0;
+ if(seq->endofs && seq->endstill) seq->endstill= 0;
+
+ seq->startdisp= seq->start + seq->startofs - seq->startstill;
+ seq->enddisp= seq->start+seq->len - seq->endofs + seq->endstill;
+
+int audio_sound_getframeposition(struct bSound *sound);
+void audio_sound_setframeposition(struct bSound *sound, int framePos);
+*/
+
while( seq )
{
if( seq->type == SEQ_META )
@@ -111,6 +122,9 @@
assert( seq->sound != 0 );
/*
+ !!! Obsolete: Sequence->curpos
+
+ //int curpos; // last sample position in audio_fill()
seq->curpos = (int)( (((float) ((float)startframe -(float)seq->start) / (float)G.scene->r.frs_sec) * ((float)G.scene->audio.mixrate) * 4 ));
*/
//only Play/Stop
@@ -125,7 +139,11 @@
if( !audio_sound_isplaying( seq->sound ) )
{
// start sound
+ float startPos = seq->startofs;
+ startPos *= ((float)seq->sound->sample->rate) / ((float)G.scene->r.frs_sec);
+
audio_sound_play( seq->sound );
+ audio_sound_setframeposition( seq->sound, (int)startPos );
}
}
else
More information about the Bf-blender-cvs
mailing list