3 Abstract: Part of CoreAudio Utility Classes
6 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 Inc. ("Apple") in consideration of your agreement to the following
8 terms, and your use, installation, modification or redistribution of
9 this Apple software constitutes acceptance of these terms. If you do
10 not agree with these terms, please do not use, install, modify or
11 redistribute this Apple software.
13 In consideration of your agreement to abide by the following terms, and
14 subject to these terms, Apple grants you a personal, non-exclusive
15 license, under Apple's copyrights in this original Apple software (the
16 "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 Software, with or without modifications, in source and/or binary forms;
18 provided that if you redistribute the Apple Software in its entirety and
19 without modifications, you must retain this notice and the following
20 text and disclaimers in all such redistributions of the Apple Software.
21 Neither the name, trademarks, service marks or logos of Apple Inc. may
22 be used to endorse or promote products derived from the Apple Software
23 without specific prior written permission from Apple. Except as
24 expressly stated in this notice, no other rights or licenses, express or
25 implied, are granted by Apple herein, including but not limited to any
26 patent rights that may be infringed by your derivative works or by other
27 works in which the Apple Software may be incorporated.
29 The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
35 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 POSSIBILITY OF SUCH DAMAGE.
44 Copyright (C) 2014 Apple Inc. All Rights Reserved.
47 #ifndef __AUMIDIBase_h__
48 #define __AUMIDIBase_h__
53 #include "CAAUMIDIMapManager.h"
56 struct MIDIPacketList;
58 // ________________________________________________________________________
61 /*! @class AUMIDIBase */
64 // this is NOT a copy constructor!
65 /*! @ctor AUMIDIBase */
66 AUMIDIBase(AUBase* inBase);
67 /*! @dtor ~AUMIDIBase */
68 virtual ~AUMIDIBase();
70 /*! @method MIDIEvent */
71 virtual OSStatus MIDIEvent( UInt32 inStatus,
74 UInt32 inOffsetSampleFrame)
76 UInt32 strippedStatus = inStatus & 0xf0;
77 UInt32 channel = inStatus & 0x0f;
79 return HandleMidiEvent(strippedStatus, channel, inData1, inData2, inOffsetSampleFrame);
82 /*! @method HandleMIDIPacketList */
83 OSStatus HandleMIDIPacketList(const MIDIPacketList *pktlist);
86 virtual OSStatus SysEx( const UInt8 * inData,
89 #if TARGET_API_MAC_OSX
90 /*! @method DelegateGetPropertyInfo */
91 virtual OSStatus DelegateGetPropertyInfo(AudioUnitPropertyID inID,
92 AudioUnitScope inScope,
93 AudioUnitElement inElement,
95 Boolean & outWritable);
97 /*! @method DelegateGetProperty */
98 virtual OSStatus DelegateGetProperty( AudioUnitPropertyID inID,
99 AudioUnitScope inScope,
100 AudioUnitElement inElement,
103 /*! @method DelegateSetProperty */
104 virtual OSStatus DelegateSetProperty( AudioUnitPropertyID inID,
105 AudioUnitScope inScope,
106 AudioUnitElement inElement,
113 /*! @method HandleMidiEvent */
114 virtual OSStatus HandleMidiEvent( UInt8 inStatus,
118 UInt32 inStartFrame);
120 /*! @method HandleNonNoteEvent */
121 virtual OSStatus HandleNonNoteEvent ( UInt8 status,
125 UInt32 inStartFrame);
127 #if TARGET_API_MAC_OSX
128 /*! @method GetXMLNames */
129 virtual OSStatus GetXMLNames(CFURLRef *outNameDocument)
130 { return kAudioUnitErr_InvalidProperty; } // if not overridden, it's unsupported
134 /*! @method HandleNoteOn */
135 virtual OSStatus HandleNoteOn( UInt8 inChannel,
138 UInt32 inStartFrame) { return noErr; }
140 /*! @method HandleNoteOff */
141 virtual OSStatus HandleNoteOff( UInt8 inChannel,
144 UInt32 inStartFrame) { return noErr; }
146 /*! @method HandleControlChange */
147 virtual OSStatus HandleControlChange( UInt8 inChannel,
150 UInt32 inStartFrame) { return noErr; }
152 /*! @method HandlePitchWheel */
153 virtual OSStatus HandlePitchWheel( UInt8 inChannel,
156 UInt32 inStartFrame) { return noErr; }
158 /*! @method HandleChannelPressure */
159 virtual OSStatus HandleChannelPressure( UInt8 inChannel,
161 UInt32 inStartFrame) { return noErr; }
163 /*! @method HandleProgramChange */
164 virtual OSStatus HandleProgramChange( UInt8 inChannel,
165 UInt8 inValue) { return noErr; }
167 /*! @method HandlePolyPressure */
168 virtual OSStatus HandlePolyPressure( UInt8 inChannel,
171 UInt32 inStartFrame) { return noErr; }
173 /*! @method HandleResetAllControllers */
174 virtual OSStatus HandleResetAllControllers(UInt8 inChannel) { return noErr; }
176 /*! @method HandleAllNotesOff */
177 virtual OSStatus HandleAllNotesOff( UInt8 inChannel) { return noErr; }
179 /*! @method HandleAllSoundOff */
180 virtual OSStatus HandleAllSoundOff( UInt8 inChannel) { return noErr; }
184 /*! @method HandleSysEx */
185 virtual OSStatus HandleSysEx( const UInt8 * inData,
186 UInt32 inLength ) { return noErr; }
190 CAAUMIDIMapManager *GetMIDIMapManager() {return mMapManager;};
196 /*! @var mAUBaseInstance */
197 AUBase & mAUBaseInstance;
201 CAAUMIDIMapManager * mMapManager;
205 #if !CA_USE_AUDIO_PLUGIN_ONLY
206 // component dispatcher
207 /*! @method ComponentEntryDispatch */
208 static OSStatus ComponentEntryDispatch( ComponentParameters *params,
213 #endif // __AUMIDIBase_h__