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 #include <IOKit/storage/IOCDAudioControl.h>
24 #include <IOKit/storage/IOCDAudioControlUserClient.h>
25 #include <IOKit/storage/IOCDBlockStorageDriver.h>
27 #define super IOService
28 OSDefineMetaClassAndStructors(IOCDAudioControl
, IOService
)
30 IOCDBlockStorageDriver
*
31 IOCDAudioControl::getProvider() const
33 return (IOCDBlockStorageDriver
*) IOService::getProvider();
37 IOCDAudioControl::getStatus(CDAudioStatus
*status
)
39 return(getProvider()->getAudioStatus(status
));
43 IOCDAudioControl::getTOC(void)
45 return(getProvider()->getTOC());
49 IOCDAudioControl::getVolume(UInt8
*left
,UInt8
*right
)
51 return(getProvider()->getAudioVolume(left
,right
));
55 IOCDAudioControl::newUserClient(task_t task
,
56 void * /* security */,
58 IOUserClient
** object
)
61 IOReturn err
= kIOReturnSuccess
;
62 IOCDAudioControlUserClient
* client
;
64 client
= IOCDAudioControlUserClient::withTask(task
);
66 if( !client
|| (false == client
->attach( this )) ||
67 (false == client
->start( this )) ) {
69 client
->detach( this );
72 err
= kIOReturnNoMemory
;
80 IOCDAudioControl::pause(bool pause
)
82 return(getProvider()->audioPause(pause
));
86 IOCDAudioControl::play(CDMSF timeStart
,CDMSF timeStop
)
88 return(getProvider()->audioPlay(timeStart
,timeStop
));
92 IOCDAudioControl::scan(CDMSF timeStart
,bool reverse
)
94 return(getProvider()->audioScan(timeStart
,reverse
));
98 IOCDAudioControl::stop()
100 return(getProvider()->audioStop());
104 IOCDAudioControl::setVolume(UInt8 left
,UInt8 right
)
106 return(getProvider()->setAudioVolume(left
,right
));
109 OSMetaClassDefineReservedUnused(IOCDAudioControl
, 0);
110 OSMetaClassDefineReservedUnused(IOCDAudioControl
, 1);
111 OSMetaClassDefineReservedUnused(IOCDAudioControl
, 2);
112 OSMetaClassDefineReservedUnused(IOCDAudioControl
, 3);
113 OSMetaClassDefineReservedUnused(IOCDAudioControl
, 4);
114 OSMetaClassDefineReservedUnused(IOCDAudioControl
, 5);
115 OSMetaClassDefineReservedUnused(IOCDAudioControl
, 6);
116 OSMetaClassDefineReservedUnused(IOCDAudioControl
, 7);