1 |
/* |
2 |
* audio_dummy.cpp - Audio support, dummy implementation |
3 |
* |
4 |
* Basilisk II (C) 1997-2008 Christian Bauer |
5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
8 |
* the Free Software Foundation; either version 2 of the License, or |
9 |
* (at your option) any later version. |
10 |
* |
11 |
* This program is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU General Public License |
17 |
* along with this program; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
20 |
|
21 |
#include "sysdeps.h" |
22 |
#include "prefs.h" |
23 |
#include "audio.h" |
24 |
#include "audio_defs.h" |
25 |
|
26 |
#define DEBUG 0 |
27 |
#include "debug.h" |
28 |
|
29 |
|
30 |
/* |
31 |
* Initialization |
32 |
*/ |
33 |
|
34 |
void AudioInit(void) |
35 |
{ |
36 |
// Init audio status and feature flags |
37 |
AudioStatus.sample_rate = 44100 << 16; |
38 |
AudioStatus.sample_size = 16; |
39 |
AudioStatus.channels = 2; |
40 |
AudioStatus.mixer = 0; |
41 |
AudioStatus.num_sources = 0; |
42 |
audio_component_flags = cmpWantsRegisterMessage | kStereoOut | k16BitOut; |
43 |
|
44 |
// Only one sample format is supported |
45 |
audio_sample_rates.push_back(44100 << 16); |
46 |
audio_sample_sizes.push_back(16); |
47 |
audio_channel_counts.push_back(2); |
48 |
|
49 |
// Sound disabled in prefs? Then do nothing |
50 |
if (PrefsFindBool("nosound")) |
51 |
return; |
52 |
|
53 |
// Audio not available |
54 |
audio_open = false; |
55 |
} |
56 |
|
57 |
|
58 |
/* |
59 |
* Deinitialization |
60 |
*/ |
61 |
|
62 |
void AudioExit(void) |
63 |
{ |
64 |
} |
65 |
|
66 |
|
67 |
/* |
68 |
* First source added, start audio stream |
69 |
*/ |
70 |
|
71 |
void audio_enter_stream() |
72 |
{ |
73 |
} |
74 |
|
75 |
|
76 |
/* |
77 |
* Last source removed, stop audio stream |
78 |
*/ |
79 |
|
80 |
void audio_exit_stream() |
81 |
{ |
82 |
} |
83 |
|
84 |
|
85 |
/* |
86 |
* MacOS audio interrupt, read next data block |
87 |
*/ |
88 |
|
89 |
void AudioInterrupt(void) |
90 |
{ |
91 |
D(bug("AudioInterrupt\n")); |
92 |
} |
93 |
|
94 |
|
95 |
/* |
96 |
* Set sampling parameters |
97 |
* "index" is an index into the audio_sample_rates[] etc. vectors |
98 |
* It is guaranteed that AudioStatus.num_sources == 0 |
99 |
*/ |
100 |
|
101 |
bool audio_set_sample_rate(int index) |
102 |
{ |
103 |
} |
104 |
|
105 |
bool audio_set_sample_size(int index) |
106 |
{ |
107 |
} |
108 |
|
109 |
bool audio_set_channels(int index) |
110 |
{ |
111 |
} |
112 |
|
113 |
|
114 |
/* |
115 |
* Get/set volume controls (volume values received/returned have the left channel |
116 |
* volume in the upper 16 bits and the right channel volume in the lower 16 bits; |
117 |
* both volumes are 8.8 fixed point values with 0x0100 meaning "maximum volume")) |
118 |
*/ |
119 |
|
120 |
bool audio_get_main_mute(void) |
121 |
{ |
122 |
return false; |
123 |
} |
124 |
|
125 |
uint32 audio_get_main_volume(void) |
126 |
{ |
127 |
return 0x01000100; |
128 |
} |
129 |
|
130 |
bool audio_get_speaker_mute(void) |
131 |
{ |
132 |
return false; |
133 |
} |
134 |
|
135 |
uint32 audio_get_speaker_volume(void) |
136 |
{ |
137 |
return 0x01000100; |
138 |
} |
139 |
|
140 |
void audio_set_main_mute(bool mute) |
141 |
{ |
142 |
} |
143 |
|
144 |
void audio_set_main_volume(uint32 vol) |
145 |
{ |
146 |
} |
147 |
|
148 |
void audio_set_speaker_mute(bool mute) |
149 |
{ |
150 |
} |
151 |
|
152 |
void audio_set_speaker_volume(uint32 vol) |
153 |
{ |
154 |
} |