JackTrip.h 19.8 KB
Newer Older
jcaceres's avatar
jcaceres committed
1
2
//*****************************************************************
/*
jcaceres's avatar
jcaceres committed
3
  JackTrip: A System for High-Quality Audio Network Performance
jcaceres's avatar
jcaceres committed
4
5
6
7
  over the Internet

  Copyright (c) 2008 Juan-Pablo Caceres, Chris Chafe.
  SoundWIRE group at CCRMA, Stanford University.
8

jcaceres's avatar
jcaceres committed
9
10
11
12
13
14
15
16
  Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation
  files (the "Software"), to deal in the Software without
  restriction, including without limitation the rights to use,
  copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the
  Software is furnished to do so, subject to the following
  conditions:
17

jcaceres's avatar
jcaceres committed
18
19
  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.
20

jcaceres's avatar
jcaceres committed
21
22
23
24
25
26
27
28
29
30
31
32
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.
*/
//*****************************************************************

/**
jcaceres's avatar
jcaceres committed
33
 * \file JackTrip.h
jcaceres's avatar
jcaceres committed
34
35
36
37
 * \author Juan-Pablo Caceres
 * \date July 2008
 */

jcaceres's avatar
jcaceres committed
38
39
#ifndef __JACKTRIP_H__
#define __JACKTRIP_H__
jcaceres's avatar
jcaceres committed
40

41
//#include <tr1/memory> //for shared_ptr
42
#include <stdexcept>
jcaceres's avatar
jcaceres committed
43

44
#include <QObject>
jcaceres's avatar
jcaceres committed
45
#include <QString>
46
#include <QUdpSocket>
jcaceres's avatar
jcaceres committed
47

jcaceres's avatar
jcaceres committed
48
#include "DataProtocol.h"
49
#include "AudioInterface.h"
50
51

#ifndef __NO_JACK__
jcaceres's avatar
jcaceres committed
52
#include "JackAudioInterface.h"
53
54
#endif //__NO_JACK__

jcacerec's avatar
jcacerec committed
55
#include "PacketHeader.h"
56
#include "RingBuffer.h"
jcaceres's avatar
jcaceres committed
57

58
#include <signal.h>
jcacerec's avatar
More    
jcacerec committed
59
60
/** \brief Main class to creates a SERVER (to listen) or a CLIENT (to connect
 * to a listening server) to send audio streams in the network.
jcaceres's avatar
jcaceres committed
61
 *
jcacerec's avatar
More    
jcacerec committed
62
63
64
 * 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.
jcaceres's avatar
jcaceres committed
65
 */
66

