diff libao2/ao_sgi.c @ 3095:981a9e5118ce

interface to libao2 changed ao_plugin added
author anders
date Sat, 24 Nov 2001 05:21:22 +0000
parents a56bf9c0e76f
children 12b1790038b0
line wrap: on
line diff
--- a/libao2/ao_sgi.c	Sat Nov 24 02:05:06 2001 +0000
+++ b/libao2/ao_sgi.c	Sat Nov 24 05:21:22 2001 +0000
@@ -22,13 +22,6 @@
 
 LIBAO_EXTERN(sgi)
 
-// there are some globals:
-// ao_samplerate
-// ao_channels
-// ao_format
-// ao_bps
-// ao_outburst
-// ao_buffersize
 
 static ALconfig	ao_config;
 static ALport	ao_port;
@@ -86,9 +79,9 @@
 
   }
   
-  ao_buffersize=131072;
-  ao_outburst = ao_buffersize/16;
-  ao_channels = channels;
+  ao_data.buffersize=131072;
+  ao_data.outburst = ao_data.buffersize/16;
+  ao_data.channels = channels;
   
   ao_config = alNewConfig();
   
@@ -164,7 +157,7 @@
   // printf("ao_sgi, get_space: (ao_outburst %d)\n", ao_outburst);
   // printf("ao_sgi, get_space: alGetFillable [%d] \n", alGetFillable(ao_port));
   
-  return alGetFillable(ao_port)*(2*ao_channels);
+  return alGetFillable(ao_port)*(2*ao_data.channels);
     
 }
 
@@ -177,14 +170,14 @@
   // printf("ao_sgi, play: len %d flags %d (%d %d)\n", len, flags, ao_port, ao_config);
   // printf("channels %d\n", ao_channels);
 
-  alWriteFrames(ao_port, data, len/(2*ao_channels));
+  alWriteFrames(ao_port, data, len/(2*ao_data.channels));
   
   return len;
   
 }
 
-// return: how many unplayed bytes are in the buffer
-static int get_delay(){
+// return: delay in seconds between first and last sample in buffer
+static float get_delay(){
   
   // printf("ao_sgi, get_delay: (ao_buffersize %d)\n", ao_buffersize);