1/*
2 * Copyright (c) 1998-2010 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 _IOKIT_IOAUDIOTOGGLECONTROL_H
24#define _IOKIT_IOAUDIOTOGGLECONTROL_H
25
26#ifndef IOAUDIOFAMILY_SELF_BUILD
27#include <IOKit/audio/IOAudioControl.h>
28#else
29#include "IOAudioControl.h"
30#endif
31
32/*!
33 * @class IOAudioToggleControl
34 */
35
36class IOAudioToggleControl : public IOAudioControl
37{
38    OSDeclareDefaultStructors(IOAudioToggleControl)
39
40protected:
41    struct ExpansionData { };
42
43    ExpansionData *reserved;
44
45// New code added here
46public:
47    /*!
48     * @function createPassThruMuteControl
49     * @abstract Allocates a new pass through mute control with the given attributes
50     * @param initialValue The initial value of the control
51     * @param channelID The ID of the channel(s) that the control acts on.  Common IDs are located in IOAudioTypes.h.
52     * @param channelName An optional name for the channel.  Common names are located in IOAudioPort.h.
53     * @param cntrlID An optional ID for the control that can be used to uniquely identify controls
54     * @result Returns a newly allocated and initialized mute IOAudioControl
55     */
56	static IOAudioToggleControl *createPassThruMuteControl (bool initialValue,
57																UInt32 channelID,
58																const char *channelName,
59																UInt32 cntrlID);
60
61private:
62    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 0);
63    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 1);
64    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 2);
65    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 3);
66    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 4);
67    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 5);
68    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 6);
69    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 7);
70    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 8);
71    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 9);
72    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 10);
73    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 11);
74    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 12);
75    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 13);
76    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 14);
77    OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 15);
78
79public:
80    /*!
81     * @function create
82     * @abstract Allocates a new mute control with the given attributes
83     * @param initialValue The initial value of the control
84     * @param channelID The ID of the channel(s) that the control acts on.  Common IDs are located in IOAudioTypes.h.
85     * @param channelName An optional name for the channel.  Common names are located in IOAudioPort.h.
86     * @param cntrlID An optional ID for the control that can be used to uniquely identify controls
87     * @result Returns a newly allocated and initialized mute IOAudioControl
88     */
89    static IOAudioToggleControl *create(bool initialValue,
90                                        UInt32 channelID,
91                                        const char *channelName = 0,
92                                        UInt32 cntrlID = 0,
93                                        UInt32 subType = 0,
94                                        UInt32 usage = 0);
95
96    static IOAudioToggleControl *createMuteControl(bool initialValue,
97                                                    UInt32 channelID,
98                                                    const char *channelName = 0,
99                                                    UInt32 cntrlID = 0,
100                                                    UInt32 usage = 0);
101
102    /*!
103     * @function init
104     * @abstract Initializes a newly allocated IOAudioToggleControl with the given attributes
105     * @param initialValue The initial value of the control
106     * @param channelID The ID of the channel(s) that the control acts on.  Common IDs are located in IOAudioTypes.h.
107     * @param channelName An optional name for the channel.  Common names are located in IOAudioPort.h.
108     * @param cntrlID An optional ID for the control that can be used to uniquely identify controls
109     * @result Returns truen on success
110     */
111    virtual bool init(bool initialValue,
112                      UInt32 channelID,
113                      const char *channelName = 0,
114                      UInt32 cntrlID = 0,
115                      UInt32 subType = 0,
116                      UInt32 usage = 0,
117                      OSDictionary *properties = 0);
118
119};
120
121#endif /* _IOKIT_IOAUDIOTOGGLECONTROL_H */
122