ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/dummy/audio_dummy.cpp
Revision: 1.9
Committed: 2005-01-30T21:42:15Z (19 years, 10 months ago) by gbeauche
Branch: MAIN
CVS Tags: nigel-build-19, nigel-build-17
Changes since 1.8: +1 -1 lines
Log Message:
Happy New Year!

File Contents

# User Rev Content
1 cebix 1.1 /*
2     * audio_dummy.cpp - Audio support, dummy implementation
3     *
4 gbeauche 1.9 * Basilisk II (C) 1997-2005 Christian Bauer
5 cebix 1.1 *
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 cebix 1.5 AudioStatus.sample_rate = 44100 << 16;
38     AudioStatus.sample_size = 16;
39     AudioStatus.channels = 2;
40 cebix 1.1 AudioStatus.mixer = 0;
41     AudioStatus.num_sources = 0;
42     audio_component_flags = cmpWantsRegisterMessage | kStereoOut | k16BitOut;
43    
44 cebix 1.5 // Only one sample format is supported
45     audio_sample_rates.push_back(44100 << 16);
46 cebix 1.6 audio_sample_sizes.push_back(16);
47 cebix 1.5 audio_channel_counts.push_back(2);
48    
49 cebix 1.1 // 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 cebix 1.5 * "index" is an index into the audio_sample_rates[] etc. vectors
98 cebix 1.1 * It is guaranteed that AudioStatus.num_sources == 0
99     */
100    
101 cebix 1.5 bool audio_set_sample_rate(int index)
102 cebix 1.1 {
103     }
104    
105 cebix 1.5 bool audio_set_sample_size(int index)
106 cebix 1.1 {
107     }
108    
109 cebix 1.5 bool audio_set_channels(int index)
110 cebix 1.1 {
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 cebix 1.2 bool audio_get_speaker_mute(void)
131 cebix 1.1 {
132     return false;
133     }
134    
135 cebix 1.2 uint32 audio_get_speaker_volume(void)
136 cebix 1.1 {
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 cebix 1.2 void audio_set_speaker_mute(bool mute)
149 cebix 1.1 {
150     }
151    
152 cebix 1.2 void audio_set_speaker_volume(uint32 vol)
153 cebix 1.1 {
154     }