summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Riedi <andrewriedi@gmail.com>2007-07-05 23:10:54 -0700
committerAndrew Riedi <andrewriedi@gmail.com>2007-07-05 23:10:54 -0700
commit555fa357fcf165484628e78e93b5e16e97a58496 (patch)
treeaeb26cd53b352abe9d5c59cae5b685eada8cfa8a
parent835c7d122f07df9a814d3b4de83a37eb8d6bcc41 (diff)
downloadsound-555fa357fcf165484628e78e93b5e16e97a58496.tar.gz
sound-555fa357fcf165484628e78e93b5e16e97a58496.tar.bz2
Add loading/unloading functions to PortAudio driver.
-rw-r--r--portaudio/plugin.info3
-rw-r--r--portaudio/sndportaudio.c (renamed from portaudio/portaudio.c)23
-rw-r--r--portaudio/sndportaudio.xml.in (renamed from portaudio/portaudio.xml.in)4
3 files changed, 26 insertions, 4 deletions
diff --git a/portaudio/plugin.info b/portaudio/plugin.info
index b50ca70..11d2e4d 100644
--- a/portaudio/plugin.info
+++ b/portaudio/plugin.info
@@ -1,2 +1,3 @@
-PLUGIN = portaudio
+PLUGIN = sndportaudio
+LDFLAGS_ADD = -lportaudio
CFLAGS_ADD = -I../include
diff --git a/portaudio/portaudio.c b/portaudio/sndportaudio.c
index 842172b..6d9796c 100644
--- a/portaudio/portaudio.c
+++ b/portaudio/sndportaudio.c
@@ -43,11 +43,32 @@ static void portaudioSoundPlay( int *buffer, int buffer_size )
static Bool portaudioDoInit( void )
{
+ int error;
+
+ error = Pa_Initialize();
+ if ( error != paNoError )
+ {
+ compLogMessage( NULL, "portaudio", CompLogLevelError,
+ "Failed to initialize PortAudio, error: %s",
+ Pa_GetErrorText( error ) );
+ return FALSE;
+ }
+
return TRUE;
}
static void portaudioDoFini( void )
{
+ int error;
+
+ error = Pa_Terminate();
+ if ( error != paNoError )
+ {
+ compLogMessage( NULL, "portaudio", CompLogLevelError,
+ "Failed to terminate PortAudio, error: %s",
+ Pa_GetErrorText( error ) );
+ return;
+ }
}
static void portaudioWrapFunctions( SoundDisplay *ad, CompDisplay *d )
@@ -171,7 +192,7 @@ static CompMetadata *portaudioGetMetadata( CompPlugin *plugin )
CompPluginVTable portaudioVTable =
{
- "portaudio",
+ "sndportaudio",
portaudioGetVersion,
portaudioGetMetadata,
portaudioInit,
diff --git a/portaudio/portaudio.xml.in b/portaudio/sndportaudio.xml.in
index 7187c67..dd0aac7 100644
--- a/portaudio/portaudio.xml.in
+++ b/portaudio/sndportaudio.xml.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<compiz>
- <!-- portaudio metadata -->
- <plugin name="portaudio">
+ <!-- sndportaudio metadata -->
+ <plugin name="sndportaudio">
<category>Sound</category>
<feature>sounddriver</feature>
<deps>