[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11718] branches/soc-2007-hcube/source/ blender: Removed frame counter related function, moved to seqaudio' s internal implementation.
Csaba Hruska
csaba.hruska at gmail.com
Mon Aug 20 01:02:24 CEST 2007
Revision: 11718
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11718
Author: hcube
Date: 2007-08-20 01:02:22 +0200 (Mon, 20 Aug 2007)
Log Message:
-----------
Removed frame counter related function, moved to seqaudio's internal implementation. added sound gain, pan, mute handling API.
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 22:59:59 UTC (rev 11717)
+++ branches/soc-2007-hcube/source/blender/include/BAU_soundsystem.h 2007-08-19 23:02:22 UTC (rev 11718)
@@ -10,8 +10,6 @@
int audio_isinitialized(void);
void audio_finalize(void);
int audio_getmixrate(void);
-int audio_getglobalframecounter(void);
-void audio_clearglobalframecounter(void);
void audio_setcallback(audio_callbackfunction *callbackFunction, void *userData1, void *userData2);
// file functions, used for mixdown
@@ -43,6 +41,17 @@
int audio_sound_getframeposition(struct bSound *sound);
void audio_sound_setframeposition(struct bSound *sound, int framePos);
+// sound attributes
+float audio_sound_getgain(struct bSound *sound);
+void audio_sound_setgain(struct bSound *sound, float gain);
+
+float audio_sound_getpan(struct bSound *sound);
+void audio_sound_setpan(struct bSound *sound, float pan);
+
+int audio_sound_ismuted(struct bSound *sound);
+void audio_sound_setmute(struct bSound *sound, int mute);
+
+// global sound functions
void audio_sound_stopall(void);
void audio_sound_loadall(void);
Modified: branches/soc-2007-hcube/source/blender/src/soundsystem.c
===================================================================
--- branches/soc-2007-hcube/source/blender/src/soundsystem.c 2007-08-19 22:59:59 UTC (rev 11717)
+++ branches/soc-2007-hcube/source/blender/src/soundsystem.c 2007-08-19 23:02:22 UTC (rev 11718)
@@ -100,16 +100,6 @@
return SND_GetMixRate();
}
-int audio_getglobalframecounter(void)
-{
- return SND_GetGlobalFrameCounter();
-}
-
-void audio_clearglobalframecounter(void)
-{
- SND_ClearGlobalFrameCounter();
-}
-
void audio_setcallback( audio_callbackfunction *callbackFunction, void *userData1, void *userData2 )
{
SND_SetCallback( callbackFunction, userData1, userData2 );
@@ -117,17 +107,17 @@
int audio_file_openforwrite( char *name, int sampleRate )
{
- return SND_OpenFileForWrite( name, sampleRate );
+ return SND_FileOpenForWrite( name, sampleRate );
}
void audio_file_writeframes(int framesNum)
{
- SND_WriteFramesToFile( framesNum );
+ SND_FileWriteFrames( framesNum );
}
void audio_file_close(void)
{
- SND_CloseFile();
+ SND_FileClose();
}
struct bSample* audio_sample_new( char *name )
@@ -224,7 +214,7 @@
return TRUE;
}
- sndHandle = SND_NewSound( sample->name );
+ sndHandle = SND_SoundNew( sample->name );
if( sndHandle == NULL )
{
return FALSE;
@@ -233,7 +223,7 @@
sample->type = SAMPLE_WAV;
// fill sample info fields
- SND_GetSoundInfo( sndHandle, &sndInfo );
+ SND_SoundGetInfo( sndHandle, &sndInfo );
sample->len = sndInfo.framesNum;
sample->channels = sndInfo.channelsNum;
sample->bits = sndInfo.bitRate;
@@ -325,7 +315,7 @@
return;
}
- SND_DeleteSound( (SND_SoundIHandle)sample->snd_sample );
+ SND_SoundDelete( (SND_SoundIHandle)sample->snd_sample );
sample->snd_sample = NULL;
sample->type = SAMPLE_UNKNOWN;
}
@@ -336,7 +326,7 @@
assert( sample != NULL );
assert( sample->snd_sample != NULL );
- return SND_GetVisualPCMData( (SND_SoundIHandle)sample->snd_sample, channelIdx );
+ return SND_SoundGetVisualPCMData( (SND_SoundIHandle)sample->snd_sample, channelIdx );
}
struct bSound* audio_sound_new( char *name )
@@ -489,7 +479,7 @@
assert( sound->sample != NULL );
assert( sound->sample->snd_sample != NULL );
- return SND_IsPlayingSound( (SND_SoundIHandle)sound->sample->snd_sample );
+ return SND_SoundIsPlaying( (SND_SoundIHandle)sound->sample->snd_sample );
}
void audio_sound_play(struct bSound *sound)
@@ -498,7 +488,7 @@
assert( sound->sample != NULL );
assert( sound->sample->snd_sample != NULL );
- SND_PlaySound( (SND_SoundIHandle)sound->sample->snd_sample );
+ SND_SoundPlay( (SND_SoundIHandle)sound->sample->snd_sample );
}
void audio_sound_stop(struct bSound *sound)
@@ -507,7 +497,7 @@
assert( sound->sample != NULL );
assert( sound->sample->snd_sample != NULL );
- SND_StopSound( (SND_SoundIHandle)sound->sample->snd_sample );
+ SND_SoundStop( (SND_SoundIHandle)sound->sample->snd_sample );
}
int audio_sound_getframeposition(struct bSound *sound)
@@ -516,7 +506,7 @@
assert( sound->sample != NULL );
assert( sound->sample->snd_sample != NULL );
- return SND_GetSoundFramePos( (SND_SoundIHandle)sound->sample->snd_sample );
+ return SND_SoundGetFramePos( (SND_SoundIHandle)sound->sample->snd_sample );
}
void audio_sound_setframeposition(struct bSound *sound, int framePos)
@@ -525,11 +515,65 @@
assert( sound->sample != NULL );
assert( sound->sample->snd_sample != NULL );
- SND_SeekSound( (SND_SoundIHandle)sound->sample->snd_sample, framePos );
+ SND_SoundSeek( (SND_SoundIHandle)sound->sample->snd_sample, framePos );
}
+float audio_sound_getgain(struct bSound *sound)
+{
+ assert( sound != NULL );
+ assert( sound->sample != NULL );
+ assert( sound->sample->snd_sample != NULL );
+
+ return SND_SoundGetGain( (SND_SoundIHandle)sound->sample->snd_sample );
+}
+
+void audio_sound_setgain(struct bSound *sound, float gain)
+{
+ assert( sound != NULL );
+ assert( sound->sample != NULL );
+ assert( sound->sample->snd_sample != NULL );
+
+ SND_SoundSetGain( (SND_SoundIHandle)sound->sample->snd_sample, gain );
+}
+
+float audio_sound_getpan(struct bSound *sound)
+{
+ assert( sound != NULL );
+ assert( sound->sample != NULL );
+ assert( sound->sample->snd_sample != NULL );
+
+ return SND_SoundGetPan( (SND_SoundIHandle)sound->sample->snd_sample );
+}
+
+void audio_sound_setpan(struct bSound *sound, float pan)
+{
+ assert( sound != NULL );
+ assert( sound->sample != NULL );
+ assert( sound->sample->snd_sample != NULL );
+
+ SND_SoundSetPan( (SND_SoundIHandle)sound->sample->snd_sample, pan );
+}
+
+int audio_sound_ismuted(struct bSound *sound)
+{
+ assert( sound != NULL );
+ assert( sound->sample != NULL );
+ assert( sound->sample->snd_sample != NULL );
+
+ return SND_SoundIsMuted( (SND_SoundIHandle)sound->sample->snd_sample );
+}
+
+void audio_sound_setmute(struct bSound *sound, int mute)
+{
+ assert( sound != NULL );
+ assert( sound->sample != NULL );
+ assert( sound->sample->snd_sample != NULL );
+
+ SND_SoundSetMute( (SND_SoundIHandle)sound->sample->snd_sample, mute );
+}
+
void audio_sound_stopall(void)
{
- SND_StopAllSounds();
+ SND_SoundStopAll();
}
More information about the Bf-blender-cvs
mailing list