Logo Search packages:      
Sourcecode: jacktrip version File versions  Download package

Public Types | Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes

JackTrip Class Reference

Main class to creates a SERVER (to listen) or a CLIENT (to connect to a listening server) to send audio streams in the network. More...

#include <JackTrip.h>

Collaboration diagram for JackTrip:
Collaboration graph

List of all members.

Public Types

enum  dataProtocolT { UDP, TCP, SCTP }

Enum for the data Protocol. At this time only UDP is implemented.


Enum for the JackTrip mode.

enum  underrunModeT { WAVETABLE, ZEROS }

Enum for the JackTrip Underrun Mode, when packets.


Public Slots

void slotStopProcesses ()
 Slot to stop all the processes and threads.
void slotUdpWatingTooLong (int wait_msec)
 This slot emits in turn the signal signalNoUdpPacketsForSeconds when UDP is waited for more than 30 seconds.


void signalNoUdpPacketsForSeconds ()
 Signal emitted when no UDP Packets have been received for a while
void signalProcessesStopped ()
 Signal emitted when all the processes and threads are stopped

Public Member Functions

void appendProcessPlugin (ProcessPlugin *plugin)
 Append a process plugin. Processes will be appended in order.
void checkIfPortIsBinded (int port)
 Check if UDP port is already binded.
 JackTrip (jacktripModeT JacktripMode=CLIENT, dataProtocolT DataProtocolType=UDP, int NumChans=2, int BufferQueueLength=8, unsigned int redundancy=1, JackAudioInterface::audioBitResolutionT AudioBitResolution=JackAudioInterface::BIT16, DataProtocol::packetHeaderTypeT PacketHeaderType=DataProtocol::DEFAULT, underrunModeT UnderRunMode=WAVETABLE, int receiver_bind_port=gDefaultPort, int sender_bind_port=gDefaultPort, int receiver_peer_port=gDefaultPort, int sender_peer_port=gDefaultPort)
 The class Constructor with Default Parameters.
void setPeerAddress (const char *PeerHostOrIP)
 Set the Peer Address for jacktripModeT::CLIENT mode only.
void start ()
 Start the processing threads.
void stop ()
 Stop the processing threads.
void wait ()
 Wait for all the threads to finish. This functions is used when JackTrip is run as a thread.
virtual ~JackTrip ()
 The class destructor.
Methods to change parameters after construction
void setJackTripMode (jacktripModeT JacktripMode)
 Sets (override) JackTrip Mode after construction.
void setDataProtocoType (dataProtocolT DataProtocolType)
 Sets (override) DataProtocol Type after construction.
void setPacketHeaderType (DataProtocol::packetHeaderTypeT PacketHeaderType)
 Sets the Packet header type.
void setBufferQueueLength (int BufferQueueLength)
 Sets (override) Number of Channels after construction.
void setAudioBitResolution (JackAudioInterface::audioBitResolutionT AudioBitResolution)
 Sets (override) Audio Bit Resolution after construction.
void setUnderRunMode (underrunModeT UnderRunMode)
 Sets (override) Underrun Mode.
void setAllPorts (int port)
 Sets port numbers for the local and peer machine. Receive port is port
void setBindPorts (int port)
 Sets port numbers to bind in RECEIVER and SENDER sockets.
void setPeerPorts (int port)
 Sets port numbers for the peer (remote) machine.
void setClientName (char *ClientName)
 Set Client Name to something different that the default (JackTrip)
Mediator Functions
void createHeader (const DataProtocol::packetHeaderTypeT headertype)
void putHeaderInPacket (int8_t *full_packet, int8_t *audio_packet)
int getPacketSizeInBytes () const
void parseAudioPacket (int8_t *full_packet, int8_t *audio_packet)
void sendNetworkPacket (const int8_t *ptrToSlot)
void receiveNetworkPacket (int8_t *ptrToReadSlot)
void readAudioBuffer (int8_t *ptrToReadSlot)
void writeAudioBuffer (const int8_t *ptrToSlot)
uint32_t getBufferSizeInSamples () const
JackAudioInterface::samplingRateT getSampleRateType () const
uint8_t getAudioBitResolution () const
int getNumInputChannels () const
int getNumOutputChannels () const
void checkPeerSettings (int8_t *full_packet)
void increaseSequenceNumber ()
int getSequenceNumber () const
int getPeerSequenceNumber (int8_t *full_packet) const

Private Member Functions

void clientPingToServerStart ()
 Stats for the Client to Ping Server.
void clientStart ()
 Starts for the CLIENT mode.
void serverStart ()
 Starts for the SERVER mode.
void setupDataProtocol ()
 Set the DataProtocol objects.
void setupJackAudio ()
 Set the JackAudioInteface object.
void setupRingBuffers ()
 Set the RingBuffer objects.

Private Attributes

JackAudioInterface::audioBitResolutionT mAudioBitResolution
 Audio Bit Resolutions.
uint32_t mAudioBufferSize
 Audio buffer size to process on each callback.
int mBufferQueueLength
 Audio Buffer from network queue length.
dataProtocolT mDataProtocol
 Data Protocol Tipe.
 Pointer to Abstract Type DataProtocol that sends packets.
 Interface to Jack Client.
const char * mJackClientName
 JackAudio Client Name.
jacktripModeT mJackTripMode
int mNumChans
 Number of Channels (inputs = outputs)
 Pointer to Packet Header.
DataProtocol::packetHeaderTypeT mPacketHeaderType
 Packet Header Type.
QString mPeerAddress
 Peer Address to use in jacktripModeT::CLIENT Mode.
QVector< ProcessPlugin * > mProcessPlugins
 Vector of ProcesPlugins
int mReceiverBindPort
 Incoming (receiving) port for local machine.
 Pointer for the Receive RingBuffer.
int mReceiverPeerPort
 Outgoing (sending) port for peer machine.
unsigned int mRedundancy
 Redundancy factor in network data.
uint32_t mSampleRate
 Sample Rate.
int mSenderBindPort
 Outgoing (sending) port for local machine.
int mSenderPeerPort
 Incoming (receiving) port for peer machine.
 Pointer for the Send RingBuffer.
underrunModeT mUnderRunMode
 underrunModeT Mode

Detailed Description

Main class to creates a SERVER (to listen) or a CLIENT (to connect to a listening server) to send audio streams in the network.

All audio and network settings can be set in this class. This class also acts as a Mediator between all the other class. Classes that uses JackTrip methods need to register with it.

Definition at line 59 of file JackTrip.h.

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

Generated by  Doxygen 1.6.0   Back to index