summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/bundle.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-01-20 14:46:00 +0000
committerCarl Hetherington <carl@carlh.net>2009-01-20 14:46:00 +0000
commit61db2175eb8b8fffd0c1796ace78ac33c9e1adf0 (patch)
tree6fdc23e7e0161ce54642b0bd44dc8e0a33f05efe /libs/ardour/ardour/bundle.h
parentef038c1a84ecd541a540d5a5baa677d7663e535c (diff)
New matrix-based editor for connections and bundles, based on thorwil's design.
Add Bundle Manager dialog. git-svn-id: svn://localhost/ardour2/branches/3.0@4415 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/bundle.h')
-rw-r--r--libs/ardour/ardour/bundle.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h
index 1b029dc2b4..8b1af39e75 100644
--- a/libs/ardour/ardour/bundle.h
+++ b/libs/ardour/ardour/bundle.h
@@ -21,17 +21,21 @@
#define __ardour_bundle_h__
#include <string>
+#include <vector>
+#include <glibmm/thread.h>
#include <sigc++/signal.h>
#include "ardour/data_type.h"
namespace ARDOUR {
/** A set of `channels', each of which is associated with 0 or more ports.
+ * Each channel has a name which can be anything useful.
* Intended for grouping things like, for example, a buss' outputs.
* `Channel' is a rather overloaded term but I can't think of a better
* one right now.
*/
-class Bundle : public sigc::trackable {
+class Bundle : public sigc::trackable
+{
public:
/// List of ports associated with a channel. We can't use a
@@ -39,6 +43,17 @@ class Bundle : public sigc::trackable {
/// (ie those without a Port object)
typedef std::vector<std::string> PortList;
+ struct Channel {
+ Channel (std::string n) : name (n) {}
+
+ bool operator== (Channel const &o) const {
+ return name == o.name && ports == o.ports;
+ }
+
+ std::string name;
+ PortList ports;
+ };
+
/** Construct an audio bundle.
* @param i true if ports are inputs, otherwise false.
*/
@@ -50,6 +65,13 @@ class Bundle : public sigc::trackable {
*/
Bundle (std::string const & n, bool i = true) : _name (n), _type (DataType::AUDIO), _ports_are_inputs (i) {}
+ /** Construct a bundle.
+ * @param n Name.
+ * @param t Type.
+ * @param i true if ports are inputs, otherwise false.
+ */
+ Bundle (std::string const & n, DataType t, bool i = true) : _name (n), _type (t), _ports_are_inputs (i) {}
+
virtual ~Bundle() {}
/** @return Number of channels that this Bundle has */
@@ -60,13 +82,16 @@ class Bundle : public sigc::trackable {
*/
PortList const & channel_ports (uint32_t) const;
- void add_channel ();
+ void add_channel (std::string const &);
+ std::string channel_name (uint32_t) const;
+ void set_channel_name (uint32_t, std::string const &);
void add_port_to_channel (uint32_t, std::string);
void set_port (uint32_t, std::string);
void remove_port_from_channel (uint32_t, std::string);
- void set_nchannels (uint32_t);
bool port_attached_to_channel (uint32_t, std::string);
+ bool uses_port (std::string) const;
void remove_channel (uint32_t);
+ void remove_channels ();
/** Set the name.
* @param n New name.
@@ -94,7 +119,7 @@ class Bundle : public sigc::trackable {
bool operator== (Bundle const &) const;
- /** Emitted when the name changes */
+ /** Emitted when the bundle name or a channel name has changed */
sigc::signal<void> NameChanged;
/** The number of channels has changed */
sigc::signal<void> ConfigurationChanged;
@@ -103,10 +128,10 @@ class Bundle : public sigc::trackable {
protected:
- /// mutex for _ports;
+ /// mutex for _channel_ports and _channel_names
/// XXX: is this necessary?
- mutable Glib::Mutex _ports_mutex;
- std::vector<PortList> _ports;
+ mutable Glib::Mutex _channel_mutex;
+ std::vector<Channel> _channel;
private:
int set_channels (std::string const &);