ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/audio.h
Revision: 1.5
Committed: 2000-07-25T17:02:23Z (24 years, 3 months ago) by cebix
Content type: text/plain
Branch: MAIN
Changes since 1.4: +6 -0 lines
Log Message:
- added EMUL_OP opcodes for sound input driver, created stubs for driver
  routines

File Contents

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