X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=inline;f=libs%2Fardour%2Fstripable.cc;h=84d2bafccf90ef53b0f4bd07e66b6070e7152bf5;hb=3099d99e0b9c12c500507cc2e3e14015c7364823;hp=a9f8b2b01ac657fb1bf9a324fa2fe353f2529784;hpb=d5127001bb60a8648a277f77e9ae4e8fd5943c9a;p=ardour.git diff --git a/libs/ardour/stripable.cc b/libs/ardour/stripable.cc index a9f8b2b01a..84d2bafccf 100644 --- a/libs/ardour/stripable.cc +++ b/libs/ardour/stripable.cc @@ -26,14 +26,12 @@ #include "ardour/rc_configuration.h" #include "ardour/stripable.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace PBD; using std::string; -PBD::Signal0 Stripable::PresentationInfoChange; - Stripable::Stripable (Session& s, string const & name, PresentationInfo const & pi) : SessionObject (s, name) , _presentation_info (pi) @@ -41,46 +39,15 @@ Stripable::Stripable (Session& s, string const & name, PresentationInfo const & } void -Stripable::set_presentation_group_order (PresentationInfo::order_t order, bool notify_class_listeners) -{ - set_presentation_info (PresentationInfo (order, _presentation_info.flags()), notify_class_listeners); -} - -void -Stripable::set_presentation_group_order_explicit (PresentationInfo::order_t order) +Stripable::set_presentation_order (PresentationInfo::order_t order, bool notify_class_listeners) { - set_presentation_group_order (order, false); -} - -void -Stripable::set_presentation_info (PresentationInfo pi, bool notify_class_listeners) -{ - if (pi != presentation_info()) { - - DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1: set edit-based RID to %2\n", name(), pi)); - - if (is_master()) { - _presentation_info = PresentationInfo (0, PresentationInfo::MasterOut); - } else if (is_monitor()) { - _presentation_info = PresentationInfo (0, PresentationInfo::MonitorOut); - } else { - _presentation_info = pi; - } - - PresentationInfoChanged (); + _presentation_info.set_order (order); - if (notify_class_listeners) { - PresentationInfoChange (); - } + if (notify_class_listeners) { + PresentationInfo::Change (); } } -void -Stripable::set_presentation_info_explicit (PresentationInfo pi) -{ - set_presentation_info (pi, false); -} - int Stripable::set_state (XMLNode const& node, int version) { @@ -94,10 +61,8 @@ Stripable::set_state (XMLNode const& node, int version) for (niter = nlist.begin(); niter != nlist.end(); ++niter){ child = *niter; - if (child->name() == X_("PresentationInfo")) { - if ((prop = child->property (X_("value"))) != 0) { - _presentation_info = prop->value (); - } + if (child->name() == PresentationInfo::state_node_name) { + _presentation_info.set_state (*child, version); } } @@ -134,18 +99,10 @@ Stripable::set_state (XMLNode const& node, int version) if (!_presentation_info.special()) { if ((prop = node.property (X_("order-key"))) != 0) { - _presentation_info.set_group_order (atol (prop->value())); + _presentation_info.set_order (atol (prop->value())); } } } return 0; } - -void -Stripable::add_state (XMLNode& node) const -{ - XMLNode* remote_control_node = new XMLNode (X_("PresentationInfo")); - remote_control_node->add_property (X_("value"), _presentation_info.to_string()); - node.add_child_nocopy (*remote_control_node); -}