#include <JackBase.H>
|
| JackBase () |
|
| JackBase (string clientName_) |
|
| JackBase (string clientName_, string serverName) |
|
virtual | ~JackBase () |
| Destructor. More...
|
|
virtual int | stopClient (void) |
|
virtual int | disconnect (void) |
|
int | getSampleRate (void) const |
|
virtual int | createPorts (string inName, int inCnt, string outName, int outCnt) |
|
virtual int | destroyPorts () |
|
void | getPhysicalPorts (vector< jack_port_t *> &inPorts, vector< jack_port_t *> &outPorts) |
|
void | getPhysicalPortCount (int &in, int &out) |
|
bool | connected () |
|
virtual int | connect (string clientName_) |
|
virtual int | connect (const string &clientName_, const string &serverName) |
|
virtual void | print (ostream &os) |
|
string | getClientName () |
|
virtual void | setClientName (string cn) |
|
string | portNameFromPort (jack_port_id_t p) |
|
string | portNameFromPort (jack_port_t *p) |
|
string | clientNameFromPort (jack_port_id_t p) |
|
string | clientNameFromPort (jack_port_t *p) |
|
string | clientNameFromPortName (string fullPortName) |
|
string | clientNameFromPortNames (string fullPortName, string shortPortName) |
|
string | shortPortNameFromPortName (const string fullPortName) |
|
bool | operator== (const string &cn) |
|
int | getInputPortSize () |
|
jack_port_t * | getInputPort (int i) |
|
jack_port_t * | getOutputPort (int i) |
|
void | addInputPort (jack_port_t *inP) |
|
void | addOutputPort (jack_port_t *outP) |
|
int | populatInOutPorts (const string &inName, vector< string > &inPorts, const string &outName, vector< string > &outPorts) |
|
int | connectPorts (const string inName, const string outName) |
|
virtual int | disconnectPorts (const string &inName, const string &outName) |
|
void | setClient (jack_client_t *c) |
|
|
bool | connect1To1 |
| When true, then connections are made in a 1 to 1 manner. When False, then connections are made in an all to all manner. More...
|
|
Base for Jack classes. Minimal knowledge of port handling.
Definition at line 89 of file JackBase.H.
◆ JackBase() [1/3]
◆ JackBase() [2/3]
JackBase::JackBase |
( |
string |
clientName_ | ) |
|
|
inline |
Constructor. Connecting the client to the default server.
- Parameters
-
clientName_ | The client name, which will initiate a server connection. |
Definition at line 219 of file JackBase.H.
◆ JackBase() [3/3]
JackBase::JackBase |
( |
string |
clientName_, |
|
|
string |
serverName |
|
) |
| |
|
inline |
Constructor. Connecting the client to a particular server.
- Parameters
-
clientName_ | The client name, which will initiate a server connection. |
serverName | The server to connect to. |
Definition at line 233 of file JackBase.H.
◆ ~JackBase()
virtual JackBase::~JackBase |
( |
| ) |
|
|
inlinevirtual |
◆ addInputPort()
void JackBase::addInputPort |
( |
jack_port_t * |
inP | ) |
|
|
inline |
Add an input port to the list of known input ports.
- Parameters
-
Definition at line 545 of file JackBase.H.
◆ addOutputPort()
void JackBase::addOutputPort |
( |
jack_port_t * |
outP | ) |
|
|
inline |
Add an output port to the list of known output ports.
- Parameters
-
Definition at line 552 of file JackBase.H.
◆ clearPorts()
void JackBase::clearPorts |
( |
| ) |
|
|
inlineprivate |
Clear all port knowledge and latency knowledge.
Definition at line 100 of file JackBase.H.
◆ clientNameFromPort() [1/2]
string JackBase::clientNameFromPort |
( |
jack_port_id_t |
p | ) |
|
|
inline |
Given a port id, extract the client name.
- Parameters
-
p | The port id to find the client name from. |
- Returns
- the client name (initial portion) of the port name.
Definition at line 470 of file JackBase.H.
◆ clientNameFromPort() [2/2]
string JackBase::clientNameFromPort |
( |
jack_port_t * |
p | ) |
|
|
inline |
Given a port, extract the client name.
- Parameters
-
p | The port to find the client name from. |
- Returns
- the client name (initial portion) of the port name.
Definition at line 481 of file JackBase.H.
◆ clientNameFromPortName()
string JackBase::clientNameFromPortName |
( |
string |
fullPortName | ) |
|
|
inline |
Given a full port name, extract the client name.
- Parameters
-
fullPortName | The client:port name convention. |
- Returns
- the client name (initial portion) of the port name.
Definition at line 489 of file JackBase.H.
◆ clientNameFromPortNames()
string JackBase::clientNameFromPortNames |
( |
string |
fullPortName, |
|
|
string |
shortPortName |
|
) |
| |
|
inline |
Given a full port name and the short port name (the port name without the client portion), extract the client name.
- Parameters
-
fullPortName | The client:port name convention. |
shortPortName | The port name. |
- Returns
- the client name (initial portion) of the port name.
Definition at line 498 of file JackBase.H.
◆ connect() [1/2]
virtual int JackBase::connect |
( |
string |
clientName_ | ) |
|
|
inlinevirtual |
Connect to the server This starts the server and sets up the process callback/arg to use.
- Parameters
-
clientName_ | The name of the client to use |
- Returns
- NO_ERROR on success
Reimplemented in JackClient, and JackPortMonitor.
Definition at line 369 of file JackBase.H.
◆ connect() [2/2]
virtual int JackBase::connect |
( |
const string & |
clientName_, |
|
|
const string & |
serverName |
|
) |
| |
|
inlinevirtual |
Connect to the server This starts the server and sets up the process callback/arg to use.
- Parameters
-
clientName_ | The name of the client to use |
serverName | The name of the server to use |
- Returns
- NO_ERROR on success
Reimplemented in JackClient, and JackPortMonitor.
Definition at line 379 of file JackBase.H.
◆ connected()
bool JackBase::connected |
( |
| ) |
|
|
inline |
Find out if we are connected to a server.
- Returns
- true if connected to a server, false if not connected.
Definition at line 358 of file JackBase.H.
◆ connectPorts()
int JackBase::connectPorts |
( |
const string |
inName, |
|
|
const string |
outName |
|
) |
| |
|
inline |
Connect ports together which are given by name. If the names have ':' in them, then they are of the client:port form and can be directly connected together. If one name has no ':' in it, then connect to all of it's ports. If both names have no ':' in them, then map ports one to one until one client runs out of ports.
- Parameters
-
inName | The input port name |
outName | The output port name |
- Returns
- 0 on success, <0 on error.
Definition at line 591 of file JackBase.H.
◆ createPorts()
virtual int JackBase::createPorts |
( |
string |
inName, |
|
|
int |
inCnt, |
|
|
string |
outName, |
|
|
int |
outCnt |
|
) |
| |
|
inlinevirtual |
Create the client's ports
- Parameters
-
inName | The input port base name to use |
inCnt | The number of ports to create |
outName | The output port base name to use |
outCnt | The number of output ports to create |
- Examples:
- JackClientTest.C.
Definition at line 277 of file JackBase.H.
◆ destroyPorts()
virtual int JackBase::destroyPorts |
( |
| ) |
|
|
inlinevirtual |
Destroy all ports.
- Returns
- NO_ERROR on success
Definition at line 306 of file JackBase.H.
◆ determineLatencies()
virtual void JackBase::determineLatencies |
( |
| ) |
|
|
inlineprotectedvirtual |
Determine the capture and playback latencies. These latencies are defined by Jack as :
Capture latency : how long since the data read from the buffer of a port arrived at at a port marked with JackPortIsTerminal. The data will have come from the "outside world" if the terminal port is also marked with JackPortIsPhysical, or will have been synthesized by the client that owns the terminal port.
Playback latency : how long until the data written to the buffer of port will reach a port marked with JackPortIsTerminal.
Definition at line 130 of file JackBase.H.
◆ disconnect()
virtual int JackBase::disconnect |
( |
void |
| ) |
|
|
inlinevirtual |
Stop the client running
- Returns
- 0 on no error, or JACK_CLOSE_CLIENT_ERROR on failure
Reimplemented in JackPortMonitor.
Definition at line 254 of file JackBase.H.
◆ disconnectPorts()
virtual int JackBase::disconnectPorts |
( |
const string & |
inName, |
|
|
const string & |
outName |
|
) |
| |
|
inlinevirtual |
Disconnect ports which are given by name. If the names have ':' in them, then they are of the client:port form and can be directly disconnected. If one name has no ':' in it, then disconnect all of it's ports. If both names have no ':' in them, then disconnect ports one to one.
- Parameters
-
inName | The input port name |
outName | The output port name |
- Returns
- 0 on success, <0 on error.
Definition at line 629 of file JackBase.H.
◆ getClientName()
string JackBase::getClientName |
( |
| ) |
|
|
inline |
Get the client name.
- Returns
- the client name.
Definition at line 436 of file JackBase.H.
◆ getInputPort()
jack_port_t* JackBase::getInputPort |
( |
int |
i | ) |
|
|
inline |
Get an input port.
- Parameters
-
i | The input port to retrieve. |
- Returns
- NULL on failure, otherwise the port.
Definition at line 526 of file JackBase.H.
◆ getInputPortSize()
int JackBase::getInputPortSize |
( |
| ) |
|
|
inline |
Get the number of input ports.
- Returns
- the number of input ports.
Definition at line 518 of file JackBase.H.
◆ getOutputPort()
jack_port_t* JackBase::getOutputPort |
( |
int |
i | ) |
|
|
inline |
Get an output port.
- Parameters
-
i | The input port to retrieve. |
- Returns
- NULL on failure, otherwise the port.
Definition at line 536 of file JackBase.H.
◆ getPhysicalPortCount()
void JackBase::getPhysicalPortCount |
( |
int & |
in, |
|
|
int & |
out |
|
) |
| |
|
inline |
Find out how many physical input and outputs ports are present.
- Parameters
-
[out] | in | The number of input ports. |
[out] | out | The number of output ports. |
Definition at line 344 of file JackBase.H.
◆ getPhysicalPorts()
void JackBase::getPhysicalPorts |
( |
vector< jack_port_t *> & |
inPorts, |
|
|
vector< jack_port_t *> & |
outPorts |
|
) |
| |
|
inline |
Find out how many physical input and outputs ports are present.
- Parameters
-
[out] | in | The number of input ports. |
[out] | out | The number of output ports. |
Definition at line 330 of file JackBase.H.
◆ getPortListAndCount() [1/2]
int JackBase::getPortListAndCount |
( |
JackPortFlags |
flags, |
|
|
vector< jack_port_t *> * |
ports, |
|
|
const char * |
portNamePattern, |
|
|
const char * |
typeNamePattern |
|
) |
| |
|
inlineprotected |
Get the port list and the number of ports.
- Parameters
-
flags,the | JackPortFlags {JackPortIsOutput, JackPortIsPhysical, JackPortCanMonitor, JackPortIsTerminal}. |
ports | The port vector to be returned, null if not to be populated. |
portNamePattern | name pattern to match when searching for ports. |
typeNamePattern | type name pattern to match when searching for ports. |
- Returns
- >=0 representing the number of ports or <0 on error.
Definition at line 159 of file JackBase.H.
◆ getPortListAndCount() [2/2]
int JackBase::getPortListAndCount |
( |
JackPortFlags |
flags, |
|
|
vector< string > * |
ports, |
|
|
const char * |
portNamePattern, |
|
|
const char * |
typeNamePattern |
|
) |
| |
|
inlineprotected |
Get the port name list and the number of ports.
- Parameters
-
flags,the | JackPortFlags {JackPortIsOutput, JackPortIsPhysical, JackPortCanMonitor, JackPortIsTerminal}. |
ports | The port vector to be returned, null if not to be populated. |
portNamePattern | name pattern to match when searching for ports. |
typeNamePattern | type name pattern to match when searching for ports. |
- Returns
- >=0 representing the number of ports or <0 on error.
Definition at line 179 of file JackBase.H.
◆ getSampleRate()
int JackBase::getSampleRate |
( |
void |
| ) |
const |
|
inline |
◆ init()
void JackBase::init |
( |
void |
| ) |
|
|
inlineprivate |
Common intialiser.
Definition at line 92 of file JackBase.H.
◆ operator==()
bool JackBase::operator== |
( |
const string & |
cn | ) |
|
|
inline |
◆ populatInOutPorts()
int JackBase::populatInOutPorts |
( |
const string & |
inName, |
|
|
vector< string > & |
inPorts, |
|
|
const string & |
outName, |
|
|
vector< string > & |
outPorts |
|
) |
| |
|
inline |
Given an input name and an output name, of either form, "ClientName" or "ClientName:PortName", populate a vector of strings matching all of the possible ports.
- Parameters
-
inName | The input port name |
inPorts | A vector of strings naming all of the ports found matching the inName. |
outName | The output port name |
outPorts | A vector of strings naming all of the ports found matching the outName. |
- Returns
- NO_ERROR on success, otherwise the appropriate error number.
- See also
- connectPorts, disConnectPorts
Definition at line 564 of file JackBase.H.
◆ portNameFromPort() [1/2]
string JackBase::portNameFromPort |
( |
jack_port_id_t |
p | ) |
|
|
inline |
Given a port id, extract the port name.
- Parameters
-
p | The port id to find the client name from. |
- Returns
- the port name (final portion) of the full port name.
Definition at line 451 of file JackBase.H.
◆ portNameFromPort() [2/2]
string JackBase::portNameFromPort |
( |
jack_port_t * |
p | ) |
|
|
inline |
Given a port id, extract the port name.
- Parameters
-
p | The port to find the client name from. |
- Returns
- the port name (final portion) of the full port name.
Definition at line 462 of file JackBase.H.
◆ print()
virtual void JackBase::print |
( |
ostream & |
os | ) |
|
|
inlinevirtual |
Print ports and clients.
- Parameters
-
os | The output stream to print to. |
Reimplemented in JackPortMonitor.
Definition at line 418 of file JackBase.H.
◆ reSyncConnections()
virtual void JackBase::reSyncConnections |
( |
void |
| ) |
|
|
inlineprotectedvirtual |
◆ reSyncPorts()
virtual void JackBase::reSyncPorts |
( |
void |
| ) |
|
|
inlineprotectedvirtual |
◆ setClient()
void JackBase::setClient |
( |
jack_client_t * |
c | ) |
|
|
inline |
Method to set the client.
- Parameters
-
Definition at line 651 of file JackBase.H.
◆ setClientName()
virtual void JackBase::setClientName |
( |
string |
cn | ) |
|
|
inlinevirtual |
Set the client name.
- Parameters
-
Definition at line 443 of file JackBase.H.
◆ shortPortNameFromPortName()
string JackBase::shortPortNameFromPortName |
( |
const string |
fullPortName | ) |
|
|
inline |
◆ stopClient()
virtual int JackBase::stopClient |
( |
void |
| ) |
|
|
inlinevirtual |
Stop the client running
- Returns
- 0 on no error, or JACK_CLOSE_CLIENT_ERROR on failure
Definition at line 244 of file JackBase.H.
◆ client
jack_client_t* JackBase::client |
|
protected |
◆ clientName
string JackBase::clientName |
|
protected |
The name of this client.
Definition at line 109 of file JackBase.H.
◆ connect1To1
bool JackBase::connect1To1 |
When true, then connections are made in a 1 to 1 manner. When False, then connections are made in an all to all manner.
Definition at line 208 of file JackBase.H.
◆ inputLatencies
vector<jack_nframes_t> JackBase::inputLatencies |
|
protected |
The input latencies, one for each port.
Definition at line 121 of file JackBase.H.
◆ inputPorts
vector<jack_port_t *> JackBase::inputPorts |
|
protected |
◆ jackOptions
jack_options_t JackBase::jackOptions |
|
protected |
◆ outputLatencies
vector<jack_nframes_t> JackBase::outputLatencies |
|
protected |
The output latencies, one for each port.
Definition at line 122 of file JackBase.H.
◆ outputPorts
vector<jack_port_t *> JackBase::outputPorts |
|
protected |
◆ physicalInputPortCnt
int JackBase::physicalInputPortCnt |
|
protected |
The number of physical input ports.
Definition at line 115 of file JackBase.H.
◆ physicalOutputPortCnt
int JackBase::physicalOutputPortCnt |
|
protected |
The number of physical input ports.
Definition at line 116 of file JackBase.H.
◆ status
jack_status_t JackBase::status |
|
protected |
The documentation for this class was generated from the following file: