+
+/** 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;
+}