Remove wrong asserts
[ardour.git] / libs / ardour / stripable.cc
index c21d68c0a6cabbe61991bd869c11483d9676e399..84d2bafccf90ef53b0f4bd07e66b6070e7152bf5 100644 (file)
 #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<void> Stripable::PresentationInfoChange;
-
 Stripable::Stripable (Session& s, string const & name, PresentationInfo const & pi)
        : SessionObject (s, name)
        , _presentation_info (pi)
@@ -41,48 +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()) {
-
-#ifndef __APPLE__
-               /* clang can't deal with the operator<< (ostream&,PresentationInfo&) method. not sure why yet. */
-               DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("%1: set presentation info to %2\n", name(), pi));
-#endif
-               if (is_master()) {
-                       _presentation_info = PresentationInfo (0, PresentationInfo::MasterOut);
-               } else if (is_monitor()) {
-                       _presentation_info = PresentationInfo (0, PresentationInfo::MonitorOut);
-               } else {
-                       _presentation_info = pi;
-               }
+       _presentation_info.set_order (order);
 
-               PresentationInfoChanged ();
-
-               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)
 {
@@ -96,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);
                        }
                }
 
@@ -136,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);
-}