2
* audio.h - Audio support
4
* Basilisk II (C) 1997-2002 Christian Bauer
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.
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.
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
26
#ifndef NO_STD_NAMESPACE
30
extern int32 AudioDispatch(uint32 params, uint32 ti);
32
extern bool AudioAvailable; // Flag: audio output available (from the software point of view)
34
extern int16 SoundInOpen(uint32 pb, uint32 dce);
35
extern int16 SoundInPrime(uint32 pb, uint32 dce);
36
extern int16 SoundInControl(uint32 pb, uint32 dce);
37
extern int16 SoundInStatus(uint32 pb, uint32 dce);
38
extern int16 SoundInClose(uint32 pb, uint32 dce);
40
// System specific and internal functions/data
41
extern void AudioInit(void);
42
extern void AudioExit(void);
43
extern void AudioReset(void);
45
extern void AudioInterrupt(void);
47
extern void audio_enter_stream(void);
48
extern void audio_exit_stream(void);
50
extern bool audio_set_sample_rate(int index);
51
extern bool audio_set_sample_size(int index);
52
extern bool audio_set_channels(int index);
54
extern bool audio_get_main_mute(void);
55
extern uint32 audio_get_main_volume(void);
56
extern bool audio_get_speaker_mute(void);
57
extern uint32 audio_get_speaker_volume(void);
58
extern void audio_set_main_mute(bool mute);
59
extern void audio_set_main_volume(uint32 vol);
60
extern void audio_set_speaker_mute(bool mute);
61
extern void audio_set_speaker_volume(uint32 vol);
63
// Current audio status
65
uint32 sample_rate; // 16.16 fixed point
66
uint32 sample_size; // 8 or 16
67
uint32 channels; // 1 (mono) or 2 (stereo)
68
uint32 mixer; // Mac address of Apple Mixer
69
int num_sources; // Number of active sources
71
extern struct audio_status AudioStatus;
73
extern bool audio_open; // Flag: audio is open and ready
74
extern int audio_frames_per_block; // Number of audio frames per block
75
extern uint32 audio_component_flags; // Component feature flags
77
extern vector<uint32> audio_sample_rates; // Vector of supported sample rates (16.16 fixed point)
78
extern vector<uint16> audio_sample_sizes; // Vector of supported sample sizes
79
extern vector<uint16> audio_channel_counts; // Array of supported channels counts
81
// Audio component global data and 68k routines
83
adatDelegateCall = 0, // 68k code to call DelegateCall()
84
adatOpenMixer = 14, // 68k code to call OpenMixerSoundComponent()
85
adatCloseMixer = 36, // 68k code to call CloseMixerSoundComponent()
86
adatGetInfo = 54, // 68k code to call GetInfo()
87
adatSetInfo = 78, // 68k code to call SetInfo()
88
adatPlaySourceBuffer = 102, // 68k code to call PlaySourceBuffer()
89
adatGetSourceData = 126, // 68k code to call GetSourceData()
90
adatStartSource = 146, // 68k code to call StartSource()
91
adatData = 168, // SoundComponentData struct
92
adatMixer = 196, // Mac address of mixer, returned by adatOpenMixer
93
adatStreamInfo = 200, // Mac address of stream info, returned by adatGetSourceData
97
extern uint32 audio_data; // Mac address of global data area