2 Copyright (C) 2002 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_connection_h__
21 #define __ardour_connection_h__
25 #include <sigc++/signal.h>
26 #include <glibmm/thread.h>
27 #include <pbd/stateful.h>
34 class Connection : public Stateful, public sigc::trackable {
36 Connection (string name, bool sdep = false) : _name (name), _sysdep(sdep) {}
39 typedef vector<string> PortList;
41 void set_name (string name, void *src);
42 string name() const { return _name; }
44 bool system_dependent() const { return _sysdep; }
46 uint32_t nports () const { return _ports.size(); }
47 const PortList& port_connections (int port) const;
49 void add_connection (int port, string portname);
50 void remove_connection (int port, string portname);
53 void remove_port (int port);
56 sigc::signal<void,void*> NameChanged;
57 sigc::signal<void> ConfigurationChanged;
58 sigc::signal<void,int> ConnectionsChanged;
60 bool operator==(const Connection& other) const;
62 XMLNode& get_state (void);
63 int set_state (const XMLNode&);
66 Connection (const XMLNode&);
69 mutable Glib::Mutex port_lock;
70 vector<PortList> _ports;
74 int set_connections (const string& str);
75 int parse_io_string (const string& str, vector<string>& ports);
78 class InputConnection : public Connection {
80 InputConnection (string name, bool sdep = false) : Connection (name, sdep) {}
81 InputConnection (const XMLNode&);
84 class OutputConnection : public Connection {
86 OutputConnection (string name, bool sdep = false) : Connection (name, sdep) {}
87 OutputConnection (const XMLNode&);
92 #endif /* __ardour_connection_h__ */