1 |
/* -*- c-basic-offset: 8 -*- |
/* -*- c-basic-offset: 8 -*- |
2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
Sound Channel Process Functions - Sun |
Sound Channel Process Functions - Sun |
4 |
Copyright (C) Matthew Chapman 2003 |
Copyright (C) Matthew Chapman 2003-2007 |
5 |
Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003 |
Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003 |
6 |
Copyright (C) Michael Gernoth mike@zerfleddert.de 2003-2006 |
Copyright (C) Michael Gernoth mike@zerfleddert.de 2003-2007 |
7 |
|
|
8 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
9 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
35 |
#define DEFAULTDEVICE "/dev/audio" |
#define DEFAULTDEVICE "/dev/audio" |
36 |
|
|
37 |
static int dsp_fd = -1; |
static int dsp_fd = -1; |
38 |
static BOOL dsp_busy; |
static RD_BOOL dsp_busy; |
39 |
|
|
40 |
static BOOL g_reopened; |
static RD_BOOL g_reopened; |
41 |
static short g_samplewidth; |
static short g_samplewidth; |
42 |
static char *dsp_dev; |
static char *dsp_dev; |
43 |
|
|
64 |
sun_play(); |
sun_play(); |
65 |
} |
} |
66 |
|
|
67 |
BOOL |
RD_BOOL |
68 |
sun_open(void) |
sun_open(void) |
69 |
{ |
{ |
70 |
if ((dsp_fd = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1) |
if ((dsp_fd = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1) |
99 |
dsp_fd = -1; |
dsp_fd = -1; |
100 |
} |
} |
101 |
|
|
102 |
BOOL |
RD_BOOL |
103 |
sun_format_supported(WAVEFORMATEX * pwfx) |
sun_format_supported(RD_WAVEFORMATEX * pwfx) |
104 |
{ |
{ |
105 |
if (pwfx->wFormatTag != WAVE_FORMAT_PCM) |
if (pwfx->wFormatTag != WAVE_FORMAT_PCM) |
106 |
return False; |
return False; |
112 |
return True; |
return True; |
113 |
} |
} |
114 |
|
|
115 |
BOOL |
RD_BOOL |
116 |
sun_set_format(WAVEFORMATEX * pwfx) |
sun_set_format(RD_WAVEFORMATEX * pwfx) |
117 |
{ |
{ |
118 |
audio_info_t info; |
audio_info_t info; |
119 |
|
|
199 |
ssize_t len; |
ssize_t len; |
200 |
unsigned int i; |
unsigned int i; |
201 |
STREAM out; |
STREAM out; |
202 |
static BOOL sentcompletion = True; |
static RD_BOOL sentcompletion = True; |
203 |
static uint32 samplecnt = 0; |
static uint32 samplecnt = 0; |
204 |
static uint32 numsamples; |
static uint32 numsamples; |
205 |
|
|