ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/audio.h
Revision: 1.4
Committed: 2000-06-23T14:22:47Z (24 years, 4 months ago) by cebix
Content type: text/plain
Branch: MAIN
CVS Tags: snapshot-13072000
Changes since 1.3: +1 -0 lines
Log Message:
- fixed possible crash when using audio after restarting MacOS

File Contents

# Content
1 /*
2 * audio.h - Audio support
3 *
4 * Basilisk II (C) 1997-2000 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 #ifndef AUDIO_H
22 #define AUDIO_H
23
24 extern int32 AudioDispatch(uint32 params, uint32 ti);
25
26 extern bool AudioAvailable; // Flag: audio output available (from the software point of view)
27
28 // System specific and internal functions/data
29 extern void AudioInit(void);
30 extern void AudioExit(void);
31 extern void AudioReset(void);
32
33 extern void AudioInterrupt(void);
34
35 extern void audio_enter_stream(void);
36 extern void audio_exit_stream(void);
37
38 extern void audio_set_sample_rate(int index);
39 extern void audio_set_sample_size(int index);
40 extern void audio_set_channels(int index);
41
42 extern bool audio_get_main_mute(void);
43 extern uint32 audio_get_main_volume(void);
44 extern bool audio_get_speaker_mute(void);
45 extern uint32 audio_get_speaker_volume(void);
46 extern void audio_set_main_mute(bool mute);
47 extern void audio_set_main_volume(uint32 vol);
48 extern void audio_set_speaker_mute(bool mute);
49 extern void audio_set_speaker_volume(uint32 vol);
50
51 // Current audio status
52 struct audio_status {
53 uint32 sample_rate; // 16.16 fixed point
54 uint32 sample_size; // 8 or 16
55 uint32 channels; // 1 (mono) or 2 (stereo)
56 uint32 mixer; // Mac address of Apple Mixer
57 int num_sources; // Number of active sources
58 };
59 extern struct audio_status AudioStatus;
60
61 extern bool audio_open; // Flag: audio is open and ready
62 extern int audio_frames_per_block; // Number of audio frames per block
63 extern uint32 audio_component_flags; // Component feature flags
64
65 extern int audio_num_sample_rates; // Number of supported sample rates
66 extern uint32 audio_sample_rates[]; // Array of supported sample rates (16.16 fixed point)
67 extern int audio_num_sample_sizes; // Number of supported sample sizes
68 extern uint16 audio_sample_sizes[]; // Array of supported sample sizes
69 extern int audio_num_channel_counts; // Number of supported channel counts
70 extern uint16 audio_channel_counts[]; // Array of supported channels counts
71
72 // Audio component global data and 68k routines
73 enum {
74 adatDelegateCall = 0, // 68k code to call DelegateCall()
75 adatOpenMixer = 14, // 68k code to call OpenMixerSoundComponent()
76 adatCloseMixer = 36, // 68k code to call CloseMixerSoundComponent()
77 adatGetInfo = 54, // 68k code to call GetInfo()
78 adatSetInfo = 78, // 68k code to call SetInfo()
79 adatPlaySourceBuffer = 102, // 68k code to call PlaySourceBuffer()
80 adatGetSourceData = 126, // 68k code to call GetSourceData()
81 adatData = 146, // SoundComponentData struct
82 adatMixer = 174, // Mac address of mixer, returned by adatOpenMixer
83 adatStreamInfo = 178, // Mac address of stream info, returned by adatGetSourceData
84 SIZEOF_adat = 182
85 };
86
87 extern uint32 audio_data; // Mac address of global data area
88
89 #endif