Line
Link Here
|
0 |
-- ./configure.ac |
0 |
++ ./configure.ac |
Lines 21-29
Link Here
|
21 |
|
21 |
|
22 |
dnl Checks what version of Unix we have and soundcard support |
22 |
dnl Checks what version of Unix we have and soundcard support |
23 |
AC_CHECK_HEADERS(sys/ioctl.h linux/soundcard.h machine/soundcard.h \ |
23 |
AC_CHECK_HEADERS(sys/ioctl.h linux/soundcard.h machine/soundcard.h \ |
24 |
soundcard.h sys/audio.h sun/audioio.h sun/dbriio.h sys/audioio.h \ |
24 |
sys/soundcard.h soundcard.h sys/audio.h sun/audioio.h sun/dbriio.h sys/audioio.h \ |
25 |
audio.h dmedia/audio.h) |
25 |
audio.h dmedia/audio.h) |
26 |
|
26 |
|
|
|
27 |
AC_ARG_WITH(alsa,[ --with-alsa Use ALSA library for sound],[WANT_ALSA=$withval],[WANT_ALSA=no]) |
28 |
|
27 |
AH_TOP( |
29 |
AH_TOP( |
28 |
[/* Define supported audio driver */ |
30 |
[/* Define supported audio driver */ |
29 |
#undef HAVE_HARDSID |
31 |
#undef HAVE_HARDSID |
Lines 60-68
Link Here
|
60 |
AC_MSG_RESULT(irix) |
62 |
AC_MSG_RESULT(irix) |
61 |
AC_CHECK_LIB(audio, main, [AUDIO_LDADD=-laudio AC_SUBST(AUDIO_LDADD)]) |
63 |
AC_CHECK_LIB(audio, main, [AUDIO_LDADD=-laudio AC_SUBST(AUDIO_LDADD)]) |
62 |
;; |
64 |
;; |
63 |
*linux*) AC_DEFINE(HAVE_OSS) |
65 |
*linux*) |
64 |
audiodrv_libadd="./audio/oss/liboss.a" |
66 |
if test "$WANT_ALSA" = "yes" ; then |
65 |
AC_MSG_RESULT(oss) |
67 |
AC_DEFINE(HAVE_ALSA) |
|
|
68 |
audiodrv_libadd="./audio/alsa/libalsa.a" |
69 |
AC_MSG_RESULT(alsa) |
70 |
AC_CHECK_LIB(asound, main, [AUDIO_LDFLAGS=-lasound AC_SUBST(AUDIO_LDFLAGS)]) |
71 |
else |
72 |
AC_DEFINE(HAVE_OSS) |
73 |
audiodrv_libadd="./audio/oss/liboss.a" |
74 |
AC_MSG_RESULT(oss) |
75 |
fi |
66 |
;; |
76 |
;; |
67 |
*netbsd*) AC_DEFINE(HAVE_OSS) |
77 |
*netbsd*) AC_DEFINE(HAVE_OSS) |
68 |
audiodrv_libadd="./audio/oss/liboss.a" |
78 |
audiodrv_libadd="./audio/oss/liboss.a" |
69 |
-- sidplay-2.0.9.orig/src/args.cpp |
79 |
++ sidplay-2.0.9/src/args.cpp |
Lines 93-99
Link Here
|
93 |
|
93 |
|
94 |
|
94 |
|
95 |
// Convert time from integer |
95 |
// Convert time from integer |
96 |
bool ConsolePlayer::parseTime (const char *str, uint_least32_t &time) |
96 |
bool ConsolePlayer::parseTime (char *str, uint_least32_t &time) |
97 |
{ |
97 |
{ |
98 |
char *sep; |
98 |
char *sep; |
99 |
uint_least32_t _time; |
99 |
uint_least32_t _time; |
Lines 126-132
Link Here
|
126 |
} |
126 |
} |
127 |
|
127 |
|
128 |
// Parse command line arguments |
128 |
// Parse command line arguments |
129 |
int ConsolePlayer::args (int argc, const char *argv[]) |
129 |
int ConsolePlayer::args (int argc, char *argv[]) |
130 |
{ |
130 |
{ |
131 |
int infile = 0; |
131 |
int infile = 0; |
132 |
int i = 0; |
132 |
int i = 0; |
133 |
-- sidplay-2.0.9.orig/src/audio/alsa/audiodrv.cpp |
133 |
++ sidplay-2.0.9/src/audio/alsa/audiodrv.cpp |
Lines 3-8
Link Here
|
3 |
// -------------------------------------------------------------------------- |
3 |
// -------------------------------------------------------------------------- |
4 |
/*************************************************************************** |
4 |
/*************************************************************************** |
5 |
* $Log: audiodrv.cpp,v $ |
5 |
* $Log: audiodrv.cpp,v $ |
|
|
6 |
* Revision 1.8 2008/07/19 13:58:04 wnd |
7 |
* Almost complete rewrite to support new ALSA API. |
8 |
* |
6 |
* Revision 1.7 2002/03/04 19:07:48 s_a_white |
9 |
* Revision 1.7 2002/03/04 19:07:48 s_a_white |
7 |
* Fix C++ use of nothrow. |
10 |
* Fix C++ use of nothrow. |
8 |
* |
11 |
* |
Lines 29-199
Link Here
|
29 |
***************************************************************************/ |
32 |
***************************************************************************/ |
30 |
|
33 |
|
31 |
#include "audiodrv.h" |
34 |
#include "audiodrv.h" |
32 |
#ifdef HAVE_ALSA |
35 |
#ifdef HAVE_ALSA |
33 |
|
36 |
|
34 |
#include <stdio.h> |
37 |
#include <stdio.h> |
35 |
#ifdef HAVE_EXCEPTIONS |
38 |
#ifdef HAVE_EXCEPTIONS |
36 |
# include <new> |
39 |
#include <new> |
37 |
#endif |
40 |
#endif |
38 |
|
41 |
|
|
|
42 |
#include <alsa/asoundlib.h> |
43 |
#include <string.h> |
44 |
|
45 |
#define ALSA_DEFAULT "default" |
46 |
|
39 |
Audio_ALSA::Audio_ALSA() |
47 |
Audio_ALSA::Audio_ALSA() |
40 |
{ |
48 |
{ |
41 |
// Reset everything. |
49 |
// Reset everything. |
42 |
outOfOrder(); |
50 |
outOfOrder(); |
|
|
51 |
} |
52 |
|
53 |
Audio_ALSA::~Audio_ALSA() |
54 |
{ |
55 |
close (); |
43 |
} |
56 |
} |
44 |
|
57 |
|
45 |
Audio_ALSA::~Audio_ALSA () |
58 |
void |
|
|
59 |
Audio_ALSA::outOfOrder() |
46 |
{ |
60 |
{ |
47 |
close (); |
61 |
// Reset everything. |
|
|
62 |
_swapEndian = false; |
63 |
_bufShift = 0; |
64 |
_errorString = "None"; |
65 |
_audioHandle = NULL; |
48 |
} |
66 |
} |
49 |
|
67 |
|
50 |
void Audio_ALSA::outOfOrder () |
68 |
bool |
51 |
{ |
69 |
Audio_ALSA::fmt(AudioConfig &cfg, snd_pcm_hw_params_t *hw) |
52 |
// Reset everything. |
70 |
{ |
53 |
_errorString = "None"; |
71 |
struct precinfo { |
54 |
_audioHandle = NULL; |
72 |
snd_pcm_format_t format; |
55 |
} |
73 |
int encoding; |
56 |
|
74 |
int precision; |
57 |
void *Audio_ALSA::open (AudioConfig &cfg, const char *) |
75 |
int swap; |
58 |
{ |
76 |
}; |
59 |
AudioConfig tmpCfg; |
77 |
struct precinfo info[] = { |
60 |
int mask, wantedFormat, format; |
78 |
#if defined(WORDS_BIGENDIAN) |
61 |
int rtn; |
79 |
{ SND_PCM_FORMAT_S16_BE, AUDIO_SIGNED_PCM, 16, false }, |
62 |
int card = -1, dev = 0; |
80 |
{ SND_PCM_FORMAT_U16_BE, AUDIO_UNSIGNED_PCM, 16, false }, |
63 |
|
81 |
{ SND_PCM_FORMAT_S16_LE, AUDIO_SIGNED_PCM, 16, true }, |
64 |
if (_audioHandle != NULL) |
82 |
{ SND_PCM_FORMAT_U16_LE, AUDIO_UNSIGNED_PCM, 16, true }, |
65 |
{ |
83 |
#else |
66 |
_errorString = "ERROR: Device already in use"; |
84 |
{ SND_PCM_FORMAT_S16_LE, AUDIO_SIGNED_PCM, 16, false }, |
67 |
return NULL; |
85 |
{ SND_PCM_FORMAT_U16_LE, AUDIO_UNSIGNED_PCM, 16, false }, |
68 |
} |
86 |
{ SND_PCM_FORMAT_S16_BE, AUDIO_SIGNED_PCM, 16, true }, |
69 |
|
87 |
{ SND_PCM_FORMAT_U16_BE, AUDIO_UNSIGNED_PCM, 16, true }, |
70 |
if ((rtn = snd_pcm_open_preferred (&_audioHandle, &card, &dev, SND_PCM_OPEN_PLAYBACK))) |
88 |
#endif |
71 |
{ |
89 |
{ SND_PCM_FORMAT_S8, AUDIO_SIGNED_PCM, 8, false }, |
72 |
_errorString = "ERROR: Could not open audio device."; |
90 |
{ SND_PCM_FORMAT_U8, AUDIO_UNSIGNED_PCM, 8, false } |
73 |
goto open_error; |
91 |
}; |
74 |
} |
92 |
|
75 |
|
93 |
switch (cfg.precision) { |
76 |
// Transfer input parameters to this object. |
94 |
case 8: |
77 |
// May later be replaced with driver defaults. |
95 |
for (int i = 0; i < 2; i++) { |
78 |
tmpCfg = cfg; |
96 |
struct precinfo t; |
79 |
|
97 |
memcpy(&t, &info[i], sizeof(t)); |
80 |
snd_pcm_channel_params_t pp; |
98 |
memcpy(&info[i + 4], &info[i], sizeof(t)); |
81 |
snd_pcm_channel_setup_t setup; |
99 |
memcpy(&info[i], &t, sizeof(t)); |
82 |
|
100 |
} |
83 |
snd_pcm_channel_info_t pi; |
101 |
break; |
84 |
|
102 |
case 16: |
85 |
memset (&pi, 0, sizeof (pi)); |
103 |
break; |
86 |
pi.channel = SND_PCM_CHANNEL_PLAYBACK; |
104 |
default: |
87 |
if ((rtn = snd_pcm_plugin_info (_audioHandle, &pi))) |
105 |
fprintf(stderr, "Unsupported precision: %d bits\n", |
88 |
{ |
106 |
cfg.precision); |
89 |
_errorString = "ALSA: snd_pcm_plugin_info failed."; |
107 |
return false; |
90 |
goto open_error; |
108 |
} |
91 |
} |
109 |
|
92 |
|
110 |
int err; |
93 |
memset(&pp, 0, sizeof (pp)); |
111 |
for (int i = 0; i < 6; i++) { |
|
|
112 |
err = snd_pcm_hw_params_set_format(_audioHandle, hw, |
113 |
info[i].format); |
114 |
if (err < 0) { |
115 |
continue; |
116 |
} |
117 |
|
118 |
cfg.precision = info[i].precision; |
119 |
cfg.encoding = info[i].encoding; |
120 |
_swapEndian = info[i].swap; |
121 |
_bufShift = info[i].precision == 8 ? 0 : 1; |
122 |
return true; |
123 |
} |
94 |
|
124 |
|
95 |
pp.mode = SND_PCM_MODE_BLOCK; |
125 |
fprintf(stderr, "Cannot set sample format: %s\n", snd_strerror(err)); |
96 |
pp.channel = SND_PCM_CHANNEL_PLAYBACK; |
126 |
return false; |
97 |
pp.start_mode = SND_PCM_START_FULL; |
127 |
} |
98 |
pp.stop_mode = SND_PCM_STOP_STOP; |
128 |
|
99 |
|
129 |
|
100 |
pp.buf.block.frag_size = pi.max_fragment_size; |
130 |
|
101 |
|
131 |
bool |
102 |
pp.buf.block.frags_max = 1; |
132 |
Audio_ALSA::init(AudioConfig &cfg, snd_pcm_hw_params_t *hw) |
103 |
pp.buf.block.frags_min = 1; |
133 |
{ |
104 |
|
134 |
int err; |
105 |
pp.format.interleave = 1; |
135 |
|
106 |
pp.format.rate = tmpCfg.frequency; |
136 |
err = snd_pcm_hw_params_any(_audioHandle, hw); |
107 |
pp.format.voices = tmpCfg.channels; |
137 |
if (err < 0) { |
108 |
|
138 |
fprintf(stderr, "Cannot initialize hardware " |
109 |
// Set sample precision and type of encoding. |
139 |
"parameter structure: %s\n", |
110 |
if ( tmpCfg.precision == 8 ) |
140 |
snd_strerror(err)); |
111 |
{ |
141 |
return false; |
112 |
tmpCfg.encoding = AUDIO_UNSIGNED_PCM; |
142 |
} |
113 |
pp.format.format = SND_PCM_SFMT_U8; |
143 |
|
114 |
} |
144 |
err = snd_pcm_hw_params_set_access(_audioHandle, hw, |
115 |
if ( tmpCfg.precision == 16 ) |
145 |
SND_PCM_ACCESS_RW_INTERLEAVED); |
116 |
{ |
146 |
if (err < 0) { |
117 |
tmpCfg.encoding = AUDIO_SIGNED_PCM; |
147 |
fprintf(stderr, "Cannot set access type: %s\n", |
118 |
pp.format.format = SND_PCM_SFMT_S16_LE; |
148 |
snd_strerror(err)); |
119 |
} |
149 |
return false; |
120 |
|
150 |
} |
121 |
if ((rtn = snd_pcm_plugin_params (_audioHandle, &pp)) < 0) |
151 |
|
122 |
{ |
152 |
/* try to find supported format/precision */ |
123 |
_errorString = "ALSA: snd_pcm_plugin_params failed."; |
153 |
if (! fmt(cfg, hw)) { |
124 |
goto open_error; |
154 |
return false; |
125 |
} |
155 |
} |
126 |
|
156 |
|
127 |
if ((rtn = snd_pcm_plugin_prepare (_audioHandle, SND_PCM_CHANNEL_PLAYBACK)) < 0) |
157 |
/* use closest frequency */ |
128 |
{ |
158 |
unsigned int realFreq = (unsigned int) cfg.frequency; |
129 |
_errorString = "ALSA: snd_pcm_plugin_prepare failed."; |
159 |
err = snd_pcm_hw_params_set_rate_near(_audioHandle, hw, &realFreq, 0); |
130 |
goto open_error; |
160 |
if (err < 0) { |
131 |
} |
161 |
fprintf(stderr, "Cannot set sample rate: %s\n", |
132 |
|
162 |
snd_strerror(err)); |
133 |
memset (&setup, 0, sizeof (setup)); |
163 |
return false; |
134 |
setup.channel = SND_PCM_CHANNEL_PLAYBACK; |
164 |
} |
135 |
if ((rtn = snd_pcm_plugin_setup (_audioHandle, &setup)) < 0) |
165 |
cfg.frequency = realFreq; |
136 |
{ |
166 |
|
137 |
_errorString = "ALSA: snd_pcm_plugin_setup failed."; |
167 |
switch (cfg.channels) { |
138 |
goto open_error; |
168 |
case 2: |
139 |
} |
169 |
_bufShift++; |
|
|
170 |
break; |
171 |
case 1: |
172 |
break; |
173 |
default: |
174 |
fprintf(stderr, "Unsupported channel count: %d\n", |
175 |
cfg.channels); |
176 |
return false; |
177 |
} |
178 |
err = snd_pcm_hw_params_set_channels(_audioHandle, hw, |
179 |
cfg.channels); |
180 |
if (err < 0) { |
181 |
fprintf(stderr, "Cannot set channel count: %s\n", |
182 |
snd_strerror(err)); |
183 |
return false; |
184 |
} |
185 |
|
186 |
err = snd_pcm_hw_params(_audioHandle, hw); |
187 |
if (err < 0) { |
188 |
fprintf(stdout, "Cannot set parameters: %s\n", |
189 |
snd_strerror(err)); |
190 |
return false; |
191 |
} |
140 |
|
192 |
|
141 |
tmpCfg.bufSize = setup.buf.block.frag_size; |
193 |
return true; |
|
|
194 |
} |
195 |
|
196 |
|
197 |
|
198 |
void * |
199 |
Audio_ALSA::open(AudioConfig &cfg, const char *name) |
200 |
{ |
201 |
AudioConfig tmpCfg = cfg; |
202 |
snd_pcm_hw_params_t *hw; |
203 |
int err; |
204 |
|
205 |
if (_audioHandle != NULL) { |
206 |
_errorString = "ERROR: Device already in use"; |
207 |
return NULL; |
208 |
} |
209 |
|
210 |
err = snd_pcm_open(&_audioHandle, ALSA_DEFAULT, |
211 |
SND_PCM_STREAM_PLAYBACK, 0); |
212 |
if (err < 0) { |
213 |
_errorString = "ERROR: Could not open audio device."; |
214 |
fprintf(stderr, "Cannot open audio device: %s\n", |
215 |
snd_strerror(err)); |
216 |
return NULL; |
217 |
} |
218 |
|
219 |
err = snd_pcm_hw_params_malloc(&hw); |
220 |
if (err < 0) { |
221 |
_errorString = "ERROR: Cannot initialise ALSA"; |
222 |
fprintf(stderr, "Cannot allocate hardware " |
223 |
"parameter structure: %s\n", |
224 |
snd_strerror(err)); |
225 |
return NULL; |
226 |
} |
227 |
|
228 |
bool init_ok = init(tmpCfg, hw); |
229 |
snd_pcm_hw_params_free(hw); |
230 |
if (! init_ok) { |
231 |
_errorString = "ERROR: Cannot initialise ALSA"; |
232 |
return NULL; |
233 |
} |
234 |
|
235 |
err = snd_pcm_prepare(_audioHandle); |
236 |
if (err < 0) { |
237 |
_errorString = "Cannot initialise ALSA"; |
238 |
fprintf(stderr, "cannot prepare audio interface for use: %s\n", |
239 |
snd_strerror(err)); |
240 |
return NULL; |
241 |
} |
242 |
|
243 |
tmpCfg.bufSize = 4096; |
142 |
#ifdef HAVE_EXCEPTIONS |
244 |
#ifdef HAVE_EXCEPTIONS |
143 |
_sampleBuffer = new(std::nothrow) int_least8_t[tmpCfg.bufSize]; |
245 |
_sampleBuffer = new(std::nothrow) int_least8_t[tmpCfg.bufSize]; |
144 |
#else |
246 |
#else |
145 |
_sampleBuffer = new int_least8_t[tmpCfg.bufSize]; |
247 |
_sampleBuffer = new int_least8_t[tmpCfg.bufSize]; |
146 |
#endif |
248 |
#endif |
147 |
|
249 |
|
148 |
if (!_sampleBuffer) |
250 |
if (!_sampleBuffer) { |
149 |
{ |
251 |
_errorString = "Unable to allocate memory for sample buffers"; |
150 |
_errorString = "AUDIO: Unable to allocate memory for sample buffers."; |
252 |
return NULL; |
151 |
goto open_error; |
253 |
} |
152 |
} |
254 |
|
153 |
|
255 |
// Setup internal Config |
154 |
// Setup internal Config |
256 |
_settings = tmpCfg; |
155 |
_settings = tmpCfg; |
257 |
// Update the users settings |
156 |
// Update the users settings |
258 |
getConfig (cfg); |
157 |
getConfig (cfg); |
259 |
return _sampleBuffer; |
158 |
return _sampleBuffer; |
|
|
159 |
|
160 |
open_error: |
161 |
if (_audioHandle != NULL) |
162 |
{ |
163 |
close (); |
164 |
} |
165 |
|
166 |
perror ("ALSA"); |
167 |
return NULL; |
168 |
} |
260 |
} |
169 |
|
261 |
|
|
|
262 |
|
263 |
|
170 |
// Close an opened audio device, free any allocated buffers and |
264 |
// Close an opened audio device, free any allocated buffers and |
171 |
// reset any variables that reflect the current state. |
265 |
// reset any variables that reflect the current state. |
172 |
void Audio_ALSA::close () |
266 |
void |
|
|
267 |
Audio_ALSA::close() |
173 |
{ |
268 |
{ |
174 |
if (_audioHandle != NULL ) |
269 |
if (_audioHandle != NULL) { |
175 |
{ |
270 |
snd_pcm_close(_audioHandle); |
176 |
snd_pcm_close(_audioHandle); |
271 |
delete [] _sampleBuffer; |
177 |
delete [] _sampleBuffer; |
272 |
outOfOrder (); |
178 |
outOfOrder (); |
273 |
} |
179 |
} |
|
|
180 |
} |
274 |
} |
181 |
|
275 |
|
182 |
void *Audio_ALSA::reset () |
276 |
|
|
|
277 |
|
278 |
void * |
279 |
Audio_ALSA::reset () |
183 |
{ |
280 |
{ |
184 |
return (void *) _sampleBuffer; |
281 |
return (void *) _sampleBuffer; |
185 |
} |
282 |
} |
186 |
|
283 |
|
187 |
void *Audio_ALSA::write () |
|
|
188 |
{ |
189 |
if (_audioHandle == NULL) |
190 |
{ |
191 |
_errorString = "ERROR: Device not open."; |
192 |
return NULL; |
193 |
} |
194 |
|
284 |
|
195 |
snd_pcm_plugin_write (_audioHandle, _sampleBuffer, _settings.bufSize); |
285 |
|
196 |
return (void *) _sampleBuffer; |
286 |
void * |
|
|
287 |
Audio_ALSA::write() |
288 |
{ |
289 |
if (_audioHandle == NULL) |
290 |
{ |
291 |
_errorString = "ERROR: Device not open."; |
292 |
return NULL; |
293 |
} |
294 |
|
295 |
if (_swapEndian) { |
296 |
for (int n = 0; n < _settings.bufSize; n += 2) { |
297 |
char t = ((char *) _sampleBuffer)[n]; |
298 |
((char *) _sampleBuffer)[n] = |
299 |
((char *) _sampleBuffer)[n + 1]; |
300 |
((char *) _sampleBuffer)[n + 1] = t; |
301 |
} |
302 |
} |
303 |
snd_pcm_writei(_audioHandle, _sampleBuffer, |
304 |
_settings.bufSize >> _bufShift); |
305 |
return (void *) _sampleBuffer; |
197 |
} |
306 |
} |
198 |
|
307 |
|
199 |
#endif // HAVE_ALSA |
308 |
#endif // HAVE_ALSA |
200 |
-- sidplay-2.0.9.orig/src/audio/alsa/audiodrv.h |
309 |
++ sidplay-2.0.9/src/audio/alsa/audiodrv.h |
Lines 3-8
Link Here
|
3 |
// -------------------------------------------------------------------------- |
3 |
// -------------------------------------------------------------------------- |
4 |
/*************************************************************************** |
4 |
/*************************************************************************** |
5 |
* $Log: audiodrv.h,v $ |
5 |
* $Log: audiodrv.h,v $ |
|
|
6 |
* Revision 1.6 2008/07/19 13:58:04 wnd |
7 |
* Update to new ALSA API. |
8 |
* |
6 |
* Revision 1.5 2002/01/10 19:04:00 s_a_white |
9 |
* Revision 1.5 2002/01/10 19:04:00 s_a_white |
7 |
* Interface changes for audio drivers. |
10 |
* Interface changes for audio drivers. |
8 |
* |
11 |
* |
Lines 36-42
Link Here
|
36 |
#include <fcntl.h> |
39 |
#include <fcntl.h> |
37 |
#include <unistd.h> |
40 |
#include <unistd.h> |
38 |
#include <sys/ioctl.h> |
41 |
#include <sys/ioctl.h> |
39 |
#include <sys/asoundlib.h> |
42 |
#include <alsa/asoundlib.h> |
40 |
#include "../AudioBase.h" |
43 |
#include "../AudioBase.h" |
41 |
|
44 |
|
42 |
|
45 |
|
Lines 44-49
Link Here
|
44 |
{ |
47 |
{ |
45 |
private: // ------------------------------------------------------- private |
48 |
private: // ------------------------------------------------------- private |
46 |
snd_pcm_t * _audioHandle; |
49 |
snd_pcm_t * _audioHandle; |
|
|
50 |
bool _swapEndian; |
51 |
int _bufShift; |
47 |
|
52 |
|
48 |
void outOfOrder (); |
53 |
void outOfOrder (); |
49 |
|
54 |
|
Lines 51-56
Link Here
|
51 |
Audio_ALSA(); |
56 |
Audio_ALSA(); |
52 |
~Audio_ALSA(); |
57 |
~Audio_ALSA(); |
53 |
|
58 |
|
|
|
59 |
bool fmt (AudioConfig &cfg, snd_pcm_hw_params_t *hw); |
60 |
bool init (AudioConfig &cfg, snd_pcm_hw_params_t *hw); |
54 |
void *open (AudioConfig &cfg, const char *name); |
61 |
void *open (AudioConfig &cfg, const char *name); |
55 |
void close (); |
62 |
void close (); |
56 |
// Rev 1.2 (saw) - Changed, see AudioBase.h |
63 |
// Rev 1.2 (saw) - Changed, see AudioBase.h |
57 |
-- sidplay-2.0.9.orig/src/audio/oss/audiodrv.h |
64 |
++ sidplay-2.0.9/src/audio/oss/audiodrv.h |
Lines 57-63
Link Here
|
57 |
#include <stdio.h> |
57 |
#include <stdio.h> |
58 |
#include <unistd.h> |
58 |
#include <unistd.h> |
59 |
|
59 |
|
60 |
#if defined(HAVE_LINUX_SOUNDCARD_H) |
60 |
#if defined(HAVE_SYS_SOUNDCARD_H) |
|
|
61 |
# include <sys/soundcard.h> |
62 |
#elif defined(HAVE_LINUX_SOUNDCARD_H) |
61 |
# include <linux/soundcard.h> |
63 |
# include <linux/soundcard.h> |
62 |
#elif defined(HAVE_MACHINE_SOUNDCARD_H) |
64 |
#elif defined(HAVE_MACHINE_SOUNDCARD_H) |
63 |
# include <machine/soundcard.h> |
65 |
# include <machine/soundcard.h> |
64 |
-- sidplay-2.0.9.orig/src/keyboard.cpp |
66 |
++ sidplay-2.0.9/src/keyboard.cpp |
Lines 56-62
Link Here
|
56 |
# include <sys/stat.h> |
56 |
# include <sys/stat.h> |
57 |
# include <fcntl.h> |
57 |
# include <fcntl.h> |
58 |
# include <unistd.h> |
58 |
# include <unistd.h> |
59 |
char _getch (void); |
59 |
int _getch (void); |
60 |
#endif |
60 |
#endif |
61 |
|
61 |
|
62 |
#define MAX_CMDLEN 10 |
62 |
#define MAX_CMDLEN 10 |
Lines 200-206
Link Here
|
200 |
|
200 |
|
201 |
int keyboard_decode () |
201 |
int keyboard_decode () |
202 |
{ |
202 |
{ |
203 |
char cmd[MAX_CMDLEN+1], c; |
203 |
char cmd[MAX_CMDLEN+1]; |
|
|
204 |
int c; |
204 |
int nch = 0; |
205 |
int nch = 0; |
205 |
int action = A_NONE; |
206 |
int action = A_NONE; |
206 |
|
207 |
|
Lines 208-221
Link Here
|
208 |
* Collect characters in a buffer. |
209 |
* Collect characters in a buffer. |
209 |
* Start with the one we have, and get more if we need them. |
210 |
* Start with the one we have, and get more if we need them. |
210 |
*/ |
211 |
*/ |
211 |
c = (char) _getch(); |
212 |
c = _getch(); |
212 |
if (c == '\0') |
213 |
if (c == '\0') |
213 |
c = '\340'; // 224 |
214 |
c = '\340'; // 224 |
214 |
else if (c == ESC) |
215 |
else if (c == ESC) |
215 |
{ |
216 |
{ |
216 |
cmd[nch++] = c; |
217 |
cmd[nch++] = c; |
217 |
if (_kbhit ()) |
218 |
if (_kbhit ()) |
218 |
c = (char) _getch (); |
219 |
c = _getch (); |
219 |
} |
220 |
} |
220 |
|
221 |
|
221 |
while (c >= 0) |
222 |
while (c >= 0) |
Lines 228-234
Link Here
|
228 |
break; |
229 |
break; |
229 |
if (!_kbhit ()) |
230 |
if (!_kbhit ()) |
230 |
break; |
231 |
break; |
231 |
c = (char) _getch (); |
232 |
c = _getch (); |
232 |
} |
233 |
} |
233 |
return action; |
234 |
return action; |
234 |
} |
235 |
} |
Lines 256-262
Link Here
|
256 |
return 0; |
257 |
return 0; |
257 |
} |
258 |
} |
258 |
|
259 |
|
259 |
char _getch (void) |
260 |
int _getch (void) |
260 |
{ |
261 |
{ |
261 |
char ch = -1; |
262 |
char ch = -1; |
262 |
if (infd >= 0) |
263 |
if (infd >= 0) |
263 |
-- sidplay-2.0.9.orig/src/main.cpp |
264 |
++ sidplay-2.0.9/src/main.cpp |
Lines 137-143
Link Here
|
137 |
g_player = &player; |
137 |
g_player = &player; |
138 |
|
138 |
|
139 |
{// Decode the command line args |
139 |
{// Decode the command line args |
140 |
int ret = player.args (argc - 1, const_cast<const char**>(argv + 1)); |
140 |
int ret = player.args (argc - 1, const_cast<char**>(argv + 1)); |
141 |
if (ret < 0) |
141 |
if (ret < 0) |
142 |
goto main_error; |
142 |
goto main_error; |
143 |
else if (!ret) |
143 |
else if (!ret) |
144 |
-- sidplay-2.0.9.orig/src/player.h |
144 |
++ sidplay-2.0.9/src/player.h |
Lines 194-200
Link Here
|
194 |
void consoleRestore (void); |
194 |
void consoleRestore (void); |
195 |
|
195 |
|
196 |
// Command line args |
196 |
// Command line args |
197 |
bool parseTime (const char *str, uint_least32_t &time); |
197 |
bool parseTime (char *str, uint_least32_t &time); |
198 |
void displayArgs (const char *arg = NULL); |
198 |
void displayArgs (const char *arg = NULL); |
199 |
void displayDebugArgs (); |
199 |
void displayDebugArgs (); |
200 |
|
200 |
|
Lines 211-217
Link Here
|
211 |
ConsolePlayer (const char * const name); |
211 |
ConsolePlayer (const char * const name); |
212 |
virtual ~ConsolePlayer() {;} |
212 |
virtual ~ConsolePlayer() {;} |
213 |
|
213 |
|
214 |
int args (int argc, const char *argv[]); |
214 |
int args (int argc, char *argv[]); |
215 |
bool open (void); |
215 |
bool open (void); |
216 |
void close (void); |
216 |
void close (void); |
217 |
bool play (void); |
217 |
bool play (void); |
218 |
-- sidplay-2.0.9.orig/unix/config.h.in |
218 |
++ sidplay-2.0.9/unix/config.h.in |
Lines 18-23
Link Here
|
18 |
#undef HAVE_HARDSID_BUILDER |
18 |
#undef HAVE_HARDSID_BUILDER |
19 |
|
19 |
|
20 |
|
20 |
|
|
|
21 |
/* Define if building universal (internal helper macro) */ |
22 |
#undef AC_APPLE_UNIVERSAL_BUILD |
23 |
|
21 |
/* Define to 1 if you have the <audio.h> header file. */ |
24 |
/* Define to 1 if you have the <audio.h> header file. */ |
22 |
#undef HAVE_AUDIO_H |
25 |
#undef HAVE_AUDIO_H |
23 |
|
26 |
|
Lines 78-83
Link Here
|
78 |
/* Define to 1 if you have the <sys/ioctl.h> header file. */ |
81 |
/* Define to 1 if you have the <sys/ioctl.h> header file. */ |
79 |
#undef HAVE_SYS_IOCTL_H |
82 |
#undef HAVE_SYS_IOCTL_H |
80 |
|
83 |
|
|
|
84 |
/* Define to 1 if you have the <sys/soundcard.h> header file. */ |
85 |
#undef HAVE_SYS_SOUNDCARD_H |
86 |
|
81 |
/* Define to 1 if you have the <sys/stat.h> header file. */ |
87 |
/* Define to 1 if you have the <sys/stat.h> header file. */ |
82 |
#undef HAVE_SYS_STAT_H |
88 |
#undef HAVE_SYS_STAT_H |
83 |
|
89 |
|
Lines 102-107
Link Here
|
102 |
/* Define to the one symbol short name of this package. */ |
108 |
/* Define to the one symbol short name of this package. */ |
103 |
#undef PACKAGE_TARNAME |
109 |
#undef PACKAGE_TARNAME |
104 |
|
110 |
|
|
|
111 |
/* Define to the home page for this package. */ |
112 |
#undef PACKAGE_URL |
113 |
|
105 |
/* Define to the version of this package. */ |
114 |
/* Define to the version of this package. */ |
106 |
#undef PACKAGE_VERSION |
115 |
#undef PACKAGE_VERSION |
107 |
|
116 |
|
Lines 111-116
Link Here
|
111 |
/* Version number of package */ |
120 |
/* Version number of package */ |
112 |
#undef VERSION |
121 |
#undef VERSION |
113 |
|
122 |
|
114 |
/* Define to 1 if your processor stores words with the most significant byte |
123 |
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most |
115 |
first (like Motorola and SPARC, unlike Intel and VAX). */ |
124 |
significant byte first (like Motorola and SPARC, unlike Intel). */ |
116 |
#undef WORDS_BIGENDIAN |
125 |
#if defined AC_APPLE_UNIVERSAL_BUILD |
|
|
126 |
# if defined __BIG_ENDIAN__ |
127 |
# define WORDS_BIGENDIAN 1 |
128 |
# endif |
129 |
#else |
130 |
# ifndef WORDS_BIGENDIAN |
131 |
# undef WORDS_BIGENDIAN |
132 |
# endif |
133 |
#endif |
117 |
-- sidplay-2.0.9.orig/unix/my_macros.m4 |
134 |
++ sidplay-2.0.9/unix/my_macros.m4 |
Lines 80-86
Link Here
|
80 |
AC_CACHE_VAL(test_cv_have_ios_binary, |
80 |
AC_CACHE_VAL(test_cv_have_ios_binary, |
81 |
[ |
81 |
[ |
82 |
AC_TRY_COMPILE( |
82 |
AC_TRY_COMPILE( |
83 |
[#include <fstream.h>], |
83 |
[#include <fstream> |
|
|
84 |
using namespace std;], |
84 |
[ifstream myTest(ios::in|ios::binary);], |
85 |
[ifstream myTest(ios::in|ios::binary);], |
85 |
[test_cv_have_ios_binary=yes], |
86 |
[test_cv_have_ios_binary=yes], |
86 |
[test_cv_have_ios_binary=no] |
87 |
[test_cv_have_ios_binary=no] |
Lines 105-112
Link Here
|
105 |
AC_CACHE_VAL(test_cv_have_ios_openmode, |
106 |
AC_CACHE_VAL(test_cv_have_ios_openmode, |
106 |
[ |
107 |
[ |
107 |
AC_TRY_COMPILE( |
108 |
AC_TRY_COMPILE( |
108 |
[#include <fstream.h> |
109 |
[#include <fstream> |
109 |
#include <iomanip.h>], |
110 |
#include <iomanip> |
|
|
111 |
using namespace std;], |
110 |
[ios::openmode myTest = ios::in;], |
112 |
[ios::openmode myTest = ios::in;], |
111 |
[test_cv_have_ios_openmode=yes], |
113 |
[test_cv_have_ios_openmode=yes], |
112 |
[test_cv_have_ios_openmode=no] |
114 |
[test_cv_have_ios_openmode=no] |