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.
21 #ifndef __ardour_connection_h__
22 #define __ardour_connection_h__
26 #include <sigc++/signal.h>
27 #include <glibmm/thread.h>
28 #include <pbd/stateful.h>
35 class Connection : public Stateful, public sigc::trackable {
37 Connection (string name, bool sdep = false) : _name (name), _sysdep(sdep) {}
40 typedef vector<string> PortList;
42 void set_name (string name, void *src);
43 string name() const { return _name; }
45 bool system_dependent() const { return _sysdep; }
47 uint32_t nports () const { return _ports.size(); }
48 const PortList& port_connections (int port) const;
50 void add_connection (int port, string portname);
51 void remove_connection (int port, string portname);
54 void remove_port (int port);
57 sigc::signal<void,void*> NameChanged;
58 sigc::signal<void> ConfigurationChanged;
59 sigc::signal<void,int> ConnectionsChanged;
61 bool operator==(const Connection& other) const;
63 XMLNode& get_state (void);
64 int set_state (const XMLNode&);
67 Connection (const XMLNode&);
70 mutable Glib::Mutex port_lock;
71 vector<PortList> _ports;
75 int set_connections (const string& str);
76 int parse_io_string (const string& str, vector<string>& ports);
79 class InputConnection : public Connection {
81 InputConnection (string name, bool sdep = false) : Connection (name, sdep) {}
82 InputConnection (const XMLNode&);
85 class OutputConnection : public Connection {
87 OutputConnection (string name, bool sdep = false) : Connection (name, sdep) {}
88 OutputConnection (const XMLNode&);
93 #endif /* __ardour_connection_h__ */