summaryrefslogtreecommitdiff
path: root/libs/panners/vbap
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-01-27 18:48:33 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-01-27 18:48:33 +0000
commitd116af22db3c0e0cf6aeff6194a689d8bfad7c8c (patch)
treec3d9888d5020d8e6bf02532ea06adc388d9033f5 /libs/panners/vbap
parent85e8be3fa4f4910907d731a4591bf5e7d5135ca6 (diff)
virtualize the way that AutomationController gets strings to display values, so that we can callback through the owner of an AutomationControl, not just rely on the value from the AutomationControl; make pan automation tracks use this to display more audio-centric values
git-svn-id: svn://localhost/ardour2/branches/3.0@8590 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/panners/vbap')
-rw-r--r--libs/panners/vbap/vbap.cc18
-rw-r--r--libs/panners/vbap/vbap.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/libs/panners/vbap/vbap.cc b/libs/panners/vbap/vbap.cc
index 6088a2d0d6..239a253f19 100644
--- a/libs/panners/vbap/vbap.cc
+++ b/libs/panners/vbap/vbap.cc
@@ -313,3 +313,21 @@ VBAPanner::describe_parameter (Evoral::Parameter p)
return _pannable->describe_parameter (p);
}
}
+
+string
+VBAPanner::value_as_string (boost::shared_ptr<AutomationControl> ac) const
+{
+ /* DO NOT USE LocaleGuard HERE */
+ double val = ac->get_value();
+
+ switch (ac->parameter().type()) {
+ case PanAzimuthAutomation: /* direction */
+ return string_compose (_("%1"), val * 360.0);
+
+ case PanWidthAutomation: /* diffusion */
+ return string_compose (_("%1%%"), (int) floor (100.0 * fabs(val)));
+
+ default:
+ return _pannable->value_as_string (ac);
+ }
+}
diff --git a/libs/panners/vbap/vbap.h b/libs/panners/vbap/vbap.h
index 2b80b032cb..cf010cc331 100644
--- a/libs/panners/vbap/vbap.h
+++ b/libs/panners/vbap/vbap.h
@@ -53,6 +53,7 @@ public:
void set_azimuth_elevation (double azimuth, double elevation);
std::string describe_parameter (Evoral::Parameter);
+ std::string value_as_string (boost::shared_ptr<AutomationControl>) const;
XMLNode& state (bool full_state);
XMLNode& get_state ();