/* $Id$ */ #ifndef PORT_H #define PORT_H #include #include #include class Port { public: enum Type { Invalid, Alsa, Jack, JackMidi }; enum Direction { Input, Output }; Type type; Direction direction; char *name; char *alias; const char **connections; Port(const char *_name) { name = strdup(_name); alias = NULL; connections = NULL; } ~Port() { free(name); free(alias); free(connections); } }; typedef std::list PortList; class PortManager { public: PortList m_ports; PortManager() { } virtual ~PortManager() { } virtual bool Connect() = 0; virtual void Disconnect() = 0; virtual void RefreshPorts() = 0; Port *GetPortByName(const char *name) { Port *p; PortList::iterator it; for (it = m_ports.begin(); it != m_ports.end(); ++it) { p = *it; if (strcmp(p->name, name) == 0) return p; } p = new Port(name); m_ports.push_back(p); return p; } }; #endif /* PORT_H */