diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-05 15:11:43 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-05 16:33:01 -0400 |
commit | d58cb3daa3f0e091a11e3846b28e83bcf0f93587 (patch) | |
tree | 236589d3d5d43da42f3086c1bb88d9be4f02f05f /libs/ardour/stripable.cc | |
parent | e3e77475cd3e248652ccabd66aaf9ba6edeec3f1 (diff) |
extensive changes to PresentationInfo API
Now handles color, partially.
Diffstat (limited to 'libs/ardour/stripable.cc')
-rw-r--r-- | libs/ardour/stripable.cc | 55 |
1 files changed, 8 insertions, 47 deletions
diff --git a/libs/ardour/stripable.cc b/libs/ardour/stripable.cc index 4fe3fb4287..2a86ef2529 100644 --- a/libs/ardour/stripable.cc +++ b/libs/ardour/stripable.cc @@ -32,8 +32,6 @@ 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,46 +39,19 @@ 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) -{ - set_presentation_group_order (order, false); -} - -void -Stripable::set_presentation_info (PresentationInfo pi, bool notify_class_listeners) +Stripable::set_presentation_order (PresentationInfo::order_t order, 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) +Stripable::set_presentation_order_explicit (PresentationInfo::order_t order) { - set_presentation_info (pi, false); + _presentation_info.set_order (order); } int @@ -96,10 +67,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); } } @@ -143,11 +112,3 @@ Stripable::set_state (XMLNode const& node, int version) 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); -} |