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