more MIDI I/O debugging output
[ardour2.git] / libs / appleutility / AUParamInfo.h
blob8e446394c4b189f296164dfec596fbfd5d878546
1 /* Copyright: © Copyright 2005 Apple Computer, Inc. All rights reserved.
3 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
4 ("Apple") in consideration of your agreement to the following terms, and your
5 use, installation, modification or redistribution of this Apple software
6 constitutes acceptance of these terms. If you do not agree with these terms,
7 please do not use, install, modify or redistribute this Apple software.
9 In consideration of your agreement to abide by the following terms, and subject
10 to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
11 copyrights in this original Apple software (the "Apple Software"), to use,
12 reproduce, modify and redistribute the Apple Software, with or without
13 modifications, in source and/or binary forms; provided that if you redistribute
14 the Apple Software in its entirety and without modifications, you must retain
15 this notice and the following text and disclaimers in all such redistributions of
16 the Apple Software. Neither the name, trademarks, service marks or logos of
17 Apple Computer, Inc. may be used to endorse or promote products derived from the
18 Apple Software without specific prior written permission from Apple. Except as
19 expressly stated in this notice, no other rights or licenses, express or implied,
20 are granted by Apple herein, including but not limited to any patent rights that
21 may be infringed by your derivative works or by other works in which the Apple
22 Software may be incorporated.
24 The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
25 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
26 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
28 COMBINATION WITH YOUR PRODUCTS.
30 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
31 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
34 OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
35 (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
36 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 /*=============================================================================
39 AUParamInfo.h
41 =============================================================================*/
42 #include <map>
43 #include <vector>
44 #include <AudioUnit/AudioUnit.h>
45 #include "CAAUParameter.h"
48 The ParameterMap returned by the Map() method is a map where
49 - the key is the clumpID
50 - the value is a ParameterList (vector<CAAUParameter>)
52 If you have parameters on multiple scopes (or elements within a scope), then you should create one of these
53 for each scope-element pair
56 class AUParamInfo {
58 public:
59 typedef std::vector <CAAUParameter> ParameterList;
60 typedef std::map <UInt32, ParameterList, std::less<UInt32> > ParameterMap;
64 AUParamInfo (AudioUnit inAU,
65 bool inIncludeExpert,
66 bool inIncludeReadOnly,
67 AudioUnitScope inScope = kAudioUnitScope_Global,
68 AudioUnitElement inElement = 0);
70 ~AUParamInfo();
72 const ParameterMap& Map () const { return mParams; }
74 // some convenience methods
75 UInt32 NumParams () const { return mNumParams; }
77 AudioUnitParameterID ParamID (UInt32 inIndex) const
79 if (inIndex < mNumParams) return mParamListID[inIndex];
80 return 0xFFFFFFFF;
83 UInt32 NumClumps () const { return mParams.size(); }
85 UInt32 NumParamsForClump (UInt32 inClump) const;
87 // returns NULL if there's no info for the parameter
88 const CAAUParameter* GetParamInfo (AudioUnitParameterID inParamID) const;
90 AudioUnitScope GetScope () const { return mScope; }
91 AudioUnitElement GetElement () const { return mElement; }
93 private:
95 AudioUnit mAU;
96 UInt32 mNumParams;
97 AudioUnitParameterID * mParamListID;
99 ParameterMap mParams;
100 AudioUnitScope mScope;
101 AudioUnitElement mElement;
103 // disallow
104 AUParamInfo () {}
105 AUParamInfo (const AUParamInfo &) {}
106 AUParamInfo& operator= (const AUParamInfo&) { return *this; }