gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
CrossoverAudio Class Reference

#include <CrossoverAudio.H>

Inheritance diagram for CrossoverAudio:
[legend]
Collaboration diagram for CrossoverAudio:
[legend]

Public Member Functions

 CrossoverAudio ()
 Constructor : starts connecting to Jack audio. More...
 
virtual ~CrossoverAudio ()
 Destructor. More...
 
void setGain (float g)
 
float getGain (void)
 
int setDuration (float d)
 
float getDuration (void)
 
int setChannels (int outCnt, int inCnt, int testInCnt)
 
void getChannels (int &inCnt, int &outCnt)
 
int recordNextChannelSet ()
 
void nextCrossover ()
 
virtual int reset ()
 
virtual int getNumberOfRecordedChannels ()
 
int isRecording ()
 
- Public Member Functions inherited from JackClient
 JackClient (void)
 
 JackClient (string clientName_)
 
virtual ~JackClient ()
 Destructor. More...
 
virtual int connect (string clientName_)
 
virtual int connect (const string &clientName_, const string &serverName)
 
virtual int getBlockSize ()
 
int setBlockSize (int size)
 
virtual int startClient ()
 
- Public Member Functions inherited from JackBase
 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 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)
 

Public Attributes

Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic > audio
 The first channel is the same data sent over each output channel, then the output channels, then the input channels. More...
 
- Public Attributes inherited from JackBase
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...
 

Protected Attributes

float gain
 The gain for the output. More...
 
Mutex recordLock
 The lock for when the audio is being played/recorded. More...
 
unsigned int zeroSampleCnt
 The number of samples to train with zeros. More...
 
int samplesToProcess
 The number of samples to process, matching the duration. More...
 
int samplesProcessed
 The number of samples already processed. More...
 
int currentInputChannel
 The current input channel to test. More...
 
- Protected Attributes inherited from JackBase
jack_client_t * client
 The jack client. More...
 
string clientName
 The name of this client. More...
 
jack_options_t jackOptions
 Options for jack. More...
 
jack_status_t status
 The status of jack. More...
 
int physicalInputPortCnt
 The number of physical input ports. More...
 
int physicalOutputPortCnt
 The number of physical input ports. More...
 
vector< jack_port_t * > inputPorts
 The input ports. More...
 
vector< jack_port_t * > outputPorts
 The output ports. More...
 
vector< jack_nframes_t > inputLatencies
 The input latencies, one for each port. More...
 
vector< jack_nframes_t > outputLatencies
 The output latencies, one for each port. More...
 

Private Member Functions

virtual int processAudio (jack_nframes_t nframes)
 The Jack client callback. More...
 
virtual int startClient (int inCnt, int outCnt, bool doConnect)
 

Additional Inherited Members

- Protected Member Functions inherited from JackClient
virtual int bufferSizeChange (jack_nframes_t nframes)
 
- Protected Member Functions inherited from JackBase
virtual void determineLatencies ()
 
int getPortListAndCount (JackPortFlags flags, vector< jack_port_t *> *ports, const char *portNamePattern, const char *typeNamePattern)
 
int getPortListAndCount (JackPortFlags flags, vector< string > *ports, const char *portNamePattern, const char *typeNamePattern)
 
virtual void reSyncPorts (void)
 
virtual void reSyncConnections (void)
 

Detailed Description

Class to play and record audio data for analysis. Usefull for measuing frequency responses. In general, there is only one vector of output test data, it is played on all operating output channels.

Definition at line 35 of file CrossoverAudio.H.

Constructor & Destructor Documentation

◆ CrossoverAudio()

CrossoverAudio::CrossoverAudio ( )

Constructor : starts connecting to Jack audio.

Definition at line 20 of file CrossoverAudio.C.

Here is the call graph for this function:

◆ ~CrossoverAudio()

CrossoverAudio::~CrossoverAudio ( )
virtual

Destructor.

Definition at line 28 of file CrossoverAudio.C.

Member Function Documentation

◆ getChannels()

void CrossoverAudio::getChannels ( int &  inCnt,
int &  outCnt 
)

Get the number of input and output channels

Parameters
[out]inCntThe number of input channels.
[out]outCntThe number of output channels.

Definition at line 101 of file CrossoverAudio.C.

Here is the caller graph for this function:

◆ getDuration()

float CrossoverAudio::getDuration ( void  )
inline

Get the duration for the output data.

Returns
The duration in seconds

Definition at line 86 of file CrossoverAudio.H.

Here is the call graph for this function:

◆ getGain()

float CrossoverAudio::getGain ( void  )
inline

Get the gain for the output data.

