]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/storage/IOCDAudioControl.h
xnu-124.13.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / IOCDAudioControl.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 /*!
24 * @header IOCDAudioControl
25 * @abstract
26 * This header contains the IOCDAudioControl class definition.
27 */
28
29 #ifndef _IOCDAUDIOCONTROL_H
30 #define _IOCDAUDIOCONTROL_H
31
32 /*!
33 * @defined kIOCDAudioControlClass
34 * @abstract
35 * kIOCDAudioControlClass is the name of the IOCDAudioControl class.
36 * @discussion
37 * kIOCDAudioControlClass is the name of the IOCDAudioControl class.
38 */
39
40 #define kIOCDAudioControlClass "IOCDAudioControl"
41
42 /*
43 * Kernel
44 */
45
46 #if defined(KERNEL) && defined(__cplusplus)
47
48 #include <IOKit/storage/IOCDBlockStorageDriver.h>
49
50 /*!
51 * @class IOCDAudioControl
52 * @discussion
53 * This class is the protocol for CD audio control functionality, independent of
54 * the physical connection protocol (eg. SCSI, ATA, USB). Any methods that deal
55 * with audio play and/or volume are here.
56 */
57
58 class IOCDAudioControl : public IOService
59 {
60 OSDeclareDefaultStructors(IOCDAudioControl)
61
62 protected:
63
64 struct ExpansionData { /* */ };
65 ExpansionData * _expansionData;
66
67 /*
68 * Create a new IOCDAudioControlUserClient.
69 */
70
71 virtual IOReturn newUserClient( task_t task,
72 void * security,
73 UInt32 type,
74 IOUserClient ** object );
75
76 public:
77
78 /*!
79 * @function getStatus
80 * @abstract
81 * Get the current audio play status information.
82 * @param status
83 * The buffer for the returned information.
84 */
85
86 virtual IOReturn getStatus(CDAudioStatus * status);
87
88 /*!
89 * @function getTOC
90 * @abstract
91 * Get the full Table Of Contents.
92 * @result
93 * Returns a pointer to the TOC buffer (do not deallocate).
94 */
95
96 virtual CDTOC * getTOC(void);
97
98 /*!
99 * @function getVolume
100 * @abstract
101 * Get the current audio volume.
102 * @param left
103 * A pointer to the returned left-channel volume.
104 * @param right
105 * A pointer to the returned right-channel volume.
106 */
107
108 virtual IOReturn getVolume(UInt8 * left, UInt8 * right);
109
110 /*!
111 * @function setVolume
112 * @abstract
113 * Set the current audio volume.
114 * @param left
115 * The desired left-channel volume.
116 * @param right
117 * The desired right-channel volume.
118 */
119
120 virtual IOReturn setVolume(UInt8 left, UInt8 right);
121
122 /*!
123 * @function pause
124 * @abstract
125 * Pause or resume the audio playback.
126 * @param pause
127 * True to pause playback; False to resume.
128 */
129
130 virtual IOReturn pause(bool pause);
131
132 /*!
133 * @function play
134 * @abstract
135 * Play audio.
136 * @param timeStart
137 * The M:S:F address from which to begin.
138 * @param timeStop
139 * The M:S:F address at which to stop.
140 */
141
142 virtual IOReturn play(CDMSF timeStart, CDMSF timeStop);
143
144 /*!
145 * @function scan
146 * @abstract
147 * Perform a fast-forward or fast-backward operation.
148 * @param timeStart
149 * The M:S:F address from which to begin.
150 * @param reverse
151 * True to go backward; False to go forward.
152 */
153
154 virtual IOReturn scan(CDMSF timeStart, bool reverse);
155
156 /*!
157 * @function stop
158 * @abstract
159 * Stop the audio playback (or audio scan).
160 */
161
162 virtual IOReturn stop();
163
164 /*
165 * Obtain this object's provider. We override the superclass's method to
166 * return a more specific subclass of IOService -- IOCDBlockStorageDriver.
167 * This method serves simply as a convenience to subclass developers.
168 */
169
170 virtual IOCDBlockStorageDriver * getProvider() const;
171
172 OSMetaClassDeclareReservedUnused(IOCDAudioControl, 0);
173 OSMetaClassDeclareReservedUnused(IOCDAudioControl, 1);
174 OSMetaClassDeclareReservedUnused(IOCDAudioControl, 2);
175 OSMetaClassDeclareReservedUnused(IOCDAudioControl, 3);
176 OSMetaClassDeclareReservedUnused(IOCDAudioControl, 4);
177 OSMetaClassDeclareReservedUnused(IOCDAudioControl, 5);
178 OSMetaClassDeclareReservedUnused(IOCDAudioControl, 6);
179 OSMetaClassDeclareReservedUnused(IOCDAudioControl, 7);
180 };
181
182 #endif /* defined(KERNEL) && defined(__cplusplus) */
183
184 #endif /* !_IOCDAUDIOCONTROL_H */