[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11694] branches/soc-2007-hcube/source/ blender: Added soundsystem frame counter handling and a function to get samples low quality pcm data for drawing .

Csaba Hruska csaba.hruska at gmail.com
Sun Aug 19 12:48:38 CEST 2007


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

Log Message:
-----------
Added soundsystem frame counter handling and a function to get samples low quality pcm data for drawing.

Modified Paths:
--------------
    branches/soc-2007-hcube/source/blender/include/BAU_soundsystem.h
    branches/soc-2007-hcube/source/blender/src/soundsystem.c

Modified: branches/soc-2007-hcube/source/blender/include/BAU_soundsystem.h
===================================================================
--- branches/soc-2007-hcube/source/blender/include/BAU_soundsystem.h	2007-08-19 10:47:00 UTC (rev 11693)
+++ branches/soc-2007-hcube/source/blender/include/BAU_soundsystem.h	2007-08-19 10:48:38 UTC (rev 11694)
@@ -8,6 +8,8 @@
 int     audio_isinitialized(void);
 void    audio_finalize(void);
 int     audio_getmixrate(void);
+int     audio_getglobalframecounter(void);
+void    audio_clearglobalframecounter(void);
 	
 // bSample functions
 struct bSample* audio_sample_new(char *name);
@@ -15,6 +17,9 @@
 int             audio_sample_load(struct bSample* sample);
 void            audio_sample_unload(struct bSample* sample);
 
+// pcm data parameters:  4000KHz and 4 bit, it is just visual purpuses
+short*          audio_sample_getvisualpcmdata(struct bSample *sample, int channelIdx);
+
 // bSound functions
 // hint: a bSound->sample cant be NULL, always have to be a valid pointer
 struct bSound*  audio_sound_new(char *name);

Modified: branches/soc-2007-hcube/source/blender/src/soundsystem.c
===================================================================
--- branches/soc-2007-hcube/source/blender/src/soundsystem.c	2007-08-19 10:47:00 UTC (rev 11693)
+++ branches/soc-2007-hcube/source/blender/src/soundsystem.c	2007-08-19 10:48:38 UTC (rev 11694)
@@ -100,6 +100,16 @@
 	return SND_GetMixRate();
 }
 
+int audio_getglobalframecounter(void)
+{
+	return SND_GetGlobalFrameCounter();
+}
+
+void audio_clearglobalframecounter(void)
+{
+	SND_ClearGlobalFrameCounter();
+}
+
 struct bSample*	audio_sample_new( char *name )
 {
 	bSample *sample = NULL;
@@ -300,6 +310,15 @@
 	sample->type = SAMPLE_UNKNOWN;
 }
 
+// pcm data parameters:  4000KHz and 4 bit, it is just visual purpuses
+short* audio_sample_getvisualpcmdata( struct bSample *sample, int channelIdx )
+{
+	assert( sample != NULL );
+	assert( sample->snd_sample != NULL );
+
+	return SND_GetVisualPCMData( (SND_SoundIHandle)sample->snd_sample, channelIdx );
+}
+
 struct bSound* audio_sound_new( char *name )
 {
 	bSound *sound = NULL;





More information about the Bf-blender-cvs mailing list