1 /* Copyright © 2007 Apple Inc. All Rights Reserved.
3 Disclaimer: IMPORTANT: This Apple software is supplied to you by
4 Apple Inc. ("Apple") in consideration of your agreement to the
5 following terms, and your use, installation, modification or
6 redistribution of this Apple software constitutes acceptance of these
7 terms. If you do not agree with these terms, please do not use,
8 install, modify or redistribute this Apple software.
10 In consideration of your agreement to abide by the following terms, and
11 subject to these terms, Apple grants you a personal, non-exclusive
12 license, under Apple's copyrights in this original Apple software (the
13 "Apple Software"), to use, reproduce, modify and redistribute the Apple
14 Software, with or without modifications, in source and/or binary forms;
15 provided that if you redistribute the Apple Software in its entirety and
16 without modifications, you must retain this notice and the following
17 text and disclaimers in all such redistributions of the Apple Software.
18 Neither the name, trademarks, service marks or logos of Apple Inc.
19 may be used to endorse or promote products derived from the Apple
20 Software without specific prior written permission from Apple. Except
21 as expressly stated in this notice, no other rights or licenses, express
22 or implied, are granted by Apple herein, including but not limited to
23 any patent rights that may be infringed by your derivative works or by
24 other works in which the Apple Software may be incorporated.
26 The Apple Software is provided by Apple on an "AS IS" basis. APPLE
27 MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
28 THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
29 FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
30 OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
32 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
33 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35 INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
36 MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
37 AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
38 STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
39 POSSIBILITY OF SUCH DAMAGE.
41 /*=============================================================================
44 =============================================================================*/
46 #ifndef __AUMIDIBase_h__
47 #define __AUMIDIBase_h__
52 #include "CAAUMIDIMapManager.h"
55 struct MIDIPacketList
;
57 // ________________________________________________________________________
60 /*! @class AUMIDIBase */
63 // this is NOT a copy constructor!
64 /*! @ctor AUMIDIBase */
65 AUMIDIBase(AUBase
* inBase
);
66 /*! @dtor ~AUMIDIBase */
67 virtual ~AUMIDIBase();
69 /*! @method MIDIEvent */
70 ComponentResult
MIDIEvent( UInt32 inStatus
,
73 UInt32 inOffsetSampleFrame
)
75 UInt32 strippedStatus
= inStatus
& 0xf0;
76 UInt32 channel
= inStatus
& 0x0f;
78 return HandleMidiEvent(strippedStatus
, channel
, inData1
, inData2
, inOffsetSampleFrame
);
81 /*! @method HandleMIDIPacketList */
82 ComponentResult
HandleMIDIPacketList(const MIDIPacketList
*pktlist
);
85 ComponentResult
SysEx( const UInt8
* inData
,
88 #if TARGET_API_MAC_OSX
89 /*! @method DelegateGetPropertyInfo */
90 virtual ComponentResult
DelegateGetPropertyInfo(AudioUnitPropertyID inID
,
91 AudioUnitScope inScope
,
92 AudioUnitElement inElement
,
94 Boolean
& outWritable
);
96 /*! @method DelegateGetProperty */
97 virtual ComponentResult
DelegateGetProperty( AudioUnitPropertyID inID
,
98 AudioUnitScope inScope
,
99 AudioUnitElement inElement
,
102 /*! @method DelegateSetProperty */
103 virtual ComponentResult
DelegateSetProperty( AudioUnitPropertyID inID
,
104 AudioUnitScope inScope
,
105 AudioUnitElement inElement
,
112 /*! @method HandleMidiEvent */
113 virtual OSStatus
HandleMidiEvent( UInt8 inStatus
,
117 UInt32 inStartFrame
);
119 /*! @method HandleNonNoteEvent */
120 virtual OSStatus
HandleNonNoteEvent ( UInt8 status
,
124 UInt32 inStartFrame
);
126 #if TARGET_API_MAC_OSX
127 /*! @method GetXMLNames */
128 virtual ComponentResult
GetXMLNames(CFURLRef
*outNameDocument
)
129 { return kAudioUnitErr_InvalidProperty
; } // if not overridden, it's unsupported
133 /*! @method HandleNoteOn */
134 virtual OSStatus
HandleNoteOn( UInt8 inChannel
,
137 UInt32 inStartFrame
) { return noErr
; }
139 /*! @method HandleNoteOff */
140 virtual OSStatus
HandleNoteOff( UInt8 inChannel
,
143 UInt32 inStartFrame
) { return noErr
; }
145 /*! @method HandleControlChange */
146 virtual OSStatus
HandleControlChange( UInt8 inChannel
,
149 UInt32 inStartFrame
) { return noErr
; }
151 /*! @method HandlePitchWheel */
152 virtual OSStatus
HandlePitchWheel( UInt8 inChannel
,
155 UInt32 inStartFrame
) { return noErr
; }
157 /*! @method HandleChannelPressure */
158 virtual OSStatus
HandleChannelPressure( UInt8 inChannel
,
160 UInt32 inStartFrame
) { return noErr
; }
162 /*! @method HandleProgramChange */
163 virtual OSStatus
HandleProgramChange( UInt8 inChannel
,
164 UInt8 inValue
) { return noErr
; }
166 /*! @method HandlePolyPressure */
167 virtual OSStatus
HandlePolyPressure( UInt8 inChannel
,
170 UInt32 inStartFrame
) { return noErr
; }
172 /*! @method HandleResetAllControllers */
173 virtual OSStatus
HandleResetAllControllers(UInt8 inChannel
) { return noErr
; }
175 /*! @method HandleAllNotesOff */
176 virtual OSStatus
HandleAllNotesOff( UInt8 inChannel
) { return noErr
; }
178 /*! @method HandleAllSoundOff */
179 virtual OSStatus
HandleAllSoundOff( UInt8 inChannel
) { return noErr
; }
183 /*! @method HandleSysEx */
184 virtual OSStatus
HandleSysEx( const UInt8
* inData
,
185 UInt32 inLength
) { return noErr
; }
189 CAAUMIDIMapManager
*GetMIDIMapManager() {return mMapManager
;};
195 /*! @var mAUBaseInstance */
196 AUBase
& mAUBaseInstance
;
200 CAAUMIDIMapManager
* mMapManager
;
204 // component dispatcher
205 /*! @method ComponentEntryDispatch */
206 static ComponentResult
ComponentEntryDispatch( ComponentParameters
*params
,
210 #endif // __AUMIDIBase_h__