ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/audio_defs.h
Revision: 1.2
Committed: 1999-10-20T15:14:00Z (24 years, 8 months ago) by cebix
Content type: text/plain
Branch: MAIN
CVS Tags: snapshot-21101999, snapshot-22121999, release-0_8-1, snapshot-02111999
Changes since 1.1: +8 -5 lines
Log Message:
- renamed main_volume to speaker_volume and dac_volume to main_volume
  (same for mute)
- added defines for headphone volume/mute

File Contents

# User Rev Content
1 cebix 1.1 /*
2     * audio_defs.h - Definitions for MacOS audio components
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     #ifndef AUDIO_DEFS_H
22     #define AUDIO_DEFS_H
23    
24     // Error codes
25     enum {
26     badComponentSelector = (int32)0x80008002,
27     noHardwareErr = -200,
28     badChannel = -205,
29     siInvalidSampleRate = -225,
30     siInvalidSampleSize = -226,
31     siDeviceBusyErr = -227
32     };
33    
34     // General component dispatch selector codes
35     enum {
36     kComponentOpenSelect = -1,
37     kComponentCloseSelect = -2,
38     kComponentCanDoSelect = -3,
39     kComponentVersionSelect = -4,
40     kComponentRegisterSelect = -5
41     };
42    
43     // Sound component dispatch selector codes
44     enum {
45     kSoundComponentInitOutputDeviceSelect = 1,
46     kSoundComponentSetSourceSelect = 2,
47     kSoundComponentGetSourceSelect = 3,
48     kSoundComponentGetSourceDataSelect = 4,
49     kSoundComponentSetOutputSelect = 5,
50     kDelegatedSoundComponentSelectors = 0x0100,
51     kSoundComponentAddSourceSelect = kDelegatedSoundComponentSelectors + 1,
52     kSoundComponentRemoveSourceSelect = kDelegatedSoundComponentSelectors + 2,
53     kSoundComponentGetInfoSelect = kDelegatedSoundComponentSelectors + 3,
54     kSoundComponentSetInfoSelect = kDelegatedSoundComponentSelectors + 4,
55     kSoundComponentStartSourceSelect = kDelegatedSoundComponentSelectors + 5,
56     kSoundComponentStopSourceSelect = kDelegatedSoundComponentSelectors + 6,
57     kSoundComponentPauseSourceSelect = kDelegatedSoundComponentSelectors + 7,
58     kSoundComponentPlaySourceBufferSelect = kDelegatedSoundComponentSelectors + 8
59     };
60    
61     // Sound information selectors
62     enum {
63 cebix 1.2 siNumberChannels = 'chan', // current number of channels
64     siChannelAvailable = 'chav', // number of channels available
65 cebix 1.1 siSampleRate = 'srat', // current sample rate
66     siSampleRateAvailable = 'srav', // sample rates available
67     siSampleSize = 'ssiz', // current sample size
68     siSampleSizeAvailable = 'ssav', // sample sizes available
69     siHardwareMute = 'hmut', // mute state of all hardware
70     siHardwareVolume = 'hvol', // volume level of all hardware
71     siHardwareVolumeSteps = 'hstp', // number of volume steps for hardware
72 cebix 1.2 siHardwareBusy = 'hwbs', // sound hardware is in use
73     siHeadphoneMute = 'pmut', // mute state of headphone
74     siHeadphoneVolume = 'pvol', // volume level of headphone
75     siHeadphoneVolumeSteps = 'hdst', // number of volume steps for headphone
76     siSpeakerMute = 'smut', // mute state of all built-in speakers
77     siSpeakerVolume = 'svol' // volume level of built-in speaker
78 cebix 1.1 };
79    
80     enum { // ComponentResource struct
81     componentType = 0,
82     componentSubType = 4,
83     componentManufacturer = 8,
84     componentFlags = 12,
85     componentFlagsMask = 16,
86     componentResType = 20,
87     componentResID = 24,
88     componentNameType = 26,
89     componentNameID = 30,
90     componentInfoType = 32,
91     componentInfoID = 36,
92     componentIconType = 38,
93     componentIconID = 42,
94     componentVersion = 44,
95     componentRegisterFlags = 48,
96     componentIconFamily = 52
97     };
98    
99     // Component feature flags
100     enum {
101     k8BitRawIn = (1 << 0),
102     k8BitTwosIn = (1 << 1),
103     k16BitIn = (1 << 2),
104     kStereoIn = (1 << 3),
105     k8BitRawOut = (1 << 8),
106     k8BitTwosOut = (1 << 9),
107     k16BitOut = (1 << 10),
108     kStereoOut = (1 << 11),
109     kReverse = (1L << 16),
110     kRateConvert = (1L << 17),
111     kCreateSoundSource = (1L << 18),
112     kHighQuality = (1L << 22),
113     kNonRealTime = (1L << 23),
114     cmpWantsRegisterMessage = (1L << 31)
115     };
116    
117     enum { // ComponentParameters struct
118     cp_flags = 0, // call modifiers: sync/async, deferred, immed, etc
119     cp_paramSize = 1, // size in bytes of actual parameters passed to this call
120     cp_what = 2, // routine selector, negative for Component management calls
121     cp_params = 4 // actual parameters for the indicated routine
122     };
123    
124     enum { // SoundComponentData struct
125     scd_flags = 0,
126     scd_format = 4,
127     scd_numChannels = 8,
128     scd_sampleSize = 10,
129     scd_sampleRate = 12,
130     scd_sampleCount = 16,
131     scd_buffer = 20,
132     scd_reserved = 24,
133     SIZEOF_scd = 28
134     };
135    
136     enum { // SoundInfoList struct
137     sil_count = 0,
138     sil_infoHandle = 2
139     };
140    
141     #endif