summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-08 02:19:20 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-08 02:19:20 +0000
commit606a65321d72fe354db49f0c74a5c6968eb87a53 (patch)
tree00dd95a5d8d6dc92f215bb456fbc3bf6ddb99c76 /libs
parent9a539fd347543ee2f1ba14507570085e2e7b4ea7 (diff)
Label panner automation sliders the same as panners.
git-svn-id: svn://localhost/ardour2/branches/3.0@7563 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/panner.h2
-rw-r--r--libs/ardour/panner.cc23
2 files changed, 25 insertions, 0 deletions
diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h
index abee3431ce..62512f6181 100644
--- a/libs/ardour/ardour/panner.h
+++ b/libs/ardour/ardour/panner.h
@@ -303,6 +303,8 @@ public:
return automation_control (Evoral::Parameter (PanAutomation, chan, id));
}
+ static std::string value_as_string (double);
+
private:
/* disallow copy construction */
Panner (Panner const &);
diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc
index b224bf558e..c400199943 100644
--- a/libs/ardour/panner.cc
+++ b/libs/ardour/panner.cc
@@ -29,6 +29,7 @@
#include <locale.h>
#include <unistd.h>
#include <float.h>
+#include <iomanip>
#include <glibmm.h>
@@ -1640,3 +1641,25 @@ Panner::set_mono (bool yn)
(*i)->set_mono (yn);
}
}
+
+string
+Panner::value_as_string (double v)
+{
+ if (Panner::equivalent (v, 0.5)) {
+ return _("C");
+ } else if (equivalent (v, 0)) {
+ return _("L");
+ } else if (equivalent (v, 1)) {
+ return _("R");
+ } else if (v < 0.5) {
+ stringstream s;
+ s << fixed << setprecision (0) << _("L") << ((0.5 - v) * 200) << "%";
+ return s.str();
+ } else {
+ stringstream s;
+ s << fixed << setprecision (0) << _("R") << ((v -0.5) * 200) << "%";
+ return s.str ();
+ }
+
+ return "";
+}