/[rdesktop]/jpeg/rdesktop/trunk/rdpsnd_libao.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /jpeg/rdesktop/trunk/rdpsnd_libao.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1254 by stargo, Sun Sep 17 10:32:18 2006 UTC revision 1255 by stargo, Sun Sep 17 11:04:50 2006 UTC
# Line 36  static int samplerate; Line 36  static int samplerate;
36  static int audiochannels;  static int audiochannels;
37  static BOOL reopened;  static BOOL reopened;
38  static short samplewidth;  static short samplewidth;
39    static char *libao_device = NULL;
40    
41  BOOL  BOOL
42  wave_out_open(void)  libao_open(void)
43  {  {
44          ao_sample_format format;          ao_sample_format format;
45            static int warned = 0;
46    
47            if (!warned && libao_device)
48            {
49                    warning("device-options not supported for libao-driver\n");
50                    warned = 1;
51            }
52    
53          ao_initialize();          ao_initialize();
54          default_driver = ao_default_driver_id();          default_driver = ao_default_driver_id();
# Line 67  wave_out_open(void) Line 75  wave_out_open(void)
75  }  }
76    
77  void  void
78  wave_out_close(void)  libao_close(void)
79  {  {
80          /* Ack all remaining packets */          /* Ack all remaining packets */
81          while (!rdpsnd_queue_empty())          while (!rdpsnd_queue_empty())
# Line 84  wave_out_close(void) Line 92  wave_out_close(void)
92  }  }
93    
94  BOOL  BOOL
95  wave_out_format_supported(WAVEFORMATEX * pwfx)  libao_format_supported(WAVEFORMATEX * pwfx)
96  {  {
97          if (pwfx->wFormatTag != WAVE_FORMAT_PCM)          if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
98                  return False;                  return False;
# Line 101  wave_out_format_supported(WAVEFORMATEX * Line 109  wave_out_format_supported(WAVEFORMATEX *
109  }  }
110    
111  BOOL  BOOL
112  wave_out_set_format(WAVEFORMATEX * pwfx)  libao_set_format(WAVEFORMATEX * pwfx)
113  {  {
114          ao_sample_format format;          ao_sample_format format;
115    
# Line 129  wave_out_set_format(WAVEFORMATEX * pwfx) Line 137  wave_out_set_format(WAVEFORMATEX * pwfx)
137  }  }
138    
139  void  void
140  wave_out_volume(uint16 left, uint16 right)  libao_volume(uint16 left, uint16 right)
141  {  {
142          warning("volume changes not supported with libao-output\n");          warning("volume changes not supported with libao-output\n");
143  }  }
144    
145  void  void
146  wave_out_play(void)  libao_play(void)
147  {  {
148          struct audio_packet *packet;          struct audio_packet *packet;
149          STREAM out;          STREAM out;
# Line 225  wave_out_play(void) Line 233  wave_out_play(void)
233          g_dsp_busy = 1;          g_dsp_busy = 1;
234          return;          return;
235  }  }
236    
237    static struct audio_driver libao_driver = {
238          wave_out_write:rdpsnd_queue_write,
239          wave_out_open:libao_open,
240          wave_out_close:libao_close,
241          wave_out_format_supported:libao_format_supported,
242          wave_out_set_format:libao_set_format,
243          wave_out_volume:libao_volume,
244          wave_out_play:libao_play,
245          name:"libao",
246          description:"libao output driver",
247          next:NULL,
248    };
249    
250    struct audio_driver *
251    libao_register(char *options)
252    {
253            if (options)
254            {
255                    libao_device = xstrdup(options);
256            }
257    
258            return &libao_driver;
259    }

Legend:
Removed from v.1254  
changed lines
  Added in v.1255

  ViewVC Help
Powered by ViewVC 1.1.26