/[rdesktop]/sourceforge.net/trunk/rdesktop/rdpsnd_sgi.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_sgi.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 35  static BOOL g_swapaudio; Line 35  static BOOL g_swapaudio;
35  static int g_snd_rate;  static int g_snd_rate;
36  static BOOL g_swapaudio;  static BOOL g_swapaudio;
37  static int width = AL_SAMPLE_16;  static int width = AL_SAMPLE_16;
38    static char *sgi_output_device = NULL;
39    
40  double min_volume, max_volume, volume_range;  double min_volume, max_volume, volume_range;
41  int resource, maxFillable;  int resource, maxFillable;
42  int combinedFrameSize;  int combinedFrameSize;
43    
44  BOOL  BOOL
45  wave_out_open(void)  sgi_open(void)
46  {  {
47          ALparamInfo pinfo;          ALparamInfo pinfo;
48            static int warned = 0;
49    
50  #if (defined(IRIX_DEBUG))  #if (defined(IRIX_DEBUG))
51          fprintf(stderr, "sgi_open: begin\n");          fprintf(stderr, "sgi_open: begin\n");
52  #endif  #endif
53    
54            if (!warned && sgi_output_device)
55            {
56                    warning("device-options not supported for libao-driver\n");
57                    warned = 1;
58            }
59    
60          if (alGetParamInfo(AL_DEFAULT_OUTPUT, AL_GAIN, &pinfo) < 0)          if (alGetParamInfo(AL_DEFAULT_OUTPUT, AL_GAIN, &pinfo) < 0)
61          {          {
62                  fprintf(stderr, "sgi_open: alGetParamInfo failed: %s\n",                  fprintf(stderr, "sgi_open: alGetParamInfo failed: %s\n",
# Line 85  wave_out_open(void) Line 93  wave_out_open(void)
93  }  }
94    
95  void  void
96  wave_out_close(void)  sgi_close(void)
97  {  {
98          /* Ack all remaining packets */          /* Ack all remaining packets */
99  #if (defined(IRIX_DEBUG))  #if (defined(IRIX_DEBUG))
# Line 110  wave_out_close(void) Line 118  wave_out_close(void)
118  }  }
119    
120  BOOL  BOOL
121  wave_out_format_supported(WAVEFORMATEX * pwfx)  sgi_format_supported(WAVEFORMATEX * pwfx)
122  {  {
123          if (pwfx->wFormatTag != WAVE_FORMAT_PCM)          if (pwfx->wFormatTag != WAVE_FORMAT_PCM)
124                  return False;                  return False;
# Line 123  wave_out_format_supported(WAVEFORMATEX * Line 131  wave_out_format_supported(WAVEFORMATEX *
131  }  }
132    
133  BOOL  BOOL
134  wave_out_set_format(WAVEFORMATEX * pwfx)  sgi_set_format(WAVEFORMATEX * pwfx)
135  {  {
136          int channels;          int channels;
137          int frameSize, channelCount;          int frameSize, channelCount;
# Line 207  wave_out_set_format(WAVEFORMATEX * pwfx) Line 215  wave_out_set_format(WAVEFORMATEX * pwfx)
215  }  }
216    
217  void  void
218  wave_out_volume(uint16 left, uint16 right)  sgi_volume(uint16 left, uint16 right)
219  {  {
220          double gainleft, gainright;          double gainleft, gainright;
221          ALpv pv[1];          ALpv pv[1];
# Line 240  wave_out_volume(uint16 left, uint16 righ Line 248  wave_out_volume(uint16 left, uint16 righ
248  }  }
249    
250  void  void
251  wave_out_play(void)  sgi_play(void)
252  {  {
253          struct audio_packet *packet;          struct audio_packet *packet;
254          ssize_t len;          ssize_t len;
# Line 299  wave_out_play(void) Line 307  wave_out_play(void)
307                  }                  }
308          }          }
309  }  }
310    
311    static struct audio_driver sgi_driver = {
312          wave_out_write:rdpsnd_queue_write,
313          wave_out_open:sgi_open,
314          wave_out_close:sgi_close,
315          wave_out_format_supported:sgi_format_supported,
316          wave_out_set_format:sgi_set_format,
317          wave_out_volume:sgi_volume,
318          wave_out_play:sgi_play,
319          name:"sgi",
320          description:"SGI output driver",
321          next:NULL,
322    };
323    
324    struct audio_driver *
325    sgi_register(char *options)
326    {
327            if (options)
328            {
329                    sgi_output_device = xstrdup(options);
330            }
331            return &sgi_driver;
332    }

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

  ViewVC Help
Powered by ViewVC 1.1.26