summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_unit.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-02-15 20:37:41 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-02-15 20:37:41 +0000
commit6f0f3d70565b908961ab52af66b392cd346501d9 (patch)
tree8dd8e71ee045b7000efe3462f0bc82fd0785cd77 /libs/ardour/audio_unit.cc
parent73d0395d823eb285963ed2851bcc5af9da21dcd6 (diff)
fix use of basename; AU automation now working; add gtk event reporter back into SAE bundle; fix up carbon menu handler so that it never causes a nested gtk main loop problem
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3062 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_unit.cc')
-rw-r--r--libs/ardour/audio_unit.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index 5e0114c49d..a995ebf8f0 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -216,8 +216,13 @@ AUPlugin::discover_parameters ()
kAudioUnitParameterFlag_IsWritable = (1L << 31)
*/
+ d.lower = info.minValue;
+ d.upper = info.maxValue;
+ d.default_value = info.defaultValue;
+
d.integer_step = (info.unit & kAudioUnitParameterUnit_Indexed);
- d.toggled = (info.unit & kAudioUnitParameterUnit_Boolean);
+ d.toggled = (info.unit & kAudioUnitParameterUnit_Boolean) ||
+ (d.integer_step && ((d.upper - d.lower) == 1.0));
d.sr_dependent = (info.unit & kAudioUnitParameterUnit_SampleFrames);
d.automatable = !d.toggled &&
!(info.flags & kAudioUnitParameterFlag_NonRealTime) &&
@@ -226,9 +231,6 @@ AUPlugin::discover_parameters ()
d.logarithmic = (info.flags & kAudioUnitParameterFlag_DisplayLogarithmic);
d.unit = info.unit;
- d.lower = info.minValue;
- d.upper = info.maxValue;
- d.default_value = info.defaultValue;
d.step = 1.0;
d.smallstep = 0.1;
d.largestep = 10.0;
@@ -278,17 +280,21 @@ AUPlugin::latency () const
void
AUPlugin::set_parameter (uint32_t which, float val)
{
- // unit->SetParameter (id, 0, val);
+ if (which < descriptors.size()) {
+ const AUParameterDescriptor& d (descriptors[which]);
+ unit->SetParameter (d.id, d.scope, d.element, val);
+ }
}
float
AUPlugin::get_parameter (uint32_t which) const
{
- float outValue = 0.0;
-
- // unit->GetParameter(parameter_map[which].first, parameter_map[which].second, 0, outValue);
-
- return outValue;
+ float val = 0.0;
+ if (which < descriptors.size()) {
+ const AUParameterDescriptor& d (descriptors[which]);
+ unit->GetParameter(d.id, d.scope, d.element, val);
+ }
+ return val;
}
int