/[rdesktop]/sourceforge.net/trunk/rdesktop/rdpsnd_sun.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 /sourceforge.net/trunk/rdesktop/rdpsnd_sun.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 37  Line 37 
37  static BOOL g_reopened;  static BOOL g_reopened;
38  static BOOL g_swapaudio;  static BOOL g_swapaudio;
39  static short g_samplewidth;  static short g_samplewidth;
40    static char *dsp_dev;
41    
42  BOOL  BOOL
43  wave_out_open(void)  sun_open(void)
44  {  {
         char *dsp_dev = getenv("AUDIODEV");  
   
         if (dsp_dev == NULL)  
         {  
                 dsp_dev = xstrdup(DEFAULTDEVICE);  
         }  
   
45          if ((g_dsp_fd = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1)          if ((g_dsp_fd = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1)
46          {          {
47                  perror(dsp_dev);                  perror(dsp_dev);
# Line 64  wave_out_open(void) Line 58  wave_out_open(void)
58  }  }
59    
60  void  void
61  wave_out_close(void)  sun_close(void)
62  {  {
63          /* Ack all remaining packets */          /* Ack all remaining packets */
64          while (!rdpsnd_queue_empty())          while (!rdpsnd_queue_empty())
# Line 85  wave_out_close(void) Line 79  wave_out_close(void)
79  }  }
80    
81  BOOL  BOOL
82  wave_out_format_supported(WAVEFORMATEX * pwfx)  sun_format_supported(WAVEFORMATEX * pwfx)
83  {  {
84          if (pwfx->wFormatTag != WAVE_FORMAT_PCM)          if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
85                  return False;                  return False;
# Line 98  wave_out_format_supported(WAVEFORMATEX * Line 92  wave_out_format_supported(WAVEFORMATEX *
92  }  }
93    
94  BOOL  BOOL
95  wave_out_set_format(WAVEFORMATEX * pwfx)  sun_set_format(WAVEFORMATEX * pwfx)
96  {  {
97          audio_info_t info;          audio_info_t info;
98    
# Line 152  wave_out_set_format(WAVEFORMATEX * pwfx) Line 146  wave_out_set_format(WAVEFORMATEX * pwfx)
146  }  }
147    
148  void  void
149  wave_out_volume(uint16 left, uint16 right)  sun_volume(uint16 left, uint16 right)
150  {  {
151          audio_info_t info;          audio_info_t info;
152          uint balance;          uint balance;
# Line 184  wave_out_volume(uint16 left, uint16 righ Line 178  wave_out_volume(uint16 left, uint16 righ
178  }  }
179    
180  void  void
181  wave_out_play(void)  sun_play(void)
182  {  {
183          struct audio_packet *packet;          struct audio_packet *packet;
184          audio_info_t info;          audio_info_t info;
# Line 277  wave_out_play(void) Line 271  wave_out_play(void)
271                  }                  }
272          }          }
273  }  }
274    
275    static struct audio_driver sun_driver = {
276          wave_out_write:rdpsnd_queue_write,
277          wave_out_open:sun_open,
278          wave_out_close:sun_close,
279          wave_out_format_supported:sun_format_supported,
280          wave_out_set_format:sun_set_format,
281          wave_out_volume:sun_volume,
282          wave_out_play:sun_play,
283          name:"sun",
284          description:"SUN/BSD output driver, default device: " DEFAULTDEVICE " or $AUDIODEV",
285          next:NULL,
286    };
287    
288    struct audio_driver *
289    sun_register(char *options)
290    {
291            if (options)
292            {
293                    dsp_dev = xstrdup(options);
294            }
295            else
296            {
297                    dsp_dev = getenv("AUDIODEV");
298    
299                    if (dsp_dev == NULL)
300                    {
301                            dsp_dev = xstrdup(DEFAULTDEVICE);
302                    }
303            }
304    
305            return &sun_driver;
306    }

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

  ViewVC Help
Powered by ViewVC 1.1.26