ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/dummy/audio_dummy.cpp
Revision: 1.1
Committed: 1999-10-03T14:16:26Z (24 years, 8 months ago) by cebix
Branch: MAIN
Branch point for: cebix
Log Message:
Initial revision

File Contents

# Content
1 /*
2 * audio_dummy.cpp - Audio support, dummy implementation
3 *
4 * Basilisk II (C) 1997-1999 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 // Supported sample rates, sizes and channels
31 int audio_num_sample_rates = 1;
32 uint32 audio_sample_rates[] = {44100 << 16};
33 int audio_num_sample_sizes = 1;
34 uint16 audio_sample_sizes[] = {16};
35 int audio_num_channel_counts = 1;
36 uint16 audio_channel_counts[] = {2};
37
38
39 /*
40 * Initialization
41 */
42
43 void AudioInit(void)
44 {
45 // Init audio status and feature flags
46 AudioStatus.sample_rate = audio_sample_rates[0];
47 AudioStatus.sample_size = audio_sample_sizes[0];
48 AudioStatus.channels = audio_channel_counts[0];
49 AudioStatus.mixer = 0;
50 AudioStatus.num_sources = 0;
51 audio_component_flags = cmpWantsRegisterMessage | kStereoOut | k16BitOut;
52
53 // Sound disabled in prefs? Then do nothing
54 if (PrefsFindBool("nosound"))
55 return;
56
57 // Audio not available
58 audio_open = false;
59 }
60
61
62 /*
63 * Deinitialization
64 */
65
66 void AudioExit(void)
67 {
68 }
69
70
71 /*
72 * First source added, start audio stream
73 */
74
75 void audio_enter_stream()
76 {
77 }
78
79
80 /*
81 * Last source removed, stop audio stream
82 */
83
84 void audio_exit_stream()
85 {
86 }
87
88
89 /*
90 * MacOS audio interrupt, read next data block
91 */
92
93 void AudioInterrupt(void)
94 {
95 D(bug("AudioInterrupt\n"));
96 }
97
98
99 /*
100 * Set sampling parameters
101 * "index" is an index into the audio_sample_rates[] etc. arrays
102 * It is guaranteed that AudioStatus.num_sources == 0
103 */
104
105 void audio_set_sample_rate(int index)
106 {
107 }
108
109 void audio_set_sample_size(int index)
110 {
111 }
112
113 void audio_set_channels(int index)
114 {
115 }
116
117
118 /*
119 * Get/set volume controls (volume values received/returned have the left channel
120 * volume in the upper 16 bits and the right channel volume in the lower 16 bits;
121 * both volumes are 8.8 fixed point values with 0x0100 meaning "maximum volume"))
122 */
123
124 bool audio_get_main_mute(void)
125 {
126 return false;
127 }
128
129 uint32 audio_get_main_volume(void)
130 {
131 return 0x01000100;
132 }
133
134 bool audio_get_dac_mute(void)
135 {
136 return false;
137 }
138
139 uint32 audio_get_dac_volume(void)
140 {
141 return 0x01000100;
142 }
143
144 void audio_set_main_mute(bool mute)
145 {
146 }
147
148 void audio_set_main_volume(uint32 vol)
149 {
150 }
151
152 void audio_set_dac_mute(bool mute)
153 {
154 }
155
156 void audio_set_dac_volume(uint32 vol)
157 {
158 }