2009-11-25 09:22:48 +00:00
|
|
|
#ifndef PORTMANAGER_H
|
|
|
|
#define PORTMANAGER_H
|
|
|
|
|
|
|
|
#include <jack/jack.h>
|
|
|
|
#include "port.h"
|
|
|
|
|
|
|
|
struct Alias
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
std::string alias;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::list<Alias> AliasList;
|
|
|
|
|
|
|
|
class PortManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ClientList m_clients;
|
|
|
|
PortList m_ports;
|
|
|
|
AliasList m_aliases;
|
|
|
|
|
|
|
|
public:
|
2009-11-26 17:19:03 +00:00
|
|
|
void Refresh();
|
2009-11-25 09:22:48 +00:00
|
|
|
void Add(jack_port_t *port);
|
|
|
|
void Delete(jack_port_t *port);
|
|
|
|
|
|
|
|
void Connect(jack_port_t *port_a, jack_port_t *port_b);
|
|
|
|
void Disconnect(jack_port_t *port_a, jack_port_t *port_b);
|
|
|
|
|
|
|
|
Client *FindOrMakeClient(std::string name, bool is_input, bool is_midi);
|
|
|
|
PortGroup *FindOrMakeGroup(Client *client, JackPortFlags flags, std::string name);
|
|
|
|
Port *FindPort(jack_port_t *port);
|
|
|
|
|
|
|
|
void Sort();
|
|
|
|
|
|
|
|
void ToggleConnect(Port *a, Port *b);
|
|
|
|
void ToggleConnect(Port *a, PortGroup *b);
|
|
|
|
void ToggleConnect(PortGroup *a, Port *b);
|
|
|
|
void ToggleConnect(PortGroup *a, PortGroup *b);
|
|
|
|
|
|
|
|
void AliasBay(jack_port_t *port, int num_aliases, char *aliases[2]);
|
2009-11-25 19:39:18 +00:00
|
|
|
void AliasClear();
|
|
|
|
void AliasAdd(std::string source, std::string target);
|
|
|
|
|
|
|
|
const AliasList &AliasGetList() const { return m_aliases; }
|
2009-11-25 09:22:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern PortManager pm;
|
|
|
|
|
|
|
|
#endif // PORTMANAGER_H
|