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)
return true;
}
+pair<double, double>
+Panner1in2out::position_range () const
+{
+ return make_pair (0, 1);
+}
+
double
Panner1in2out::position () const
{
Panner*
-Panner1in2out::factory (boost::shared_ptr<Pannable> p, Speakers& /* ignored */)
+Panner1in2out::factory (boost::shared_ptr<Pannable> p, boost::shared_ptr<Speakers> /* ignored */)
{
return new Panner1in2out (p);
}
XMLNode&
-Panner1in2out::get_state (void)
-{
- return state (true);
-}
-
-XMLNode&
-Panner1in2out::state (bool /*full_state*/)
+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;
}
-int
-Panner1in2out::set_state (const XMLNode& node, int version)
-{
- LocaleGuard lg (X_("POSIX"));
- Panner::set_state (node, version);
- return 0;
-}
std::set<Evoral::Parameter>
Panner1in2out::what_can_be_automated() const
return _pannable->describe_parameter (p);
}
}
+
+string
+Panner1in2out::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:
+ /* We show the position of the center of the image relative to the left & right.
+ This is expressed as a pair of percentage values that ranges from (100,0)
+ (hard left) through (50,50) (hard center) to (0,100) (hard right).
+
+ 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%1R%2"), (int) rint (100.0 * (1.0 - val)),
+ (int) rint (100.0 * val));
+
+ default:
+ return _("unused");
+ }
+}
+
+void
+Panner1in2out::reset ()
+{
+ set_position (0.5);
+ update ();
+}