3 |
|
* |
4 |
|
* Adapted from Frodo's Solaris sound routines by Marc Chabanas |
5 |
|
* |
6 |
< |
* Basilisk II (C) 1997-2000 Christian Bauer |
6 |
> |
* Basilisk II (C) 1997-2002 Christian Bauer |
7 |
|
* |
8 |
|
* 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 |
40 |
|
#include "debug.h" |
41 |
|
|
42 |
|
|
43 |
– |
// Supported sample rates, sizes and channels |
44 |
– |
int audio_num_sample_rates = 1; |
45 |
– |
uint32 audio_sample_rates[] = {44100 << 16}; |
46 |
– |
int audio_num_sample_sizes = 1; |
47 |
– |
uint16 audio_sample_sizes[] = {16}; |
48 |
– |
int audio_num_channel_counts = 1; |
49 |
– |
uint16 audio_channel_counts[] = {2}; |
50 |
– |
|
43 |
|
// Global variables |
44 |
|
static int fd = -1; // fd of /dev/audio |
45 |
|
static sem_t audio_irq_done_sem; // Signal from interrupt to streaming thread: data block read |
56 |
|
* Initialization |
57 |
|
*/ |
58 |
|
|
59 |
+ |
// Set AudioStatus to reflect current audio stream format |
60 |
+ |
static void set_audio_status_format(void) |
61 |
+ |
{ |
62 |
+ |
AudioStatus.sample_rate = audio_sample_rates[0]; |
63 |
+ |
AudioStatus.sample_size = audio_sample_sizes[0]; |
64 |
+ |
AudioStatus.channels = audio_channel_counts[0]; |
65 |
+ |
} |
66 |
+ |
|
67 |
|
void AudioInit(void) |
68 |
|
{ |
69 |
|
char str[256]; |
70 |
|
|
71 |
|
// Init audio status and feature flags |
72 |
< |
AudioStatus.sample_rate = audio_sample_rates[0]; |
73 |
< |
AudioStatus.sample_size = audio_sample_sizes[0]; |
74 |
< |
AudioStatus.channels = audio_channel_counts[0]; |
72 |
> |
audio_sample_rates.push_back(44100 << 16); |
73 |
> |
audio_sample_sizes.push_back(16); |
74 |
> |
audio_channel_counts.push_back(2); |
75 |
> |
set_audio_status_format(); |
76 |
|
AudioStatus.mixer = 0; |
77 |
|
AudioStatus.num_sources = 0; |
78 |
|
audio_component_flags = cmpWantsRegisterMessage | kStereoOut | k16BitOut; |
268 |
|
* It is guaranteed that AudioStatus.num_sources == 0 |
269 |
|
*/ |
270 |
|
|
271 |
< |
void audio_set_sample_rate(int index) |
271 |
> |
bool audio_set_sample_rate(int index) |
272 |
|
{ |
273 |
+ |
return true; |
274 |
|
} |
275 |
|
|
276 |
< |
void audio_set_sample_size(int index) |
276 |
> |
bool audio_set_sample_size(int index) |
277 |
|
{ |
278 |
+ |
return true; |
279 |
|
} |
280 |
|
|
281 |
< |
void audio_set_channels(int index) |
281 |
> |
bool audio_set_channels(int index) |
282 |
|
{ |
283 |
+ |
return true; |
284 |
|
} |
285 |
|
|
286 |
|
|