91 cout<<
"JackClient::bufferSizeChangeStatic : New buffer size = "<<nframes<<endl;
125 virtual int connect(
const string &clientName_,
const string &serverName) {
141 return jack_get_buffer_size (
client);
149 int res=jack_set_buffer_size(
client,size);
163 return jack_activate(
client);
173 virtual int startClient(
int inCnt,
int outCnt,
bool doConnect=
true) {
180 vector<jack_port_t *> inPorts, outPorts;
181 int inCntLocal=
getPortListAndCount((JackPortFlags)(JackPortIsPhysical|JackPortIsOutput), &inPorts, NULL, NULL);
184 if (inCnt<inCntLocal)
186 for (
int i=0; i<inCntLocal; i++)
187 if (jack_connect(
client, jack_port_name(inPorts[i]), jack_port_name(
inputPorts[i])))
188 cerr<<
"cannot connect input port "<<i<<endl;
190 int outCntLocal=
getPortListAndCount((JackPortFlags)(JackPortIsPhysical|JackPortIsInput), &outPorts, NULL, NULL);
193 if (outCnt<outCntLocal)
195 for (
int i=0; i<outCntLocal; i++)
196 if (jack_connect(
client, jack_port_name(
outputPorts[i]), jack_port_name(outPorts[i])))
197 cerr<<
"cannot connect output port "<<i<<endl;
202 #endif // JACKCLIENT_H_
virtual int disconnect(void)
virtual int getBlockSize()
virtual int connect(string clientName_)
int getPortListAndCount(JackPortFlags flags, vector< jack_port_t *> *ports, const char *portNamePattern, const char *typeNamePattern)
virtual int evaluateError(int errorNum)
#define JACK_HAS_NO_CAPTURE_PORTS_ERROR
The server has no capture ports.
virtual int connect(const string &clientName_, const string &serverName)
virtual ~JackClient()
Destructor.
#define JACK_SET_CALLBACK_ERROR
The Client failed to register its callback with the server.
virtual int startClient()
int setBlockSize(int size)
#define NO_ERROR
There is no error.
static int processAudioStatic(jack_nframes_t nframes, void *arg)
#define JACK_SET_BUFFER_SIZE_ERROR
Couldn't set the buffer size.
virtual int startClient(int inCnt, int outCnt, bool doConnect=true)
#define JACK_SET_BUFFSIZE_CALLBACK_ERROR
Couldn't set the buffer size callback.
JackClient(string clientName_)
static int bufferSizeChangeStatic(jack_nframes_t nframes, void *arg)
virtual int connect(string clientName_)
virtual int processAudio(jack_nframes_t nframes)=0
jack_client_t * client
The jack client.
#define JACK_HAS_NO_PLAYBACK_PORTS_ERROR
The server has no playback.
vector< jack_port_t * > inputPorts
The input ports.
#define JACK_ACTIVATE_ERROR
Couldn't activate the client with the server.
vector< jack_port_t * > outputPorts
The output ports.
virtual int bufferSizeChange(jack_nframes_t nframes)