]> git.saurik.com Git - apple/xnu.git/blame - iokit/IOKit/storage/IOCDAudioControlUserClient.h
xnu-123.5.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / IOCDAudioControlUserClient.h
CommitLineData
1c79356b
A
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#ifndef _IOCDAUDIOCONTROLUSERCLIENT_H
24#define _IOCDAUDIOCONTROLUSERCLIENT_H
25
26#include <IOKit/storage/IOCDTypes.h>
27
28/*
29 * Audio Control User Client Methods
30 */
31
32enum
33{
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)
43};
44
45/*
46 * Kernel
47 */
48
49#if defined(KERNEL) && defined(__cplusplus)
50
51#include <IOKit/IOUserClient.h>
52#include <IOKit/storage/IOCDAudioControl.h>
53
54class IOCDAudioControlUserClient : public IOUserClient
55{
56 OSDeclareDefaultStructors(IOCDAudioControlUserClient)
57
58protected:
59
60 struct ExpansionData { /* */ };
61 ExpansionData * _expansionData;
62
63 IOExternalMethod _methods[kIOCDAudioControlMethodCount];
64
65 /*
66 * Get the current audio play status information.
67 */
68
69 virtual IOReturn getStatus(CDAudioStatus * status, UInt32 * statusSize);
70
71 /*
72 * Get the full Table Of Contents.
73 */
74
75 virtual IOReturn getTOC(CDTOC * toc, UInt32 * tocMaxSize);
76
77 /*
78 * Get the current audio volume.
79 */
80
81 virtual IOReturn getVolume(UInt32 * left, UInt32 * right);
82
83 /*
84 * Set the current audio volume.
85 */
86
87 virtual IOReturn setVolume(UInt32 left, UInt32 right);
88
89 /*
90 * Pause or resume the audio playback.
91 */
92
93 virtual IOReturn pause(UInt32 pause);
94
95 /*
96 * Play audio.
97 */
98
99 virtual IOReturn play(UInt32 msfStart, UInt32 msfStop);
100
101 /*
102 * Perform a fast-forward or fast-backward operation.
103 */
104
105 virtual IOReturn scan(UInt32 msfStart, UInt32 reverse);
106
107 /*
108 * Stop the audio playback (or audio scan).
109 */
110
111 virtual IOReturn stop();
112
113public:
114
115 /*
116 * Create a new IOCDAudioControlUserClient.
117 */
118
119 static IOCDAudioControlUserClient * withTask(task_t task);
120
121 /*
122 * Prepare the user client for usage.
123 */
124
125 virtual bool start(IOService * provider);
126
127 /*
128 * Relinquish the user client.
129 */
130
131 virtual IOReturn clientClose();
132
133 /*
134 * Obtain the method definition given a method index.
135 */
136
137 virtual IOExternalMethod * getExternalMethodForIndex(UInt32 index);
138
139 /*
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.
143 */
144
145 virtual IOCDAudioControl * getProvider() const;
146
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);
155};
156
157#endif /* defined(KERNEL) && defined(__cplusplus) */
158
159#endif /* _IOCDAUDIOCONTROLUSERCLIENT_H */