2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
23 #ifndef _IOCDAUDIOCONTROLUSERCLIENT_H
24 #define _IOCDAUDIOCONTROLUSERCLIENT_H
26 #include <IOKit/storage/IOCDTypes.h>
29 * Audio Control User Client Methods
34 kIOCDAudioControlMethodGetStatus
, // IOCDAudioControlUserClient::getStatus()
35 kIOCDAudioControlMethodGetTOC
, // IOCDAudioControlUserClient::getTOC()
36 kIOCDAudioControlMethodGetVolume
, // IOCDAudioControlUserClient::getVolume()
37 kIOCDAudioControlMethodSetVolume
, // IOCDAudioControlUserClient::setVolume()
38 kIOCDAudioControlMethodPause
, // IOCDAudioControlUserClient::pause()
39 kIOCDAudioControlMethodPlay
, // IOCDAudioControlUserClient::play()
40 kIOCDAudioControlMethodScan
, // IOCDAudioControlUserClient::scan()
41 kIOCDAudioControlMethodStop
, // IOCDAudioControlUserClient::stop()
42 kIOCDAudioControlMethodCount
// (total number of methods supported)
49 #if defined(KERNEL) && defined(__cplusplus)
51 #include <IOKit/IOUserClient.h>
52 #include <IOKit/storage/IOCDAudioControl.h>
54 class IOCDAudioControlUserClient
: public IOUserClient
56 OSDeclareDefaultStructors(IOCDAudioControlUserClient
)
60 struct ExpansionData
{ /* */ };
61 ExpansionData
* _expansionData
;
63 IOExternalMethod _methods
[kIOCDAudioControlMethodCount
];
66 * Get the current audio play status information.
69 virtual IOReturn
getStatus(CDAudioStatus
* status
, UInt32
* statusSize
);
72 * Get the full Table Of Contents.
75 virtual IOReturn
getTOC(CDTOC
* toc
, UInt32
* tocMaxSize
);
78 * Get the current audio volume.
81 virtual IOReturn
getVolume(UInt32
* left
, UInt32
* right
);
84 * Set the current audio volume.
87 virtual IOReturn
setVolume(UInt32 left
, UInt32 right
);
90 * Pause or resume the audio playback.
93 virtual IOReturn
pause(UInt32 pause
);
99 virtual IOReturn
play(UInt32 msfStart
, UInt32 msfStop
);
102 * Perform a fast-forward or fast-backward operation.
105 virtual IOReturn
scan(UInt32 msfStart
, UInt32 reverse
);
108 * Stop the audio playback (or audio scan).
111 virtual IOReturn
stop();
116 * Create a new IOCDAudioControlUserClient.
119 static IOCDAudioControlUserClient
* withTask(task_t task
);
122 * Prepare the user client for usage.
125 virtual bool start(IOService
* provider
);
128 * Relinquish the user client.
131 virtual IOReturn
clientClose();
134 * Obtain the method definition given a method index.
137 virtual IOExternalMethod
* getExternalMethodForIndex(UInt32 index
);
140 * Obtain this object's provider. We override the superclass's method
141 * to return a more specific subclass of IOService -- IOCDAudioControl.
142 * This method serves simply as a convenience to subclass developers.
145 virtual IOCDAudioControl
* getProvider() const;
147 OSMetaClassDeclareReservedUnused(IOCDAudioControlUserClient
, 0);
148 OSMetaClassDeclareReservedUnused(IOCDAudioControlUserClient
, 1);
149 OSMetaClassDeclareReservedUnused(IOCDAudioControlUserClient
, 2);
150 OSMetaClassDeclareReservedUnused(IOCDAudioControlUserClient
, 3);
151 OSMetaClassDeclareReservedUnused(IOCDAudioControlUserClient
, 4);
152 OSMetaClassDeclareReservedUnused(IOCDAudioControlUserClient
, 5);
153 OSMetaClassDeclareReservedUnused(IOCDAudioControlUserClient
, 6);
154 OSMetaClassDeclareReservedUnused(IOCDAudioControlUserClient
, 7);
157 #endif /* defined(KERNEL) && defined(__cplusplus) */
159 #endif /* _IOCDAUDIOCONTROLUSERCLIENT_H */