summaryrefslogtreecommitdiff
path: root/libs/ardour/ladspa_plugin.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-12 23:20:37 +0000
committerDavid Robillard <d@drobilla.net>2007-04-12 23:20:37 +0000
commit959a7909c1adca430a63f783fd16687242a7be3d (patch)
treeb5048c3cc1bbb60bb680472b97ebba6ebb92d72f /libs/ardour/ladspa_plugin.cc
parent96ca08b9257e4048294cd1804a65d4ae6cd88814 (diff)
Merged with trunk R1705.
Synced .po files with trunk. Fixed more editor operations to be type agnostic (ie not audio only). git-svn-id: svn://localhost/ardour2/branches/midi@1709 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ladspa_plugin.cc')
-rw-r--r--libs/ardour/ladspa_plugin.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc
index ba944f3c08..082d673fbc 100644
--- a/libs/ardour/ladspa_plugin.cc
+++ b/libs/ardour/ladspa_plugin.cc
@@ -195,6 +195,7 @@ LadspaPlugin::default_value (uint32_t port)
float ret = 0.0f;
bool bounds_given = false;
bool sr_scaling = false;
+ bool earlier_hint = false;
/* defaults - case 1 */
@@ -203,6 +204,7 @@ LadspaPlugin::default_value (uint32_t port)
ret = prh[port].LowerBound;
bounds_given = true;
sr_scaling = true;
+ earlier_hint = true;
}
/* FIXME: add support for logarithmic defaults */
@@ -211,33 +213,41 @@ LadspaPlugin::default_value (uint32_t port)
ret = prh[port].LowerBound * 0.75f + prh[port].UpperBound * 0.25f;
bounds_given = true;
sr_scaling = true;
+ earlier_hint = true;
}
else if (LADSPA_IS_HINT_DEFAULT_MIDDLE(prh[port].HintDescriptor)) {
ret = prh[port].LowerBound * 0.50f + prh[port].UpperBound * 0.50f;
bounds_given = true;
sr_scaling = true;
+ earlier_hint = true;
}
else if (LADSPA_IS_HINT_DEFAULT_HIGH(prh[port].HintDescriptor)) {
ret = prh[port].LowerBound * 0.25f + prh[port].UpperBound * 0.75f;
bounds_given = true;
sr_scaling = true;
+ earlier_hint = true;
}
else if (LADSPA_IS_HINT_DEFAULT_MAXIMUM(prh[port].HintDescriptor)) {
ret = prh[port].UpperBound;
bounds_given = true;
sr_scaling = true;
+ earlier_hint = true;
}
else if (LADSPA_IS_HINT_DEFAULT_0(prh[port].HintDescriptor)) {
ret = 0.0f;
+ earlier_hint = true;
}
else if (LADSPA_IS_HINT_DEFAULT_1(prh[port].HintDescriptor)) {
ret = 1.0f;
+ earlier_hint = true;
}
else if (LADSPA_IS_HINT_DEFAULT_100(prh[port].HintDescriptor)) {
ret = 100.0f;
+ earlier_hint = true;
}
else if (LADSPA_IS_HINT_DEFAULT_440(prh[port].HintDescriptor)) {
ret = 440.0f;
+ earlier_hint = true;
}
else {
/* no hint found */
@@ -290,7 +300,7 @@ LadspaPlugin::default_value (uint32_t port)
/* defaults - case 5 */
- if (LADSPA_IS_HINT_SAMPLE_RATE(prh[port].HintDescriptor)) {
+ if (LADSPA_IS_HINT_SAMPLE_RATE(prh[port].HintDescriptor) && !earlier_hint) {
if (bounds_given) {
if (sr_scaling) {
ret *= sample_rate;