Merge branch 'master' into cairocanvas
[ardour.git] / libs / panners / 1in2out / panner_1in2out.cc
index 2fb2df7e9ab40bbdbfa7cdf65c6239f227603f6a..2d5489f0ce9378700a283de3f11ae8c6ef3d2805 100644 (file)
@@ -63,11 +63,14 @@ using namespace PBD;
 
 static PanPluginDescriptor _descriptor = {
         "Mono to Stereo Panner",
+        "http://ardour.org/plugin/panner_1in2out",
+        "http://ardour.org/plugin/panner_1in2out#ui",
         1, 2, 
+        10000,
         Panner1in2out::factory
 };
 
-extern "C" { PanPluginDescriptor* panner_descriptor () { return &_descriptor; } }
+extern "C" ARDOURPANNER_API PanPluginDescriptor*  panner_descriptor () { return &_descriptor; }
 
 Panner1in2out::Panner1in2out (boost::shared_ptr<Pannable> p)
        : Panner (p)
@@ -121,6 +124,12 @@ Panner1in2out::clamp_position (double& p)
         return true;
 }
 
+pair<double, double>
+Panner1in2out::position_range () const
+{
+       return make_pair (0, 1);
+}
+
 double 
 Panner1in2out::position () const
 {
@@ -326,6 +335,8 @@ XMLNode&
 Panner1in2out::get_state ()
 {
        XMLNode& root (Panner::get_state ());
+       root.add_property (X_("uri"), _descriptor.panner_uri);
+       /* this is needed to allow new sessions to load with old Ardour: */
        root.add_property (X_("type"), _descriptor.name);
        return root;
 }
@@ -364,13 +375,17 @@ Panner1in2out::value_as_string (boost::shared_ptr<AutomationControl> ac) const
                    
                    This is pretty wierd, but its the way audio engineers expect it. Just remember that
                    the center of the USA isn't Kansas, its (50LA, 50NY) and it will all make sense.
+
+                  This is designed to be as narrow as possible. Dedicated
+                  panner GUIs can do their own version of this if they need
+                  something less compact.
                 */
                 
-                return string_compose (_("L:%1 R:%2"), (int) rint (100.0 * (1.0 - val)),
+                return string_compose (_("L%1R%2"), (int) rint (100.0 * (1.0 - val)),
                                        (int) rint (100.0 * val));
                 
         default:
-                return _pannable->value_as_string (ac);
+                return _("unused");
         }
 }