#include <ardour/send.h>
#include <ardour/insert.h>
#include <ardour/ladspa_plugin.h>
-#include <ardour/connection.h>
-#include <ardour/session_connection.h>
+#include <ardour/bundle.h>
+#include <ardour/session_bundle.h>
#include "ardour_ui.h"
#include "ardour_dialog.h"
citems.push_back (MenuElem (_("Disconnect"), mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_output)));
citems.push_back (SeparatorElem());
- _session.foreach_connection (this, &MixerStrip::add_connection_to_output_menu);
+ _session.foreach_bundle (this, &MixerStrip::add_bundle_to_output_menu);
output_menu.popup (1, ev->time);
break;
citems.push_back (MenuElem (_("Disconnect"), mem_fun (*(static_cast<RouteUI*>(this)), &RouteUI::disconnect_input)));
citems.push_back (SeparatorElem());
- _session.foreach_connection (this, &MixerStrip::add_connection_to_input_menu);
+ _session.foreach_bundle (this, &MixerStrip::add_bundle_to_input_menu);
input_menu.popup (1, ev->time);
break;
}
void
-MixerStrip::connection_input_chosen (ARDOUR::Connection *c)
+MixerStrip::bundle_input_chosen (ARDOUR::Bundle *c)
{
if (!ignore_toggle) {
try {
- _route->use_input_connection (*c, this);
+ _route->use_input_bundle (*c, this);
}
catch (AudioEngine::PortRegistrationFailure& err) {
- error << _("could not register new ports required for that connection")
+ error << _("could not register new ports required for that bundle")
<< endmsg;
}
}
}
void
-MixerStrip::connection_output_chosen (ARDOUR::Connection *c)
+MixerStrip::bundle_output_chosen (ARDOUR::Bundle *c)
{
if (!ignore_toggle) {
try {
- _route->use_output_connection (*c, this);
+ _route->use_output_bundle (*c, this);
}
catch (AudioEngine::PortRegistrationFailure& err) {
- error << _("could not register new ports required for that connection")
+ error << _("could not register new ports required for that bundle")
<< endmsg;
}
}
}
void
-MixerStrip::add_connection_to_input_menu (ARDOUR::Connection* c)
+MixerStrip::add_bundle_to_input_menu (ARDOUR::Bundle* c)
{
using namespace Menu_Helpers;
- if (dynamic_cast<InputConnection *> (c) == 0) {
+ if (dynamic_cast<InputBundle *> (c) == 0) {
return;
}
MenuList& citems = input_menu.items();
- if (c->nports() == _route->n_inputs().get_total()) {
+ if (c->nchannels() == _route->n_inputs().get_total()) {
- citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::connection_input_chosen), c)));
+ citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::bundle_input_chosen), c)));
- ARDOUR::Connection *current = _route->input_connection();
+ ARDOUR::Bundle *current = _route->input_bundle();
if (current == c) {
ignore_toggle = true;
}
void
-MixerStrip::add_connection_to_output_menu (ARDOUR::Connection* c)
+MixerStrip::add_bundle_to_output_menu (ARDOUR::Bundle* c)
{
using namespace Menu_Helpers;
- if (dynamic_cast<OutputConnection *> (c) == 0) {
+ if (dynamic_cast<OutputBundle *> (c) == 0) {
return;
}
- if (c->nports() == _route->n_outputs().get_total()) {
+ if (c->nchannels() == _route->n_outputs().get_total()) {
MenuList& citems = output_menu.items();
- citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::connection_output_chosen), c)));
+ citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::bundle_output_chosen), c)));
- ARDOUR::Connection *current = _route->output_connection();
+ ARDOUR::Bundle *current = _route->output_bundle();
if (current == c) {
ignore_toggle = true;
void
MixerStrip::update_input_display ()
{
- ARDOUR::Connection *c;
+ ARDOUR::Bundle *c;
- if ((c = _route->input_connection()) != 0) {
+ if ((c = _route->input_bundle()) != 0) {
input_label.set_text (c->name());
} else {
switch (_width) {
void
MixerStrip::update_output_display ()
{
- ARDOUR::Connection *c;
+ ARDOUR::Bundle *c;
- if ((c = _route->output_connection()) != 0) {
+ if ((c = _route->output_bundle()) != 0) {
output_label.set_text (c->name());
} else {
switch (_width) {
class Insert;
class Session;
class PortInsert;
- class Connection;
+ class Bundle;
class Plugin;
}
namespace Gtk {
gint output_press (GdkEventButton *);
Gtk::Menu input_menu;
- void add_connection_to_input_menu (ARDOUR::Connection *);
+ void add_bundle_to_input_menu (ARDOUR::Bundle *);
Gtk::Menu output_menu;
- void add_connection_to_output_menu (ARDOUR::Connection *);
+ void add_bundle_to_output_menu (ARDOUR::Bundle *);
- void connection_input_chosen (ARDOUR::Connection *);
- void connection_output_chosen (ARDOUR::Connection *);
+ void bundle_input_chosen (ARDOUR::Bundle *);
+ void bundle_output_chosen (ARDOUR::Bundle *);
void edit_input_configuration ();
void edit_output_configuration ();
#include <ardour/send.h>
#include <ardour/insert.h>
#include <ardour/ladspa_plugin.h>
-#include <ardour/connection.h>
-#include <ardour/session_connection.h>
#include "ardour_ui.h"
#include "ardour_dialog.h"
class RouteRedirectSelection;
namespace ARDOUR {
- class Connection;
+ class Bundle;
class Insert;
class Plugin;
class PluginInsert;
#include <ardour/audio_track.h>
#include <ardour/send.h>
#include <ardour/insert.h>
-#include <ardour/connection.h>
-#include <ardour/session_connection.h>
#include "route_params_ui.h"
#include "keyboard.h"
ardour.Append(CPPPATH = '#libs/surfaces/control_protocol')
ardour_files=Split("""
+bundle.cc
chan_count.cc
diskstream.cc
directory_names.cc
automation.cc
automation_event.cc
configuration.cc
-connection.cc
control_protocol_manager.cc
crossfade.cc
curve.cc
--- /dev/null
+/*
+ Copyright (C) 2002 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_bundle_h__
+#define __ardour_bundle_h__
+
+#include <vector>
+#include <string>
+#include <sigc++/signal.h>
+#include <glibmm/thread.h>
+#include <pbd/stateful.h>
+
+using std::vector;
+using std::string;
+
+namespace ARDOUR {
+
+/**
+ * A set of `channels', each of which is associated with 0 or more
+ * JACK ports.
+ */
+
+class Bundle : public Stateful, public sigc::trackable {
+ public:
+ /**
+ * Bundle constructor.
+ * @param name Name for this Bundle.
+ * @param dy true if this Bundle is `dynamic', ie it is created on-the-fly
+ * and should not be written to the session file.
+ */
+ Bundle (string name, bool dy = false) : _name (name), _dynamic(dy) {}
+ ~Bundle() {}
+
+ /// A vector of JACK port names
+ typedef vector<string> PortList;
+
+ void set_name (string name, void *src);
+
+ /**
+ * @return name of this Bundle.
+ */
+ string name() const { return _name; }
+
+ /**
+ * @return true if this Bundle is marked as `dynamic', meaning
+ * that it won't be written to the session file.
+ */
+ bool dynamic() const { return _dynamic; }
+
+ /**
+ * @return Number of channels that this Bundle has.
+ */
+ uint32_t nchannels () const { return _channels.size(); }
+ const PortList& channel_ports (int ch) const;
+
+ void set_nchannels (int n);
+
+ void add_port_to_channel (int ch, string portname);
+ void remove_port_from_channel (int ch, string portname);
+
+ /// Our name changed
+ sigc::signal<void, void*> NameChanged;
+ /// The number of channels changed
+ sigc::signal<void> ConfigurationChanged;
+ /// The ports associated with one of our channels changed
+ sigc::signal<void, int> PortsChanged;
+
+ bool operator==(const Bundle& other) const;
+
+ XMLNode& get_state (void);
+ int set_state (const XMLNode&);
+
+ protected:
+ Bundle (const XMLNode&);
+
+ private:
+ mutable Glib::Mutex channels_lock; ///< mutex for _channels
+ vector<PortList> _channels; ///< list of JACK ports associated with each of our channels
+ string _name; ///< name
+ bool _dynamic; ///< true if `dynamic', ie not to be written to the session file
+
+ int set_channels (const string& str);
+ int parse_io_string (const string& str, vector<string>& ports);
+};
+
+/**
+ * Bundle in which the JACK ports are inputs.
+ */
+
+class InputBundle : public Bundle {
+ public:
+ /**
+ * InputBundle constructor.
+ * \param name Name.
+ * \param dy true if this Bundle is `dynamic'; ie it is created on-the-fly
+ * and should not be written to the session file.
+ */
+ InputBundle (string name, bool dy = false) : Bundle (name, dy) {}
+ InputBundle (const XMLNode&);
+};
+
+/**
+ * Bundle in which the JACK ports are outputs.
+ */
+
+class OutputBundle : public Bundle {
+ public:
+ OutputBundle (string name, bool dy = false) : Bundle (name, dy) {}
+ OutputBundle (const XMLNode&);
+};
+
+}
+
+#endif /* __ardour_bundle_h__ */
+
+++ /dev/null
-/*
- Copyright (C) 2002 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __ardour_connection_h__
-#define __ardour_connection_h__
-
-#include <vector>
-#include <string>
-#include <sigc++/signal.h>
-#include <glibmm/thread.h>
-#include <pbd/stateful.h>
-
-using std::vector;
-using std::string;
-
-namespace ARDOUR {
-
-class Connection : public Stateful, public sigc::trackable {
- public:
- Connection (string name, bool sdep = false) : _name (name), _sysdep(sdep) {}
- ~Connection() {}
-
- typedef vector<string> PortList;
-
- void set_name (string name, void *src);
- string name() const { return _name; }
-
- bool system_dependent() const { return _sysdep; }
-
- uint32_t nports () const { return _ports.size(); }
- const PortList& port_connections (int port) const;
-
- void add_connection (int port, string portname);
- void remove_connection (int port, string portname);
-
- void add_port ();
- void remove_port (int port);
- void clear ();
-
- sigc::signal<void,void*> NameChanged;
- sigc::signal<void> ConfigurationChanged;
- sigc::signal<void,int> ConnectionsChanged;
-
- bool operator==(const Connection& other) const;
-
- XMLNode& get_state (void);
- int set_state (const XMLNode&);
-
- protected:
- Connection (const XMLNode&);
-
- private:
- mutable Glib::Mutex port_lock;
- vector<PortList> _ports;
- string _name;
- bool _sysdep;
-
- int set_connections (const string& str);
- int parse_io_string (const string& str, vector<string>& ports);
-};
-
-class InputConnection : public Connection {
- public:
- InputConnection (string name, bool sdep = false) : Connection (name, sdep) {}
- InputConnection (const XMLNode&);
-};
-
-class OutputConnection : public Connection {
- public:
- OutputConnection (string name, bool sdep = false) : Connection (name, sdep) {}
- OutputConnection (const XMLNode&);
-};
-
-}
-
-#endif /* __ardour_connection_h__ */
-
class Session;
class AudioEngine;
-class Connection;
+class Bundle;
class Panner;
class PeakMeter;
class Port;
int ensure_io (ChanCount in, ChanCount out, bool clear, void *src);
- int use_input_connection (Connection&, void *src);
- int use_output_connection (Connection&, void *src);
+ int use_input_bundle (Bundle&, void *src);
+ int use_output_bundle (Bundle&, void *src);
- Connection *input_connection() const { return _input_connection; }
- Connection *output_connection() const { return _output_connection; }
+ Bundle *input_bundle() const { return _input_bundle; }
+ Bundle *output_bundle() const { return _output_bundle; }
int add_input_port (string source, void *src, DataType type = DataType::NIL);
int add_output_port (string destination, void *src, DataType type = DataType::NIL);
PortSet _inputs;
PeakMeter* _meter;
string _name;
- Connection* _input_connection;
- Connection* _output_connection;
+ Bundle* _input_bundle;
+ Bundle* _output_bundle;
bool no_panner_reset;
bool _phase_invert;
XMLNode* deferred_state;
/* are these the best variable names ever, or what? */
- sigc::connection input_connection_configuration_connection;
- sigc::connection output_connection_configuration_connection;
- sigc::connection input_connection_connection_connection;
- sigc::connection output_connection_connection_connection;
+ sigc::connection input_bundle_configuration_connection;
+ sigc::connection output_bundle_configuration_connection;
+ sigc::connection input_bundle_connection_connection;
+ sigc::connection output_bundle_connection_connection;
static bool panners_legal;
int ensure_inputs (ChanCount, bool clear, bool lockit, void *src);
int ensure_outputs (ChanCount, bool clear, bool lockit, void *src);
- void drop_input_connection ();
- void drop_output_connection ();
+ void drop_input_bundle ();
+ void drop_output_bundle ();
- void input_connection_configuration_changed ();
- void input_connection_connection_changed (int);
- void output_connection_configuration_changed ();
- void output_connection_connection_changed (int);
+ void input_bundle_configuration_changed ();
+ void input_bundle_connection_changed (int);
+ void output_bundle_configuration_changed ();
+ void output_bundle_connection_changed (int);
int create_ports (const XMLNode&);
int make_connections (const XMLNode&);
class Redirect;
class PortInsert;
class PluginInsert;
-class Connection;
+class Bundle;
class TempoMap;
class AudioTrack;
class NamedSelection;
nframes_t available_capture_duration();
- /* I/O Connections */
+ /* I/O bundles */
- template<class T> void foreach_connection (T *obj, void (T::*func)(Connection *));
- void add_connection (Connection *);
- void remove_connection (Connection *);
- Connection *connection_by_name (string) const;
+ template<class T> void foreach_bundle (T *obj, void (T::*func)(Bundle *));
+ void add_bundle (Bundle *);
+ void remove_bundle (Bundle *);
+ Bundle *bundle_by_name (string) const;
- sigc::signal<void,Connection *> ConnectionAdded;
- sigc::signal<void,Connection *> ConnectionRemoved;
+ sigc::signal<void,Bundle *> BundleAdded;
+ sigc::signal<void,Bundle *> BundleRemoved;
/* MIDI */
mutable gint _playback_load_min;
mutable gint _capture_load_min;
- /* I/O Connections */
+ /* I/O bundles */
- typedef list<Connection *> ConnectionList;
- mutable Glib::Mutex connection_lock;
- ConnectionList _connections;
- int load_connections (const XMLNode&);
+ typedef list<Bundle *> BundleList;
+ mutable Glib::Mutex bundle_lock;
+ BundleList _bundles;
+ int load_bundles (const XMLNode&);
void reverse_diskstream_buffers ();
--- /dev/null
+/*
+ Copyright (C) 2002 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_session_bundle_h__
+#define __ardour_session_bundle_h__
+
+#include <ardour/session.h>
+#include <ardour/bundle.h>
+
+namespace ARDOUR {
+
+template<class T> void
+Session::foreach_bundle (T *obj, void (T::*func)(Bundle *))
+{
+ Glib::Mutex::Lock lm (bundle_lock);
+ for (BundleList::iterator i = _bundles.begin(); i != _bundles.end(); i++) {
+ (obj->*func) (*i);
+ }
+}
+
+} /* namespace */
+
+#endif /* __ardour_session_bundle_h__ */
+++ /dev/null
-/*
- Copyright (C) 2002 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __ardour_session_connection_h__
-#define __ardour_session_connection_h__
-
-#include <ardour/session.h>
-#include <ardour/connection.h>
-
-namespace ARDOUR {
-
-template<class T> void
-Session::foreach_connection (T *obj, void (T::*func)(Connection *))
-{
- Glib::Mutex::Lock lm (connection_lock);
- for (ConnectionList::iterator i = _connections.begin(); i != _connections.end(); i++) {
- (obj->*func) (*i);
- }
-}
-
-} /* namespace */
-
-#endif /* __ardour_session_connection_h__ */
}
if ((prop = node.property ("input-connection")) != 0) {
- Connection* c = _session.connection_by_name (prop->value());
+ Bundle* c = _session.bundle_by_name (prop->value());
if (c == 0) {
- error << string_compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown bundle \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
- if ((c = _session.connection_by_name (_("in 1"))) == 0) {
- error << _("No input connections available as a replacement")
+ if ((c = _session.bundle_by_name (_("in 1"))) == 0) {
+ error << _("No input bundles available as a replacement")
<< endmsg;
return -1;
} else {
- info << string_compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
+ info << string_compose (_("Bundle %1 was not available - \"in 1\" used instead"), prop->value())
<< endmsg;
}
}
- use_input_connection (*c, this);
+ use_input_bundle(*c, this);
} else if ((prop = node.property ("inputs")) != 0) {
if (set_inputs (prop->value())) {
--- /dev/null
+/*
+ Copyright (C) 2002 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <algorithm>
+
+#include <pbd/failed_constructor.h>
+#include <ardour/ardour.h>
+#include <ardour/bundle.h>
+#include <pbd/xml++.h>
+
+#include "i18n.h"
+
+using namespace ARDOUR;
+using namespace PBD;
+
+/** Construct a Bundle from an XML node.
+ * @param node XML node.
+ */
+Bundle::Bundle (const XMLNode& node)
+{
+ if (set_state (node)) {
+ throw failed_constructor();
+ }
+}
+
+/** Construct an InputBundle from an XML node.
+ * @param node XML node.
+ */
+InputBundle::InputBundle (const XMLNode& node)
+ : Bundle (node)
+{
+
+}
+
+/** Construct an OutputBundle from an XML node.
+ * @param node XML node.
+ */
+OutputBundle::OutputBundle (const XMLNode& node)
+ : Bundle (node)
+{
+
+}
+
+/** Set the name.
+ * @param name New name.
+ */
+void
+Bundle::set_name (string name, void *src)
+{
+ _name = name;
+ NameChanged (src);
+}
+
+/** Add an association between one of our channels and a JACK port.
+ * @param ch Channel index.
+ * @param portname JACK port name to associate with.
+ */
+void
+Bundle::add_port_to_channel (int ch, string portname)
+{
+ {
+ Glib::Mutex::Lock lm (channels_lock);
+ _channels[ch].push_back (portname);
+ }
+
+ PortsChanged (ch); /* EMIT SIGNAL */
+}
+
+/** Disassociate a JACK port from one of our channels.
+ * @param ch Channel index.
+ * @param portname JACK port name to disassociate from.
+ */
+
+void
+Bundle::remove_port_from_channel (int ch, string portname)
+{
+ bool changed = false;
+
+ {
+ Glib::Mutex::Lock lm (channels_lock);
+ PortList& pl = _channels[ch];
+ PortList::iterator i = find (pl.begin(), pl.end(), portname);
+
+ if (i != pl.end()) {
+ pl.erase (i);
+ changed = true;
+ }
+ }
+
+ if (changed) {
+ PortsChanged (ch); /* EMIT SIGNAL */
+ }
+}
+
+/**
+ * @param ch Channel index.
+ * @return List of JACK ports that this channel is connected to.
+ */
+const Bundle::PortList&
+Bundle::channel_ports (int ch) const
+{
+ Glib::Mutex::Lock lm (channels_lock);
+ return _channels[ch];
+}
+
+/** operator== for Bundles; they are equal if their channels are the same.
+ * @param other Bundle to compare with this one.
+ */
+bool
+Bundle::operator== (const Bundle& other) const
+{
+ return other._channels == _channels;
+}
+
+
+/** Set the number of channels.
+ * @param n New number of channels.
+ */
+
+void
+Bundle::set_nchannels (int n)
+{
+ {
+ Glib::Mutex::Lock lm (channels_lock);
+ _channels.clear ();
+ for (int i = 0; i < n; ++i) {
+ _channels.push_back (PortList());
+ }
+ }
+
+ ConfigurationChanged (); /* EMIT SIGNAL */
+}
+
+XMLNode&
+Bundle::get_state ()
+{
+ XMLNode *node;
+ string str;
+
+ if (dynamic_cast<InputBundle *> (this)) {
+ node = new XMLNode ("InputConnection");
+ } else {
+ node = new XMLNode ("OutputConnection");
+ }
+
+ node->add_property ("name", _name);
+
+ for (vector<PortList>::iterator i = _channels.begin(); i != _channels.end(); ++i) {
+
+ str += '{';
+
+ for (vector<string>::iterator ii = (*i).begin(); ii != (*i).end(); ++ii) {
+ if (ii != (*i).begin()) {
+ str += ',';
+ }
+ str += *ii;
+ }
+ str += '}';
+ }
+
+ node->add_property ("connections", str);
+
+ return *node;
+}
+
+int
+Bundle::set_state (const XMLNode& node)
+{
+ const XMLProperty *prop;
+
+ if ((prop = node.property ("name")) == 0) {
+ error << _("Node for Connection has no \"name\" property") << endmsg;
+ return -1;
+ }
+
+ _name = prop->value();
+ _dynamic = false;
+
+ if ((prop = node.property ("connections")) == 0) {
+ error << _("Node for Connection has no \"connections\" property") << endmsg;
+ return -1;
+ }
+
+ set_channels (prop->value());
+
+ return 0;
+}
+
+/** Set up channels from an XML property string.
+ * @param str String.
+ * @return 0 on success, -1 on error.
+ */
+int
+Bundle::set_channels (const string& str)
+{
+ vector<string> ports;
+ int i;
+ int n;
+ int nchannels;
+
+ if ((nchannels = count (str.begin(), str.end(), '{')) == 0) {
+ return 0;
+ }
+
+ set_nchannels (nchannels);
+
+ string::size_type start, end, ostart;
+
+ ostart = 0;
+ start = 0;
+ end = 0;
+ i = 0;
+
+ while ((start = str.find_first_of ('{', ostart)) != string::npos) {
+ start += 1;
+
+ if ((end = str.find_first_of ('}', start)) == string::npos) {
+ error << string_compose(_("IO: badly formed string in XML node for inputs \"%1\""), str) << endmsg;
+ return -1;
+ }
+
+ if ((n = parse_io_string (str.substr (start, end - start), ports)) < 0) {
+ error << string_compose(_("bad input string in XML node \"%1\""), str) << endmsg;
+
+ return -1;
+
+ } else if (n > 0) {
+
+ for (int x = 0; x < n; ++x) {
+ add_port_to_channel (i, ports[x]);
+ }
+ }
+
+ ostart = end+1;
+ i++;
+ }
+
+ return 0;
+}
+
+int
+Bundle::parse_io_string (const string& str, vector<string>& ports)
+{
+ string::size_type pos, opos;
+
+ if (str.length() == 0) {
+ return 0;
+ }
+
+ pos = 0;
+ opos = 0;
+
+ ports.clear ();
+
+ while ((pos = str.find_first_of (',', opos)) != string::npos) {
+ ports.push_back (str.substr (opos, pos - opos));
+ opos = pos + 1;
+ }
+
+ if (opos < str.length()) {
+ ports.push_back (str.substr(opos));
+ }
+
+ return ports.size();
+}
+
+++ /dev/null
-/*
- Copyright (C) 2002 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <algorithm>
-
-#include <pbd/failed_constructor.h>
-#include <ardour/ardour.h>
-#include <ardour/connection.h>
-#include <pbd/xml++.h>
-
-#include "i18n.h"
-
-using namespace ARDOUR;
-using namespace PBD;
-
-Connection::Connection (const XMLNode& node)
-{
- if (set_state (node)) {
- throw failed_constructor();
- }
-}
-
-InputConnection::InputConnection (const XMLNode& node)
- : Connection (node)
-{
-}
-
-OutputConnection::OutputConnection (const XMLNode& node)
- : Connection (node)
-{
-}
-
-void
-Connection::set_name (string name, void *src)
-{
- _name = name;
- NameChanged (src);
-}
-
-void
-Connection::add_connection (int port, string portname)
-{
- {
- Glib::Mutex::Lock lm (port_lock);
- _ports[port].push_back (portname);
- }
- ConnectionsChanged (port); /* EMIT SIGNAL */
-}
-
-void
-Connection::remove_connection (int port, string portname)
-{
- bool changed = false;
-
- {
- Glib::Mutex::Lock lm (port_lock);
- PortList& pl = _ports[port];
- PortList::iterator i = find (pl.begin(), pl.end(), portname);
-
- if (i != pl.end()) {
- pl.erase (i);
- changed = true;
- }
- }
-
- if (changed) {
- ConnectionsChanged (port); /* EMIT SIGNAL */
- }
-}
-
-const Connection::PortList&
-Connection::port_connections (int port) const
-{
- Glib::Mutex::Lock lm (port_lock);
- return _ports[port];
-}
-
-bool
-Connection::operator== (const Connection& other) const
-{
- return other._ports == _ports;
-}
-
-void
-Connection::add_port ()
-{
- {
- Glib::Mutex::Lock lm (port_lock);
- _ports.push_back (PortList());
- }
- ConfigurationChanged(); /* EMIT SIGNAL */
-}
-
-void
-Connection::remove_port (int which_port)
-{
- bool changed = false;
-
- {
- Glib::Mutex::Lock lm (port_lock);
- vector<PortList>::iterator i;
- int n;
-
- for (n = 0, i = _ports.begin(); i != _ports.end() && n < which_port; ++i, ++n);
-
- if (i != _ports.end()) {
- _ports.erase (i);
- changed = true;
- }
- }
-
- if (changed) {
- ConfigurationChanged(); /* EMIT SIGNAL */
- }
-}
-
-void
-Connection::clear ()
-{
- {
- Glib::Mutex::Lock lm (port_lock);
- _ports.clear ();
- }
-
- ConfigurationChanged(); /* EMIT SIGNAL */
-}
-
-XMLNode&
-Connection::get_state ()
-{
- XMLNode *node;
- string str;
-
- if (dynamic_cast<InputConnection *> (this)) {
- node = new XMLNode ("InputConnection");
- } else {
- node = new XMLNode ("OutputConnection");
- }
-
- node->add_property ("name", _name);
-
- for (vector<PortList>::iterator i = _ports.begin(); i != _ports.end(); ++i) {
-
- str += '{';
-
- for (vector<string>::iterator ii = (*i).begin(); ii != (*i).end(); ++ii) {
- if (ii != (*i).begin()) {
- str += ',';
- }
- str += *ii;
- }
- str += '}';
- }
-
- node->add_property ("connections", str);
-
- return *node;
-}
-
-int
-Connection::set_state (const XMLNode& node)
-{
- const XMLProperty *prop;
-
- if ((prop = node.property ("name")) == 0) {
- error << _("Node for Connection has no \"name\" property") << endmsg;
- return -1;
- }
-
- _name = prop->value();
- _sysdep = false;
-
- if ((prop = node.property ("connections")) == 0) {
- error << _("Node for Connection has no \"connections\" property") << endmsg;
- return -1;
- }
-
- set_connections (prop->value());
-
- return 0;
-}
-
-int
-Connection::set_connections (const string& str)
-{
- vector<string> ports;
- int i;
- int n;
- int nports;
-
- if ((nports = count (str.begin(), str.end(), '{')) == 0) {
- return 0;
- }
-
- for (n = 0; n < nports; ++n) {
- add_port ();
- }
-
- string::size_type start, end, ostart;
-
- ostart = 0;
- start = 0;
- end = 0;
- i = 0;
-
- while ((start = str.find_first_of ('{', ostart)) != string::npos) {
- start += 1;
-
- if ((end = str.find_first_of ('}', start)) == string::npos) {
- error << string_compose(_("IO: badly formed string in XML node for inputs \"%1\""), str) << endmsg;
- return -1;
- }
-
- if ((n = parse_io_string (str.substr (start, end - start), ports)) < 0) {
- error << string_compose(_("bad input string in XML node \"%1\""), str) << endmsg;
-
- return -1;
-
- } else if (n > 0) {
-
- for (int x = 0; x < n; ++x) {
- add_connection (i, ports[x]);
- }
- }
-
- ostart = end+1;
- i++;
- }
-
- return 0;
-}
-
-int
-Connection::parse_io_string (const string& str, vector<string>& ports)
-{
- string::size_type pos, opos;
-
- if (str.length() == 0) {
- return 0;
- }
-
- pos = 0;
- opos = 0;
-
- ports.clear ();
-
- while ((pos = str.find_first_of (',', opos)) != string::npos) {
- ports.push_back (str.substr (opos, pos - opos));
- opos = pos + 1;
- }
-
- if (opos < str.length()) {
- ports.push_back (str.substr(opos));
- }
-
- return ports.size();
-}
-
#include <ardour/port.h>
#include <ardour/audio_port.h>
#include <ardour/midi_port.h>
-#include <ardour/connection.h>
+#include <ardour/bundle.h>
#include <ardour/session.h>
#include <ardour/cycle_timer.h>
#include <ardour/panner.h>
_gain = 1.0;
_desired_gain = 1.0;
- _input_connection = 0;
- _output_connection = 0;
+ _input_bundle = 0;
+ _output_bundle = 0;
pending_state_node = 0;
no_panner_reset = false;
_phase_invert = false;
no_panner_reset = false;
_desired_gain = 1.0;
_gain = 1.0;
- _input_connection = 0;
- _output_connection = 0;
+ _input_bundle = 0;
+ _output_bundle = 0;
apply_gain_automation = false;
}
void
-IO::drop_input_connection ()
+IO::drop_input_bundle ()
{
- _input_connection = 0;
- input_connection_configuration_connection.disconnect();
- input_connection_connection_connection.disconnect();
+ _input_bundle = 0;
+ input_bundle_configuration_connection.disconnect();
+ input_bundle_connection_connection.disconnect();
_session.set_dirty ();
}
void
-IO::drop_output_connection ()
+IO::drop_output_bundle ()
{
- _output_connection = 0;
- output_connection_configuration_connection.disconnect();
- output_connection_connection_connection.disconnect();
+ _output_bundle = 0;
+ output_bundle_configuration_connection.disconnect();
+ output_bundle_connection_connection.disconnect();
_session.set_dirty ();
}
return -1;
}
- drop_input_connection();
+ drop_input_bundle ();
}
}
return -1;
}
- drop_input_connection ();
+ drop_input_bundle ();
}
}
return -1;
}
- drop_output_connection ();
+ drop_output_bundle ();
}
}
return -1;
}
- drop_output_connection ();
+ drop_output_bundle ();
}
}
}
_session.engine().unregister_port (*port);
- drop_output_connection ();
+ drop_output_bundle ();
setup_peak_meters ();
reset_panner ();
}
_outputs.add (our_port);
- drop_output_connection ();
+ drop_output_bundle ();
setup_peak_meters ();
reset_panner ();
}
}
_session.engine().unregister_port (*port);
- drop_input_connection ();
+ drop_input_bundle ();
setup_peak_meters ();
reset_panner ();
}
_inputs.add (our_port);
- drop_input_connection ();
+ drop_input_bundle ();
setup_peak_meters ();
reset_panner ();
}
_session.engine().disconnect (*i);
}
- drop_input_connection ();
+ drop_input_bundle ();
}
}
_session.engine().disconnect (*i);
}
- drop_output_connection ();
+ drop_output_bundle ();
}
}
}
if (changed) {
- drop_input_connection ();
+ drop_input_bundle ();
setup_peak_meters ();
reset_panner ();
MoreChannels (n_inputs()); /* EMIT SIGNAL */
}
if (out_changed) {
- drop_output_connection ();
+ drop_output_bundle ();
output_changed (ConfigurationChanged, src); /* EMIT SIGNAL */
}
if (in_changed) {
- drop_input_connection ();
+ drop_input_bundle ();
input_changed (ConfigurationChanged, src); /* EMIT SIGNAL */
}
}
if (changed) {
- drop_output_connection ();
+ drop_output_bundle ();
MoreChannels (n_outputs()); /* EMIT SIGNAL */
_session.set_dirty ();
}
str = "";
- if (_input_connection) {
- node->add_property ("input-connection", _input_connection->name());
+ if (_input_bundle) {
+ node->add_property ("input-connection", _input_bundle->name());
need_ins = false;
}
- if (_output_connection) {
- node->add_property ("output-connection", _output_connection->name());
+ if (_output_bundle) {
+ node->add_property ("output-connection", _output_bundle->name());
need_outs = false;
}
int num_inputs = 0;
int num_outputs = 0;
+ /* XXX: we could change *-connection to *-bundle, but it seems a bit silly to
+ * break the session file format.
+ */
if ((prop = node.property ("input-connection")) != 0) {
- Connection* c = _session.connection_by_name (prop->value());
+ Bundle* c = _session.bundle_by_name (prop->value());
if (c == 0) {
- error << string_compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown bundle \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
- if ((c = _session.connection_by_name (_("in 1"))) == 0) {
- error << _("No input connections available as a replacement")
+ if ((c = _session.bundle_by_name (_("in 1"))) == 0) {
+ error << _("No input bundles available as a replacement")
<< endmsg;
return -1;
} else {
- info << string_compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
+ info << string_compose (_("Bundle %1 was not available - \"in 1\" used instead"), prop->value())
<< endmsg;
}
}
- num_inputs = c->nports();
+ num_inputs = c->nchannels();
} else if ((prop = node.property ("inputs")) != 0) {
}
if ((prop = node.property ("output-connection")) != 0) {
- Connection* c = _session.connection_by_name (prop->value());
+ Bundle* c = _session.bundle_by_name (prop->value());
if (c == 0) {
- error << string_compose(_("Unknown connection \"%1\" listed for output of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown bundle \"%1\" listed for output of %2"), prop->value(), _name) << endmsg;
- if ((c = _session.connection_by_name (_("out 1"))) == 0) {
- error << _("No output connections available as a replacement")
+ if ((c = _session.bundle_by_name (_("out 1"))) == 0) {
+ error << _("No output bundles available as a replacement")
<< endmsg;
return -1;
} else {
- info << string_compose (_("Connection %1 was not available - \"out 1\" used instead"), prop->value())
+ info << string_compose (_("Bundle %1 was not available - \"out 1\" used instead"), prop->value())
<< endmsg;
}
}
- num_outputs = c->nports ();
+ num_outputs = c->nchannels ();
} else if ((prop = node.property ("outputs")) != 0) {
num_outputs = count (prop->value().begin(), prop->value().end(), '{');
const XMLProperty* prop;
if ((prop = node.property ("input-connection")) != 0) {
- Connection* c = _session.connection_by_name (prop->value());
+ Bundle* c = _session.bundle_by_name (prop->value());
if (c == 0) {
error << string_compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
- if ((c = _session.connection_by_name (_("in 1"))) == 0) {
+ if ((c = _session.bundle_by_name (_("in 1"))) == 0) {
error << _("No input connections available as a replacement")
<< endmsg;
return -1;
} else {
- info << string_compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
+ info << string_compose (_("Bundle %1 was not available - \"in 1\" used instead"), prop->value())
<< endmsg;
}
}
- use_input_connection (*c, this);
+ use_input_bundle (*c, this);
} else if ((prop = node.property ("inputs")) != 0) {
if (set_inputs (prop->value())) {
}
}
- if ((prop = node.property ("output-connection")) != 0) {
- Connection* c = _session.connection_by_name (prop->value());
+ if ((prop = node.property ("output-bundle")) != 0) {
+ Bundle* c = _session.bundle_by_name (prop->value());
if (c == 0) {
- error << string_compose(_("Unknown connection \"%1\" listed for output of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown bundle \"%1\" listed for output of %2"), prop->value(), _name) << endmsg;
- if ((c = _session.connection_by_name (_("out 1"))) == 0) {
- error << _("No output connections available as a replacement")
+ if ((c = _session.bundle_by_name (_("out 1"))) == 0) {
+ error << _("No output bundles available as a replacement")
<< endmsg;
return -1;
} else {
- info << string_compose (_("Connection %1 was not available - \"out 1\" used instead"), prop->value())
+ info << string_compose (_("Bundle %1 was not available - \"out 1\" used instead"), prop->value())
<< endmsg;
}
}
- use_output_connection (*c, this);
+ use_output_bundle (*c, this);
} else if ((prop = node.property ("outputs")) != 0) {
if (set_outputs (prop->value())) {
}
int
-IO::use_input_connection (Connection& c, void* src)
+IO::use_input_bundle (Bundle& c, void* src)
{
uint32_t limit;
BLOCK_PROCESS_CALLBACK ();
Glib::Mutex::Lock lm2 (io_lock);
- limit = c.nports();
+ limit = c.nchannels();
- drop_input_connection ();
+ drop_input_bundle ();
- // FIXME connections only work for audio-only
+ // FIXME bundles only work for audio-only
if (ensure_inputs (ChanCount(DataType::AUDIO, limit), false, false, src)) {
return -1;
}
*/
for (uint32_t n = 0; n < limit; ++n) {
- const Connection::PortList& pl = c.port_connections (n);
+ const Bundle::PortList& pl = c.channel_ports (n);
- for (Connection::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
+ for (Bundle::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
if (!_inputs.port(n)->connected_to ((*i))) {
/* second pass: connect all requested ports where necessary */
for (uint32_t n = 0; n < limit; ++n) {
- const Connection::PortList& pl = c.port_connections (n);
+ const Bundle::PortList& pl = c.channel_ports (n);
- for (Connection::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
+ for (Bundle::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
if (!_inputs.port(n)->connected_to ((*i))) {
}
}
- _input_connection = &c;
+ _input_bundle = &c;
- input_connection_configuration_connection = c.ConfigurationChanged.connect
- (mem_fun (*this, &IO::input_connection_configuration_changed));
- input_connection_connection_connection = c.ConnectionsChanged.connect
- (mem_fun (*this, &IO::input_connection_connection_changed));
+ input_bundle_configuration_connection = c.ConfigurationChanged.connect
+ (mem_fun (*this, &IO::input_bundle_configuration_changed));
+ input_bundle_connection_connection = c.PortsChanged.connect
+ (mem_fun (*this, &IO::input_bundle_connection_changed));
}
input_changed (IOChange (ConfigurationChanged|ConnectionsChanged), src); /* EMIT SIGNAL */
}
int
-IO::use_output_connection (Connection& c, void* src)
+IO::use_output_bundle (Bundle& c, void* src)
{
uint32_t limit;
BLOCK_PROCESS_CALLBACK ();
Glib::Mutex::Lock lm2 (io_lock);
- limit = c.nports();
+ limit = c.nchannels();
- drop_output_connection ();
+ drop_output_bundle ();
// FIXME: audio-only
if (ensure_outputs (ChanCount(DataType::AUDIO, limit), false, false, src)) {
for (uint32_t n = 0; n < limit; ++n) {
- const Connection::PortList& pl = c.port_connections (n);
+ const Bundle::PortList& pl = c.channel_ports (n);
- for (Connection::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
+ for (Bundle::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
if (!_outputs.port(n)->connected_to ((*i))) {
for (uint32_t n = 0; n < limit; ++n) {
- const Connection::PortList& pl = c.port_connections (n);
+ const Bundle::PortList& pl = c.channel_ports (n);
- for (Connection::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
+ for (Bundle::PortList::const_iterator i = pl.begin(); i != pl.end(); ++i) {
if (!_outputs.port(n)->connected_to ((*i))) {
}
}
- _output_connection = &c;
+ _output_bundle = &c;
- output_connection_configuration_connection = c.ConfigurationChanged.connect
- (mem_fun (*this, &IO::output_connection_configuration_changed));
- output_connection_connection_connection = c.ConnectionsChanged.connect
- (mem_fun (*this, &IO::output_connection_connection_changed));
+ output_bundle_configuration_connection = c.ConfigurationChanged.connect
+ (mem_fun (*this, &IO::output_bundle_configuration_changed));
+ output_bundle_connection_connection = c.PortsChanged.connect
+ (mem_fun (*this, &IO::output_bundle_connection_changed));
}
output_changed (IOChange (ConnectionsChanged|ConfigurationChanged), src); /* EMIT SIGNAL */
}
void
-IO::input_connection_connection_changed (int ignored)
+IO::input_bundle_connection_changed (int ignored)
{
- use_input_connection (*_input_connection, this);
+ use_input_bundle (*_input_bundle, this);
}
void
-IO::input_connection_configuration_changed ()
+IO::input_bundle_configuration_changed ()
{
- use_input_connection (*_input_connection, this);
+ use_input_bundle (*_input_bundle, this);
}
void
-IO::output_connection_connection_changed (int ignored)
+IO::output_bundle_connection_changed (int ignored)
{
- use_output_connection (*_output_connection, this);
+ use_output_bundle (*_output_bundle, this);
}
void
-IO::output_connection_configuration_changed ()
+IO::output_bundle_configuration_changed ()
{
- use_output_connection (*_output_connection, this);
+ use_output_bundle (*_output_bundle, this);
}
void
#include <ardour/redirect.h>
#include <ardour/send.h>
#include <ardour/insert.h>
-#include <ardour/connection.h>
+#include <ardour/bundle.h>
#include <ardour/slave.h>
#include <ardour/tempo.h>
#include <ardour/audio_track.h>
}
#ifdef TRACK_DESTRUCTION
- cerr << "delete connections\n";
+ cerr << "delete bundles\n";
#endif /* TRACK_DESTRUCTION */
- for (ConnectionList::iterator i = _connections.begin(); i != _connections.end(); ) {
- ConnectionList::iterator tmp;
+ for (BundleList::iterator i = _bundles.begin(); i != _bundles.end(); ) {
+ BundleList::iterator tmp;
tmp = i;
++tmp;
// XXX HOW TO ALERT UI TO THIS ? DO WE NEED TO?
}
- /* Create a set of Connection objects that map
+ /* Create a set of Bundle objects that map
to the physical outputs currently available
*/
char buf[32];
snprintf (buf, sizeof (buf), _("out %" PRIu32), np+1);
- Connection* c = new OutputConnection (buf, true);
+ Bundle* c = new OutputBundle (buf, true);
+ c->set_nchannels (1);
+ c->add_port_to_channel (0, _engine.get_nth_physical_output (DataType::AUDIO, np));
- c->add_port ();
- c->add_connection (0, _engine.get_nth_physical_output (DataType::AUDIO, np));
-
- add_connection (c);
+ add_bundle (c);
}
for (uint32_t np = 0; np < n_physical_inputs; ++np) {
char buf[32];
snprintf (buf, sizeof (buf), _("in %" PRIu32), np+1);
- Connection* c = new InputConnection (buf, true);
-
- c->add_port ();
- c->add_connection (0, _engine.get_nth_physical_input (DataType::AUDIO, np));
+ Bundle* c = new InputBundle (buf, true);
+ c->set_nchannels (1);
+ c->add_port_to_channel (0, _engine.get_nth_physical_input (DataType::AUDIO, np));
- add_connection (c);
+ add_bundle (c);
}
/* TWO: STEREO */
char buf[32];
snprintf (buf, sizeof (buf), _("out %" PRIu32 "+%" PRIu32), np+1, np+2);
- Connection* c = new OutputConnection (buf, true);
+ Bundle* c = new OutputBundle (buf, true);
+ c->set_nchannels (2);
+ c->add_port_to_channel (0, _engine.get_nth_physical_output (DataType::AUDIO, np));
+ c->add_port_to_channel (1, _engine.get_nth_physical_output (DataType::AUDIO, np+1));
- c->add_port ();
- c->add_port ();
- c->add_connection (0, _engine.get_nth_physical_output (DataType::AUDIO, np));
- c->add_connection (1, _engine.get_nth_physical_output (DataType::AUDIO, np+1));
-
- add_connection (c);
+ add_bundle (c);
}
for (uint32_t np = 0; np < n_physical_inputs; np +=2) {
char buf[32];
snprintf (buf, sizeof (buf), _("in %" PRIu32 "+%" PRIu32), np+1, np+2);
- Connection* c = new InputConnection (buf, true);
-
- c->add_port ();
- c->add_port ();
- c->add_connection (0, _engine.get_nth_physical_input (DataType::AUDIO, np));
- c->add_connection (1, _engine.get_nth_physical_input (DataType::AUDIO, np+1));
+ Bundle* c = new InputBundle (buf, true);
+ c->set_nchannels (2);
+ c->add_port_to_channel (0, _engine.get_nth_physical_input (DataType::AUDIO, np));
+ c->add_port_to_channel (1, _engine.get_nth_physical_input (DataType::AUDIO, np+1));
- add_connection (c);
+ add_bundle (c);
}
/* THREE MASTER */
}
- Connection* c = new OutputConnection (_("Master Out"), true);
+ Bundle* c = new OutputBundle (_("Master Out"), true);
+ c->set_nchannels (_master_out->n_inputs().get_total());
for (uint32_t n = 0; n < _master_out->n_inputs ().get_total(); ++n) {
- c->add_port ();
- c->add_connection ((int) n, _master_out->input(n)->name());
+ c->add_port_to_channel ((int) n, _master_out->input(n)->name());
}
- add_connection (c);
+ add_bundle (c);
}
hookup_io ();
}
void
-Session::add_connection (ARDOUR::Connection* connection)
+Session::add_bundle (ARDOUR::Bundle* bundle)
{
{
- Glib::Mutex::Lock guard (connection_lock);
- _connections.push_back (connection);
+ Glib::Mutex::Lock guard (bundle_lock);
+ _bundles.push_back (bundle);
}
- ConnectionAdded (connection); /* EMIT SIGNAL */
+ BundleAdded (bundle); /* EMIT SIGNAL */
set_dirty();
}
void
-Session::remove_connection (ARDOUR::Connection* connection)
+Session::remove_bundle (ARDOUR::Bundle* bundle)
{
bool removed = false;
{
- Glib::Mutex::Lock guard (connection_lock);
- ConnectionList::iterator i = find (_connections.begin(), _connections.end(), connection);
+ Glib::Mutex::Lock guard (bundle_lock);
+ BundleList::iterator i = find (_bundles.begin(), _bundles.end(), bundle);
- if (i != _connections.end()) {
- _connections.erase (i);
+ if (i != _bundles.end()) {
+ _bundles.erase (i);
removed = true;
}
}
if (removed) {
- ConnectionRemoved (connection); /* EMIT SIGNAL */
+ BundleRemoved (bundle); /* EMIT SIGNAL */
}
set_dirty();
}
-ARDOUR::Connection *
-Session::connection_by_name (string name) const
+ARDOUR::Bundle *
+Session::bundle_by_name (string name) const
{
- Glib::Mutex::Lock lm (connection_lock);
+ Glib::Mutex::Lock lm (bundle_lock);
- for (ConnectionList::const_iterator i = _connections.begin(); i != _connections.end(); ++i) {
+ for (BundleList::const_iterator i = _bundles.begin(); i != _bundles.end(); ++i) {
if ((*i)->name() == name) {
return* i;
}
#include <ardour/redirect.h>
#include <ardour/send.h>
#include <ardour/insert.h>
-#include <ardour/connection.h>
+#include <ardour/bundle.h>
#include <ardour/slave.h>
#include <ardour/tempo.h>
#include <ardour/audio_track.h>
child = node->add_child ("Connections");
{
- Glib::Mutex::Lock lm (connection_lock);
- for (ConnectionList::iterator i = _connections.begin(); i != _connections.end(); ++i) {
- if (!(*i)->system_dependent()) {
+ Glib::Mutex::Lock lm (bundle_lock);
+ for (BundleList::iterator i = _bundles.begin(); i != _bundles.end(); ++i) {
+ if (!(*i)->dynamic()) {
child->add_child_nocopy ((*i)->get_state());
}
}
if ((child = find_named_node (node, "Connections")) == 0) {
error << _("Session: XML state has no connections section") << endmsg;
goto out;
- } else if (load_connections (*child)) {
+ } else if (load_bundles (*child)) {
goto out;
}
}
int
-Session::load_connections (const XMLNode& node)
+Session::load_bundles (const XMLNode& node)
{
XMLNodeList nlist = node.children();
XMLNodeConstIterator niter;
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "InputConnection") {
- add_connection (new ARDOUR::InputConnection (**niter));
+ add_bundle (new ARDOUR::InputBundle (**niter));
} else if ((*niter)->name() == "OutputConnection") {
- add_connection (new ARDOUR::OutputConnection (**niter));
+ add_bundle (new ARDOUR::OutputBundle (**niter));
} else {
error << string_compose(_("Unknown node \"%1\" found in Connections list from state file"), (*niter)->name()) << endmsg;
return -1;
#include <ardour/audioplaylist.h>
#include <ardour/panner.h>
#include <ardour/utils.h>
-#include <ardour/connection.h>
#include "i18n.h"