Returns
The gain

Definition at line 73 of file CrossoverAudio.H.

Here is the call graph for this function:

◆ getNumberOfRecordedChannels()

virtual int CrossoverAudio::getNumberOfRecordedChannels ( )
inlinevirtual

Get number of recorded channels.

Returns
the number of channels already recorded.

Reimplemented in MixerTestAudio.

Definition at line 121 of file CrossoverAudio.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isRecording()

int CrossoverAudio::isRecording ( )

Test if the recording thread is operational (could also possibly return locked when a 'setter' method is operating.)

Returns
0 if not running, 1 if running.

Definition at line 120 of file CrossoverAudio.C.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextCrossover()

void CrossoverAudio::nextCrossover ( )

Reset to test another crossover without re-recording the channel.

Definition at line 115 of file CrossoverAudio.C.

Here is the caller graph for this function:

◆ processAudio()

int CrossoverAudio::processAudio ( jack_nframes_t  nframes)
privatevirtual

The Jack client callback.

Implements JackClient.

Reimplemented in MixerTestAudio.

Definition at line 31 of file CrossoverAudio.C.

Here is the call graph for this function:

◆ recordNextChannelSet()

int CrossoverAudio::recordNextChannelSet ( )

Record the next set of channels.

Returns
NO_ERROR on success.

Definition at line 106 of file CrossoverAudio.C.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

int CrossoverAudio::reset ( void  )
virtual

Reset the system, initialise ports and the output/input sample data;

Returns
NO_ERROR on success, or when the playback thread is running, it stops it, resets and then returns, indicating that the audio thread was stopped, by returning thread lock error.

Reimplemented in MixerTestAudio.

Definition at line 65 of file CrossoverAudio.C.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChannels()

int CrossoverAudio::setChannels ( int  outCnt,
int  inCnt,
int  testInCnt 
)

Set the channel counts.

Parameters
inCntThe number of input channels.
outCntThe number of output channels.
testInCntThe total number of channels to record for the entire test
Returns
NO_ERROR on success, an error if audio is already playing/recording.

Definition at line 89 of file CrossoverAudio.C.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDuration()

int CrossoverAudio::setDuration ( float  d)

Set the duration to sample for.

Parameters
dThe duration in seconds
Returns
NO_ERROR on success, an error if audio is already playing/recording.

Definition at line 80 of file CrossoverAudio.C.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGain()

void CrossoverAudio::setGain ( float  g)
inline

Set the gain for the output data.

Parameters
gThe gain to set.

Definition at line 66 of file CrossoverAudio.H.

Here is the caller graph for this function:

◆ startClient()

int CrossoverAudio::startClient ( int  inCnt,
int  outCnt,
bool  doConnect 
)
privatevirtual

Start the client running. If the doConnect is true, then an attempt is made to auto connect the ports to the system ports. If auto connection fails, the client is still running.

Parameters
inCntThe number of input ports to connect to
outCntThe number of output ports to connect to
doConnectAuto-connect inputs and outputs to the system ports.
Returns
0 if ok or, JACK_HAS_NO_CAPTURE_PORTS_ERROR, JACK_HAS_NO_PLAYBACK_PORTS_ERROR

Reimplemented from JackClient.

Definition at line 60 of file CrossoverAudio.C.

Here is the call graph for this function:

Member Data Documentation

◆ audio

Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> CrossoverAudio::audio

The first channel is the same data sent over each output channel, then the output channels, then the input channels.

Definition at line 58 of file CrossoverAudio.H.

◆ currentInputChannel

int CrossoverAudio::currentInputChannel
protected

The current input channel to test.

Definition at line 56 of file CrossoverAudio.H.

◆ gain

float CrossoverAudio::gain
protected

The gain for the output.

Definition at line 49 of file CrossoverAudio.H.

◆ recordLock

Mutex CrossoverAudio::recordLock
protected

The lock for when the audio is being played/recorded.

Definition at line 50 of file CrossoverAudio.H.

◆ samplesProcessed

int CrossoverAudio::samplesProcessed
protected

The number of samples already processed.

Definition at line 55 of file CrossoverAudio.H.

◆ samplesToProcess

int CrossoverAudio::samplesToProcess
protected

The number of samples to process, matching the duration.

Definition at line 54 of file CrossoverAudio.H.

◆ zeroSampleCnt

unsigned int CrossoverAudio::zeroSampleCnt
protected

The number of samples to train with zeros.

Definition at line 51 of file CrossoverAudio.H.


The documentation for this class was generated from the following files:
gtkIOStream: CrossoverAudio Class Reference
GTK+ IOStream  Beta