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

#include <WSOLAJack.H>

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

Public Member Functions

 WSOLAJack (string fileName)
 
 ~WSOLAJack (void)
 Destructor. More...
 
void setTimeScale (FP_TYPE ts)
 
- Public Member Functions inherited from WSOLA
 WSOLA ()
 
 WSOLA (int chCnt)
 
virtual ~WSOLA ()
 Destructor. More...
 
template<typename Derived >
int process (FP_TYPE timeScale, const DenseBase< Derived > &input)
 
void processInner (void)
 
int getMaxInputSamplesRequired (void)
 
int getSamplesRequired (void)
 
int getOutputSize (void)
 
void reset (int chCnt)
 
int noMoreAudio ()
 
int loadInput (int n, int m, FP_TYPE val)
 
FP_TYPE unloadOutput (int n, int m)
 
void setFS (float fsIn)
 
- 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 ()
 
virtual int startClient (int inCnt, int outCnt, bool doConnect=true)
 
- 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)
 

Private Member Functions

int processAudio (jack_nframes_t nframes)
 
int readAudio (int sampleCount)
 

Private Attributes

FP_TYPE timeScale
 The time scale to use for speed scaling the audio. More...
 
Sox< FP_TYPEsox
 Audio file reading class. More...
 
Matrix< FP_TYPE, Dynamic, Dynamic > audioData
 The audio data which has been read from the sox file. More...
 
int N
 The number of audio samples required by WSOLA from the audio file. More...
 
jack_default_audio_sample_t ** outs
 The number of output port created for this audio stream. More...
 

Additional Inherited Members

- Public Attributes inherited from WSOLA
Array< FP_TYPE, Dynamic, Dynamic > output
 The output vector, each row is a channel. More...
 
Array< FP_TYPE, Dynamic, Dynamic > input
 The input vector, each row is a channel. 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 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)
 
- 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...
 

Detailed Description

Connects WSOLA to the audio system using JackClient.

Definition at line 26 of file WSOLAJack.H.

Constructor & Destructor Documentation

◆ WSOLAJack()

WSOLAJack::WSOLAJack ( string  fileName)
inline

Constructor Using the filename, open the audio file, read the first block of data, connect to and configure Jack. Also process the first block to init any memory in the first pass of WSOLA.

Parameters
fileNameThe name of the audio file to open.

Definition at line 101 of file WSOLAJack.H.

Here is the call graph for this function:

◆ ~WSOLAJack()

WSOLAJack::~WSOLAJack ( void  )
inline

Destructor.

Definition at line 153 of file WSOLAJack.H.

Here is the call graph for this function:

Member Function Documentation

◆ processAudio()

int WSOLAJack::processAudio ( jack_nframes_t  nframes)
inlineprivatevirtual

The Jack client callback. Initialises by setting up the output buffers. Steps through all nframes in chunks of N/2 output samples. Outputs the last N/2 chunk of samples, processes a new chunk, Reads in a chunk. Exits. Returns non-zero when new samples can't be retrieved from file.

Implements JackClient.

Definition at line 44 of file WSOLAJack.H.

Here is the call graph for this function:

◆ readAudio()

int WSOLAJack::readAudio ( int  sampleCount)
inlineprivate

Definition at line 81 of file WSOLAJack.H.

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

◆ setTimeScale()

void WSOLAJack::setTimeScale ( FP_TYPE  ts)
inline

Definition at line 159 of file WSOLAJack.H.

Here is the caller graph for this function:

Member Data Documentation

◆ audioData

Matrix<FP_TYPE, Dynamic, Dynamic> WSOLAJack::audioData
private

The audio data which has been read from the sox file.

Definition at line 31 of file WSOLAJack.H.

◆ N

int WSOLAJack::N
private

The number of audio samples required by WSOLA from the audio file.

Definition at line 33 of file WSOLAJack.H.

◆ outs

jack_default_audio_sample_t** WSOLAJack::outs
private

The number of output port created for this audio stream.

Definition at line 35 of file WSOLAJack.H.

◆ sox

Sox<FP_TYPE> WSOLAJack::sox
private

Audio file reading class.

Definition at line 29 of file WSOLAJack.H.

◆ timeScale

FP_TYPE WSOLAJack::timeScale
private

The time scale to use for speed scaling the audio.

Definition at line 27 of file WSOLAJack.H.


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