summaryrefslogtreecommitdiff
path: root/portaudio/sndportaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'portaudio/sndportaudio.c')
-rw-r--r--portaudio/sndportaudio.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/portaudio/sndportaudio.c b/portaudio/sndportaudio.c
index 6d9796c..605046f 100644
--- a/portaudio/sndportaudio.c
+++ b/portaudio/sndportaudio.c
@@ -27,6 +27,11 @@ static CompMetadata portaudioMetadata;
static int displayPrivateIndex;
static int soundDisplayPrivateIndex;
+typedef struct _PulseAudioInfo {
+} PulseAudioInfo;
+
+static PulseAudioInfo pulseaudioData;
+
#define GET_PORTAUDIO_DISPLAY(d) \
((SoundDisplay *) (d)->privates[soundDisplayPrivateIndex].ptr)
@@ -41,9 +46,17 @@ static void portaudioSoundPlay( int *buffer, int buffer_size )
{
}
+static int pulseaudioCallback( void *input, void *output,
+ unsigned long framesPerBuffer,
+ PaTimestamp outTime, void *data )
+{
+ return 0;
+}
+
static Bool portaudioDoInit( void )
{
- int error;
+ PaStream *stream;
+ PaError error;
error = Pa_Initialize();
if ( error != paNoError )
@@ -54,12 +67,22 @@ static Bool portaudioDoInit( void )
return FALSE;
}
+ error = Pa_OpenDefaultStream( stream, 0, 2, paFloat32, 44100, 256, 1,
+ pulseaudioCallback, &pulseaudioData );
+ if ( error != paNoError )
+ {
+ compLogMessage( NULL, "portaudio", CompLogLevelError,
+ "Failed to open a default stream, error: %s",
+ Pa_GetErrorText( error ) );
+ return FALSE;
+ }
+
return TRUE;
}
static void portaudioDoFini( void )
{
- int error;
+ PaError error;
error = Pa_Terminate();
if ( error != paNoError )
@@ -192,7 +215,7 @@ static CompMetadata *portaudioGetMetadata( CompPlugin *plugin )
CompPluginVTable portaudioVTable =
{
- "sndportaudio",
+ "portaudio",
portaudioGetVersion,
portaudioGetMetadata,
portaudioInit,