AudibleT 0.0.1
A real-time A/B/X audio testing tool for subjective assessment of various audio parameters, compatible for general purpose computer as well as embedded systems.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
JackClientAudioEngine Class Reference

An audio engine class for handling audio processing through the JACK Audio Connection Kit. More...

#include <JackClientAudioEngine.h>

Inheritance diagram for JackClientAudioEngine:
Inheritance graph
[legend]
Collaboration diagram for JackClientAudioEngine:
Collaboration graph
[legend]

Public Member Functions

 JackClientAudioEngine () noexcept
 Constructor for JackClientAudioEngine.
 
int audioCallback (jack_nframes_t nframes, audioBufVector inBufs, audioBufVector outBufs) override
 The audio processing callback function.
 
void setVolumeLevel (int level) noexcept
 Set the volume level.
 
void setFilterConfig (int frequency, int gain) noexcept
 Set the filter configuration.
 
void setAudioFile (const AudioFile< float > &file)
 Set the audio file for playback.
 
void setIsPlayingModified (bool playingModified) noexcept
 Set whether the audio is being modified.
 
void setAudioSource (SourceType type) noexcept
 Set the audio source type.
 
void setActiveFilterType (FilterType filterType) noexcept
 Set the active filter type.
 
- Public Member Functions inherited from JackCpp::AudioIO
jack_client_t * client ()
 Gives users a pointer to the client created and used by this class.
 
 AudioIO (std::string name, unsigned int inPorts=0, unsigned int outPorts=2, bool startServer=true) noexcept(false)
 The Constructor.
 
void createClient (std::string name, unsigned int inPorts=0, unsigned int outPorts=2, bool startServer=true) noexcept(false)
 
virtual ~AudioIO ()
 The Destructor.
 
bool portExists (std::string name)
 See if a port with the name "name" exists for our client.
 
virtual void reserveOutPorts (unsigned int num) noexcept(false)
 Reserve output ports.
 
virtual void reserveInPorts (unsigned int num) noexcept(false)
 Reserve input ports.
 
void start () noexcept(false)
 Start the jack client.
 
void stop () noexcept(false)
 Stop the jack client.
 
void close () noexcept(false)
 Close the jack client.
 
unsigned int inPorts ()
 Get the number of jack input ports.
 
unsigned int outPorts ()
 Get the number of jack output ports.
 
virtual unsigned int addInPort (std::string name) noexcept(false)
 Add a jack input port to our client.
 
virtual unsigned int addOutPort (std::string name) noexcept(false)
 Add a jack output port to our client.
 
void connectTo (unsigned int index, std::string sourcePortName) noexcept(false)
 Connect our output to a jack client's source port.
 
void connectFrom (unsigned int index, std::string destPortName) noexcept(false)
 Connect our input to a jack client's destination port.
 
void connectToPhysical (unsigned int index, unsigned physical_index) noexcept(false)
 Connect our output port to a physical output port.
 
void connectFromPhysical (unsigned int index, unsigned physical_index) noexcept(false)
 Connect our input port to a physical input port.
 
void disconnectInPort (unsigned int index) noexcept(false)
 Disconnect input port from all connections.
 
void disconnectOutPort (unsigned int index) noexcept(false)
 Disconnect output port from all connections.
 
unsigned int numConnectionsInPort (unsigned int index) noexcept(false)
 Get the number of connections to our input port.
 
unsigned int numConnectionsOutPort (unsigned int index) noexcept(false)
 Get the number of connections to our output port.
 
unsigned int numPhysicalSourcePorts ()
 Get the number of physical audio input ports These are ports that can send audio to your client.
 
unsigned int numPhysicalDestinationPorts ()
 Get the number of physical audio output ports These are ports that your client can send audio to.
 
std::string getInputPortName (unsigned int index) noexcept(false)
 Get the name of our client's input port.
 
std::string getOutputPortName (unsigned int index) noexcept(false)
 Get the name of our client's output port.
 
virtual void jackShutdownCallback ()
 This method is called when Jack shuts down. Override if you want to do something when jack shuts down.
 
float getCpuLoad ()
 The current CPU load estimated by JACK.
 
jack_nframes_t getSampleRate ()
 Get the sample rate.
 
jack_nframes_t getBufferSize ()
 Get the jack buffer size.
 
bool isRealTime ()
 Check to see if the client is running in real time mode.
 
bool isBufferMemoryLocked ()
 Check to see if the buffer is locked into the memory.
 
std::string getName ()
 Get the name of our client.
 
jack_state_t getState ()
 Get the state of our Jack client.
 
jack_nframes_t getFrameTime ()
 Get an estimate of the current time in frames.
 
jack_nframes_t getFramesSinceCycleStart ()
 Get the time in frames since the JACK server began the current process cycle.
 

Additional Inherited Members

- Public Types inherited from JackCpp::AudioIO
enum  jack_state_t { notActive , active , closed }
 An enum indicating the state of our jack client.
 
typedef std::vector< jack_default_audio_sample_t * > audioBufVector
 A typedef so so that we don't always have to write std::vector<jack_default_audio_sample_t *>
 
- Static Public Member Functions inherited from JackCpp::AudioIO
static int jackProcessCallback (jack_nframes_t nframes, void *arg)
 The callback that jack actually gets [static].
 
virtual int audioCallback (jack_nframes_t nframes, audioBufVector inBufs, audioBufVector outBufs)=0
 The method that the user must overload in order to actually process jack data.
 

Detailed Description

An audio engine class for handling audio processing through the JACK Audio Connection Kit.

The JackClientAudioEngine class manages audio input and output processing, allowing for filtering of audio data and control over various audio parameters.

Constructor & Destructor Documentation

◆ JackClientAudioEngine()

JackClientAudioEngine::JackClientAudioEngine ( )
noexcept

Constructor for JackClientAudioEngine.

Initializes a JackClientAudioEngine instance with default settings.

Member Function Documentation

◆ audioCallback()

int JackClientAudioEngine::audioCallback ( jack_nframes_t  nframes,
audioBufVector  inBufs,
audioBufVector  outBufs 
)
overridevirtual

The audio processing callback function.

Processes audio data frames through JACK, managing input and output buffers.

Parameters
nframesNumber of frames to process.
inBufsVector of input buffers.
outBufsVector of output buffers.
Returns
int Status of the callback execution (0 for success).

Implements JackCpp::AudioIO.

◆ setActiveFilterType()

void JackClientAudioEngine::setActiveFilterType ( FilterType  filterType)
noexcept

Set the active filter type.

Parameters
filterTypeThe filter type to set.

◆ setAudioFile()

void JackClientAudioEngine::setAudioFile ( const AudioFile< float > &  file)

Set the audio file for playback.

Parameters
fileThe audio file to play.

◆ setAudioSource()

void JackClientAudioEngine::setAudioSource ( SourceType  type)
noexcept

Set the audio source type.

Parameters
typeThe source type to set.

◆ setFilterConfig()

void JackClientAudioEngine::setFilterConfig ( int  frequency,
int  gain 
)
noexcept

Set the filter configuration.

Parameters
frequencyThe cutoff frequency of the filter.
gainThe gain of the filter in dB.

◆ setIsPlayingModified()

void JackClientAudioEngine::setIsPlayingModified ( bool  playingModified)
noexcept

Set whether the audio is being modified.

Parameters
playingModifiedTrue if the audio is being modified, false otherwise.

◆ setVolumeLevel()

void JackClientAudioEngine::setVolumeLevel ( int  level)
noexcept

Set the volume level.

Parameters
levelThe volume level to set.

The documentation for this class was generated from the following files: