JackTrip

Public Member Functions | List of all members
RtAudioInterface Class Reference

Base Class that provides an interface with RtAudio. More...

`#include <RtAudioInterface.h>`

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

## Public Member Functions
| RtAudioInterface (JackTrip *jacktrip, int NumInChans=gDefaultNumInChannels, int NumOutChans=gDefaultNumOutChannels, audioBitResolutionT AudioBitResolution=BIT16)
| The class constructor. More...
virtual | ~RtAudioInterface ()
| The class destructor. More...
virtual void | listAllInterfaces ()
| List all avialable audio interfaces, with its properties. More...
virtual void | setup ()
| Setup the client. This function should be called just before. More...
virtual int | startProcess () const
| Tell the audio server that we are ready to roll. The process-callback will start running. This runs on its own thread. More...
virtual int | stopProcess () const
| Stops the process-callback thread. More...
virtual void | connectDefaultPorts ()
| This has no effect in RtAudio. More...
virtual void | setClientName (const char *)
| This has no effect in RtAudio. More...
Public Member Functions inherited from AudioInterface
| AudioInterface (JackTrip *jacktrip, int NumInChans, int NumOutChans, AudioInterface::audioBitResolutionT AudioBitResolution=AudioInterface::BIT16)
| The class constructor. More...
virtual | ~AudioInterface ()
| The class destructor. More...
virtual void | callback (QVarLengthArray< sample_t *> &in_buffer, QVarLengthArray< sample_t *> &out_buffer, unsigned int n_frames)
| Process callback. Subclass should call this callback after obtaining the in_buffer and out_buffer pointers. More...
virtual void | appendProcessPlugin (ProcessPlugin *plugin)
| Append a ProcessPlugin. The order of processing is determined by the order by which appending is done. More...
virtual void | setNumInputChannels (int nchannels)
virtual void | setNumOutputChannels (int nchannels)
virtual void | setSampleRate (uint32_t sample_rate)
virtual void | setBufferSizeInSamples (uint32_t buf_size)
virtual int | getNumInputChannels () const
| Get Number of Input Channels. More...
virtual int | getNumOutputChannels () const
| Get Number of Output Channels. More...
virtual uint32_t | getBufferSizeInSamples () const
virtual size_t | getSizeInBytesPerChannel () const
virtual uint32_t | getSampleRate () const
| Get the Jack Server Sampling Rate, in samples/second. More...
virtual samplingRateT | getSampleRateType () const
| Get the Jack Server Sampling Rate Enum Type samplingRateT. More...
virtual int | getAudioBitResolution () const
| Get the Audio Bit Resolution, in bits. More...

## Additional Inherited Members
Public Types inherited from AudioInterface
enum | audioBitResolutionT { BIT8 = 1, BIT16 = 2, BIT24 = 3, BIT32 = 4 }
| Enum for Audio Resolution in bits. More...
enum | samplingRateT { SR22, SR32, SR44, SR48, SR88, SR96, SR192, UNDEF }
| Sampling Rates supported by JACK. More...
Static Public Member Functions inherited from AudioInterface
static void | fromSampleToBitConversion (const sample_t *const input, int8_t *output, const AudioInterface::audioBitResolutionT targetBitResolution)
| Convert a 32bit number (sample_t) into one of the bit resolution supported (audioBitResolutionT). More...
static void | fromBitToSampleConversion (const int8_t *const input, sample_t *output, const AudioInterface::audioBitResolutionT sourceBitResolution)
| Convert a audioBitResolutionT bit resolution number into a 32bit number (sample_t) More...
static int | getSampleRateFromType (samplingRateT rate_type)
| Helper function to get the sample rate (in Hz) for a JackAudioInterface::samplingRateT. More...

## Detailed Description

Base Class that provides an interface with RtAudio.

## Constructor & Destructor Documentation

## ◆ RtAudioInterface()

RtAudioInterface::RtAudioInterface | ( | JackTrip * | jacktrip,
|  | int | NumInChans = `gDefaultNumInChannels`,
|  | int | NumOutChans = `gDefaultNumOutChannels`,
|  | audioBitResolutionT | AudioBitResolution = `BIT16`
| ) |  |

The class constructor.

Parameters

  jacktrip | Pointer to the JackTrip class that connects all classes (mediator)
  NumInChans | Number of Input Channels
  NumOutChans | Number of Output Channels
  AudioBitResolution | Audio Sample Resolutions in bits

## ◆ ~RtAudioInterface()

RtAudioInterface::~RtAudioInterface | ( |  | ) |
| virtual

The class destructor.

## Member Function Documentation

## ◆ connectDefaultPorts()

virtual void RtAudioInterface::connectDefaultPorts | ( |  | ) |
| inline virtual

This has no effect in RtAudio.

Implements AudioInterface.

## ◆ listAllInterfaces()

void RtAudioInterface::listAllInterfaces | ( |  | ) |
| virtual

List all avialable audio interfaces, with its properties.

## ◆ setClientName()

virtual void RtAudioInterface::setClientName | ( | const char * |  | ) |
| inline virtual

This has no effect in RtAudio.

Implements AudioInterface.

## ◆ setup()

void RtAudioInterface::setup | ( |  | ) |
| virtual

Setup the client. This function should be called just before.

starting the audio processes, it will setup the audio client with the class parameters, like Sampling Rate, Packet Size, Bit Resolution, etc... Sub-classes should also call the parent method to ensure correct inizialization.

Reimplemented from AudioInterface.

## ◆ startProcess()

int RtAudioInterface::startProcess | ( |  | ) | const
| virtual

Tell the audio server that we are ready to roll. The process-callback will start running. This runs on its own thread.

Returns
  0 on success, otherwise a non-zero error code

Implements AudioInterface.

## ◆ stopProcess()

int RtAudioInterface::stopProcess | ( |  | ) | const
| virtual

Stops the process-callback thread.

Returns
  0 on success, otherwise a non-zero error code

Implements AudioInterface.

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

- src/RtAudioInterface.h
- src/RtAudioInterface.cpp