67
class JackTrip : public QThread
jcaceres's avatar
jcaceres committed
68
{
69
    Q_OBJECT;
70

jcaceres's avatar
jcaceres committed
71
72
public:

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    //----------ENUMS------------------------------------------
    /// \brief Enum for the data Protocol. At this time only UDP is implemented
    enum dataProtocolT {
        UDP, ///< Use UDP (User Datagram Protocol)
        TCP, ///< <B>NOT IMPLEMENTED</B>: Use TCP (Transmission Control Protocol)
        SCTP ///< <B>NOT IMPLEMENTED</B>: Use SCTP (Stream Control Transmission Protocol)
    };

    /// \brief Enum for the JackTrip mode
    enum jacktripModeT {
        SERVER, ///< Run in Server Mode
        CLIENT,  ///< Run in Client Mode
        CLIENTTOPINGSERVER, ///< Client of the Ping Server Mode
        SERVERPINGSERVER ///< Server of the MultiThreaded JackTrip
    };

    /// \brief Enum for the JackTrip Underrun Mode, when packets
    enum underrunModeT {
        WAVETABLE, ///< Loops on the last received packet
        ZEROS  ///< Set new buffers to zero if there are no new ones
    };

    /// \brief Enum for Audio Interface Mode
    enum audiointerfaceModeT {
        JACK, ///< Jack Mode
        RTAUDIO  ///< RtAudio Mode
    };

101
    /// \brief Enum for Connection Mode (in packet header)
102
103
104
105
106
    enum connectionModeT {
        NORMAL, ///< Normal Mode
        KSTRONG,  ///< Karplus Strong
        JAMTEST  ///< Karplus Strong
    };
107
108
109

    /// \brief Enum for Hub Server Audio Connection Mode (connections to hub server are automatically patched in Jack)
    enum hubConnectionModeT {
110
        SERVERTOCLIENT, ///< Normal Mode, Sever to All Clients (but not client to any client)
111
        CLIENTECHO,  ///< Client Echo (client self-to-self)
Chris Chafe's avatar
Chris Chafe committed
112
        CLIENTFOFI,  ///< Client Fan Out to Clients and Fan In from Clients (but not self-to-self)
113
114
        RESERVEDMATRIX,  ///< Reserved for custom patch matrix (for TUB ensemble)
        FULLMIX  ///< Client Fan Out to Clients and Fan In from Clients (including self-to-self)
115
    };
116
117
118
119
    //---------------------------------------------------------


    /** \brief The class Constructor with Default Parameters
jcaceres's avatar
jcaceres committed
120
121
122
123
   * \param JacktripMode JackTrip::CLIENT or JackTrip::SERVER
   * \param DataProtocolType JackTrip::dataProtocolT
   * \param NumChans Number of Audio Channels (same for inputs and outputs)
   * \param BufferQueueLength Audio Buffer for receiving packets
jcaceres's avatar
jcaceres committed
124
   * \param AudioBitResolution Audio Sample Resolutions in bits
jcacerec's avatar
jcacerec committed
125
   * \param redundancy redundancy factor for network data
jcaceres's avatar
jcaceres committed
126
   */
127
128
129
    JackTrip(jacktripModeT JacktripMode = CLIENT,
             dataProtocolT DataProtocolType = UDP,
             int NumChans = gDefaultNumInChannels,
Chris Chafe's avatar
src/  
Chris Chafe committed
130
131
132
         #ifdef WAIR // wair
             int NumNetRevChans = 0,
         #endif // endwhere
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
             int BufferQueueLength = gDefaultQueueLength,
             unsigned int redundancy = gDefaultRedundancy,
             AudioInterface::audioBitResolutionT AudioBitResolution =
            AudioInterface::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);

    /// \brief The class destructor
    virtual ~JackTrip();

    /// \brief Starting point for the thread
Chris Chafe's avatar
src/  
Chris Chafe committed
149
150
151
    virtual void run() {
        if (gVerboseFlag) std::cout << "Settings:startJackTrip before mJackTrip->run" << std::endl;
    }
152
153
154
155
156

    /// \brief Set the Peer Address for jacktripModeT::CLIENT mode only
    virtual void setPeerAddress(const char* PeerHostOrIP);

    /** \brief Append a process plugin. Processes will be appended in order
jcaceres's avatar
jcaceres committed
157
158
   * \param plugin Pointer to ProcessPlugin Class
   */
159
160
161
162
    //void appendProcessPlugin(const std::tr1::shared_ptr<ProcessPlugin> plugin);
    virtual void appendProcessPlugin(ProcessPlugin* plugin);

    /// \brief Start the processing threads
Chris Chafe's avatar
src/  
Chris Chafe committed
163
    virtual void startProcess(
Chris Chafe's avatar
Chris Chafe committed
164
        #ifdef WAIRTOMASTER // wair
Chris Chafe's avatar
src/  
Chris Chafe committed
165
166
            int ID
        #endif // endwhere
167
            );
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290

    /// \brief Stop the processing threads
    virtual void stop();

    /// \brief Wait for all the threads to finish. This functions is used when JackTrip is
    /// run as a thread
    virtual void waitThreads();

    /// \brief Check if UDP port is already binded
    /// \param port Port number
    virtual void checkIfPortIsBinded(int port);

    //------------------------------------------------------------------------------------
    /// \name Getters and Setters Methods to change parameters after construction
    //@{
    //
    /// \brief Sets (override) JackTrip Mode after construction
    virtual void setJackTripMode(jacktripModeT JacktripMode)
    { mJackTripMode = JacktripMode; }
    /// \brief Sets (override) DataProtocol Type after construction
    virtual void setDataProtocoType(dataProtocolT DataProtocolType)
    { mDataProtocol = DataProtocolType; }
    /// \brief Sets the Packet header type
    virtual void setPacketHeaderType(DataProtocol::packetHeaderTypeT PacketHeaderType)
    {
        mPacketHeaderType = PacketHeaderType;
        delete mPacketHeader;
        mPacketHeader = NULL;
        createHeader(mPacketHeaderType);
    }
    /// \brief Sets (override) Buffer Queue Length Mode after construction
    virtual void setBufferQueueLength(int BufferQueueLength)
    { mBufferQueueLength = BufferQueueLength; }
    /// \brief Sets (override) Audio Bit Resolution after construction
    virtual void setAudioBitResolution(AudioInterface::audioBitResolutionT AudioBitResolution)
    { mAudioBitResolution = AudioBitResolution; }
    /// \brief Sets (override) Underrun Mode
    virtual void setUnderRunMode(underrunModeT UnderRunMode)
    { mUnderRunMode = UnderRunMode; }
    /// \brief Sets port numbers for the local and peer machine.
    /// Receive port is <tt>port</tt>
    virtual void setAllPorts(int port)
    {
        mReceiverBindPort = port;
        mSenderPeerPort = port;
        mSenderBindPort = port;
        mReceiverPeerPort = port;
    }
    /// \brief Sets port numbers to bind in RECEIVER and SENDER sockets.
    virtual void setBindPorts(int port)
    {
        mReceiverBindPort = port;
        mSenderBindPort = port;
    }
    /// \brief Sets port numbers for the peer (remote) machine.
    virtual void setPeerPorts(int port)
    {
        mSenderPeerPort = port;
        mReceiverPeerPort = port;
    }
    /// \brief Set Client Name to something different that the default (JackTrip)
    virtual void setClientName(const char* ClientName)
    { mJackClientName = ClientName; }
    /// \brief Set the number of audio channels
    virtual void setNumChannels(int num_chans)
    { mNumChans = num_chans; }

    /// Set to connect or not default audio ports (only implemented in Jack)
    virtual void setConnectDefaultAudioPorts(bool connect)
    {mConnectDefaultAudioPorts = connect;}

    virtual int getReceiverBindPort() const
    { return mReceiverBindPort; }
    virtual int getSenderPeerPort() const
    { return mSenderPeerPort; }
    virtual int getSenderBindPort() const
    { return mSenderBindPort; }
    virtual int getReceiverPeerPort() const
    { return mReceiverPeerPort; }

    virtual DataProtocol* getDataProtocolSender() const
    { return mDataProtocolSender; }
    virtual DataProtocol* getDataProtocolReceiver() const
    { return mDataProtocolReceiver; }
    virtual void setDataProtocolSender(DataProtocol* const DataProtocolSender)
    { mDataProtocolSender = DataProtocolSender; }
    virtual void setDataProtocolReceiver(DataProtocol* const DataProtocolReceiver)
    { mDataProtocolReceiver = DataProtocolReceiver; }

    virtual RingBuffer* getSendRingBuffer() const
    { return mSendRingBuffer; }
    virtual RingBuffer* getReceiveRingBuffer() const
    { return mReceiveRingBuffer; }
    virtual void setSendRingBuffer(RingBuffer* const SendRingBuffer)
    { mSendRingBuffer = SendRingBuffer; }
    virtual void setReceiveRingBuffer(RingBuffer* const ReceiveRingBuffer)
    { mReceiveRingBuffer = ReceiveRingBuffer; }

    virtual void setPacketHeader(PacketHeader* const PacketHeader)
    { mPacketHeader = PacketHeader; }

    virtual int getRingBuffersSlotSize()
    { return getTotalAudioPacketSizeInBytes(); }

    virtual void setAudiointerfaceMode(JackTrip::audiointerfaceModeT audiointerface_mode)
    { mAudiointerfaceMode = audiointerface_mode; }
    virtual void setAudioInterface(AudioInterface* const AudioInterface)
    { mAudioInterface = AudioInterface; }


    void setSampleRate(uint32_t sample_rate)
    { mSampleRate = sample_rate; }
    void setDeviceID(uint32_t device_id)
    { mDeviceID = device_id; }
    void setAudioBufferSizeInSamples(uint32_t buf_size)
    { mAudioBufferSize = buf_size; }


    JackTrip::connectionModeT getConnectionMode() const
    { return mConnectionMode; }
    void setConnectionMode(JackTrip::connectionModeT connection_mode)
    { mConnectionMode = connection_mode; }

291
292
293
294
295
    JackTrip::hubConnectionModeT getHubConnectionModeT() const
    { return mHubConnectionModeT; }
    void setHubConnectionModeT(JackTrip::hubConnectionModeT connection_mode)
    { mHubConnectionModeT = connection_mode; }

296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
    JackTrip::jacktripModeT getJackTripMode() const
    { return mJackTripMode; }

    QString getPeerAddress() const
    { return mPeerAddress; }

    bool receivedConnectionFromPeer()
    { return mReceivedConnection; }

    bool tcpConnectionError()
    { return mTcpConnectionError; }
    //@}
    //------------------------------------------------------------------------------------


    //------------------------------------------------------------------------------------
    /// \name Mediator Functions
    //@{
    /// \todo Document all these functions
    virtual void createHeader(const DataProtocol::packetHeaderTypeT headertype);
    void putHeaderInPacket(int8_t* full_packet, int8_t* audio_packet);
    virtual int getPacketSizeInBytes();
    void parseAudioPacket(int8_t* full_packet, int8_t* audio_packet);
    virtual void sendNetworkPacket(const int8_t* ptrToSlot)
    { mSendRingBuffer->insertSlotNonBlocking(ptrToSlot); }
    virtual void receiveNetworkPacket(int8_t* ptrToReadSlot)
    { mReceiveRingBuffer->readSlotNonBlocking(ptrToReadSlot); }
    virtual void readAudioBuffer(int8_t* ptrToReadSlot)
    { mSendRingBuffer->readSlotBlocking(ptrToReadSlot); }
    virtual void writeAudioBuffer(const int8_t* ptrToSlot)
    { mReceiveRingBuffer->insertSlotNonBlocking(ptrToSlot); }
    uint32_t getBufferSizeInSamples() const
    { return mAudioBufferSize; /*return mAudioInterface->getBufferSizeInSamples();*/ }
    uint32_t getDeviceID() const
    { return mDeviceID; /*return mAudioInterface->mDeviceID();*/ }

    AudioInterface::samplingRateT getSampleRateType() const
    { return mAudioInterface->getSampleRateType(); }
    int getSampleRate() const
    { return mSampleRate; /*return mAudioInterface->getSampleRate();*/ }

    uint8_t getAudioBitResolution() const
    { return mAudioBitResolution*8; /*return mAudioInterface->getAudioBitResolution();*/ }
    unsigned int getNumInputChannels() const
    { return mNumChans; /*return mAudioInterface->getNumInputChannels();*/ }
    unsigned int getNumOutputChannels() const
    { return mNumChans; /*return mAudioInterface->getNumOutputChannels();*/ }
    unsigned int getNumChannels() const
    {
        if (getNumInputChannels() == getNumOutputChannels())
        { return getNumInputChannels(); }
        else { return 0; }
    }
    virtual void checkPeerSettings(int8_t* full_packet);
    void increaseSequenceNumber()
    { mPacketHeader->increaseSequenceNumber(); }
    int getSequenceNumber() const
    { return mPacketHeader->getSequenceNumber(); }

    uint64_t getPeerTimeStamp(int8_t* full_packet) const
    { return mPacketHeader->getPeerTimeStamp(full_packet); }

    uint16_t getPeerSequenceNumber(int8_t* full_packet) const
    { return mPacketHeader->getPeerSequenceNumber(full_packet); }

    uint16_t getPeerBufferSize(int8_t* full_packet) const
    { return mPacketHeader->getPeerBufferSize(full_packet); }

    uint8_t getPeerSamplingRate(int8_t* full_packet) const
    { return mPacketHeader->getPeerSamplingRate(full_packet); }

    uint8_t getPeerBitResolution(int8_t* full_packet) const
    { return mPacketHeader->getPeerBitResolution(full_packet); }

    uint8_t  getPeerNumChannels(int8_t* full_packet) const
    { return mPacketHeader->getPeerNumChannels(full_packet); }

    uint8_t  getPeerConnectionMode(int8_t* full_packet) const
    { return mPacketHeader->getPeerConnectionMode(full_packet); }

    size_t getSizeInBytesPerChannel() const
    { return mAudioInterface->getSizeInBytesPerChannel(); }
    int getHeaderSizeInBytes() const
    { return mPacketHeader->getHeaderSizeInBytes(); }
    virtual int getTotalAudioPacketSizeInBytes() const
Chris Chafe's avatar
src/  
Chris Chafe committed
381
382
383
384
385
386
387
388
    {
#ifdef WAIR // WAIR
        if (mNumNetRevChans)
            return mAudioInterface->getSizeInBytesPerChannel() * mNumNetRevChans;
        else // not wair
#endif // endwhere
            return mAudioInterface->getSizeInBytesPerChannel() * mNumChans;
    }
389
390
391
392
393
    //@}
    //------------------------------------------------------------------------------------

    void printTextTest() {std::cout << "=== JackTrip PRINT ===" << std::endl;}
    void printTextTest2() {std::cout << "=== JackTrip PRINT2 ===" << std::endl;}
jcaceres's avatar
jcaceres committed
394

395
public slots:
396
397
398
399
400
401
402
403
404
    /// \brief Slot to stop all the processes and threads
    virtual void slotStopProcesses()
    {
        std::cout << "Stopping JackTrip..." << std::endl;
        mStopped = true;
        this->stop();
    }

    /** \brief This slot emits in turn the signal signalNoUdpPacketsForSeconds
405
   * when UDP has waited for more than 30 seconds.
406
   *
407
408
   * It is used to remove the thread from the server.
   */
Chris Chafe's avatar
src/  
Chris Chafe committed
409
    void slotUdpWaitingTooLongClientGoneProbably(int wait_msec)
410
    {
411
        int wait_time = 10000; // msec
412
        if ( !(wait_msec%wait_time) ) {
413
            std::cerr << "UDP WAITED MORE THAN 10 seconds." << std::endl;
414
415
            emit signalNoUdpPacketsForSeconds();
        }
416
    }
417
418
419
420
    void slotPrintTest()
    { std::cout << "=== TESTING ===" << std::endl; }
    void slotReceivedConnectionFromPeer()
    { mReceivedConnection = true; }
421

422

423
signals:
424

425
426
427
428
429
430
    void signalUdpTimeOut();
    /// \brief Signal emitted when all the processes and threads are stopped
    void signalProcessesStopped();
    /// \brief Signal emitted when no UDP Packets have been received for a while
    void signalNoUdpPacketsForSeconds();
    void signalTcpClientConnected();
431

432

433
public:
jcaceres's avatar
jcaceres committed
434

435
    /// \brief Set the AudioInteface object
Chris Chafe's avatar
src/  
Chris Chafe committed
436
    virtual void setupAudio(
Chris Chafe's avatar
Chris Chafe committed
437
        #ifdef WAIRTOMASTER // WAIR
Chris Chafe's avatar
src/  
Chris Chafe committed
438
439
440
            int ID
        #endif // endwhere
            );
441
442
443
444
445
446
447
    /// \brief Close the JackAudioInteface and disconnects it from JACK
    void closeAudio();
    /// \brief Set the DataProtocol objects
    virtual void setupDataProtocol();
    /// \brief Set the RingBuffer objects
    void setupRingBuffers();
    /// \brief Starts for the CLIENT mode
448
    void clientStart();
449
450
451
452
    /// \brief Starts for the SERVER mode
    /// \param timout Set the server to timeout after 2 seconds if no client connections are received.
    /// Usefull for the multithreaded server
    /// \return 0 on success, -1 on error
453
    int serverStart(bool timeout = false, int udpTimeout = gTimeOutMultiThreadedServer);
454
455
    /// \brief Stats for the Client to Ping Server
    /// \return -1 on error, 0 on success
456
    virtual int clientPingToServerStart();
jcaceres's avatar
jcaceres committed
457

458
private:
459
460
461
462
463
464
465
466
467
468
469
    //void bindReceiveSocket(QUdpSocket& UdpSocket, int bind_port,
    //                       QHostAddress PeerHostAddress, int peer_port)
    //throw(std::runtime_error);


    jacktripModeT mJackTripMode; ///< JackTrip::jacktripModeT
    dataProtocolT mDataProtocol; ///< Data Protocol Tipe
    DataProtocol::packetHeaderTypeT mPacketHeaderType; ///< Packet Header Type
    JackTrip::audiointerfaceModeT mAudiointerfaceMode;

    int mNumChans; ///< Number of Channels (inputs = outputs)
Chris Chafe's avatar
src/  
Chris Chafe committed
470
471
472
#ifdef WAIR // WAIR
    int mNumNetRevChans; ///< Number of Network Audio Channels (net comb filters)
#endif // endwhere
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
    int mBufferQueueLength; ///< Audio Buffer from network queue length
    uint32_t mSampleRate; ///< Sample Rate
    uint32_t mDeviceID; ///< RTAudio DeviceID
    uint32_t mAudioBufferSize; ///< Audio buffer size to process on each callback
    AudioInterface::audioBitResolutionT mAudioBitResolution; ///< Audio Bit Resolutions
    QString mPeerAddress; ///< Peer Address to use in jacktripModeT::CLIENT Mode

    /// Pointer to Abstract Type DataProtocol that sends packets
    DataProtocol* mDataProtocolSender;
    /// Pointer to Abstract Type DataProtocol that receives packets
    DataProtocol* mDataProtocolReceiver;
    AudioInterface* mAudioInterface; ///< Interface to Jack Client
    PacketHeader* mPacketHeader; ///< Pointer to Packet Header
    underrunModeT mUnderRunMode; ///< underrunModeT Mode

    /// Pointer for the Send RingBuffer
    RingBuffer* mSendRingBuffer;
    /// Pointer for the Receive RingBuffer
    RingBuffer* mReceiveRingBuffer;

    int mReceiverBindPort; ///< Incoming (receiving) port for local machine
    int mSenderPeerPort; ///< Incoming (receiving) port for peer machine
    int mSenderBindPort; ///< Outgoing (sending) port for local machine
    int mReceiverPeerPort; ///< Outgoing (sending) port for peer machine
    int mTcpServerPort;

    unsigned int mRedundancy; ///< Redundancy factor in network data
    const char* mJackClientName; ///< JackAudio Client Name

    JackTrip::connectionModeT mConnectionMode; ///< Connection Mode
503
    JackTrip::hubConnectionModeT mHubConnectionModeT; ///< Hub Server Jack Audio Patch Connection Mode
504
505
506
507
508
509
510
511

    QVector<ProcessPlugin*> mProcessPlugins; ///< Vector of ProcesPlugin<EM>s</EM>

    volatile bool mReceivedConnection; ///< Bool of received connection from peer
    volatile bool mTcpConnectionError;
    volatile bool mStopped;

    bool mConnectDefaultAudioPorts; ///< Connect or not default audio ports
jcaceres's avatar
jcaceres committed
512
513
514
};

#endif