better handling of the inverse-push of solo-by-upstream. still not quite right, but...
[ardour.git] / libs / ardour / bundle.cc
index cd416c6a6775ce3935a7cf2bb64365d635669df6..f409e0beee4eb1493e9696a3f772a4564213539f 100644 (file)
@@ -432,3 +432,60 @@ Bundle::connected_to (boost::shared_ptr<Bundle> other, AudioEngine & engine)
 
        return true;
 }
+
+/** Set the type of the ports in this Bundle.
+ *  @param t New type.
+ */
+void
+Bundle::set_type (DataType t)
+{
+       _type = t;
+       emit_changed (TypeChanged);
+}
+
+void
+Bundle::set_ports_are_inputs ()
+{
+       _ports_are_inputs = true;
+       emit_changed (DirectionChanged);
+}
+
+void
+Bundle::set_ports_are_outputs ()
+{
+       _ports_are_inputs = false;
+       emit_changed (DirectionChanged);
+}
+
+/** Set the name.
+ *  @param n New name.
+ */
+void
+Bundle::set_name (string const & n)
+{
+       _name = n;
+       emit_changed (NameChanged);
+}
+
+/** @param b Other bundle.
+ *  @return true if b has the same number of channels as this bundle, and those channels have corresponding ports.
+ */
+bool
+Bundle::has_same_ports (boost::shared_ptr<Bundle> b) const
+{
+       uint32_t const N = nchannels ();
+
+       if (b->nchannels() != N) {
+               return false;
+       }
+
+       /* XXX: probably should sort channel port lists before comparing them */
+
+       for (uint32_t i = 0; i < N; ++i) {
+               if (channel_ports (i) != b->channel_ports (i)) {
+                       return false;
+               }
+       }
+
+       return true;
+}