Unverified Commit b0d1811c authored by Aaron Wyatt's avatar Aaron Wyatt Committed by GitHub
Browse files

Add files via upload

Make sure -q value is honoured in hub client mode.
parent bba84f01
......@@ -57,9 +57,10 @@
using std::cout; using std::endl;
//*******************************************************************************
JackTripWorker::JackTripWorker(UdpMasterListener* udpmasterlistener, JackTrip::underrunModeT UnderRunMode) :
JackTripWorker::JackTripWorker(UdpMasterListener* udpmasterlistener, int BufferQueueLength, JackTrip::underrunModeT UnderRunMode) :
mUdpMasterListener(udpmasterlistener),
m_connectDefaultAudioPorts(false),
mBufferQueueLength(BufferQueueLength),
mUnderRunMode(UnderRunMode),
mSpawning(false),
mID(0),
......@@ -148,7 +149,7 @@ void JackTripWorker::run()
mNumNetRevChans, FORCEBUFFERQ);
JackTrip * mJackTrip = &jacktrip;
#else // endwhere
JackTrip jacktrip(JackTrip::SERVERPINGSERVER, JackTrip::UDP, mNumChans, 2);
JackTrip jacktrip(JackTrip::SERVERPINGSERVER, JackTrip::UDP, mNumChans, mBufferQueueLength);
#endif // not wair
#ifdef WAIR // WAIR
......
......@@ -47,6 +47,7 @@
#include <QMutex>
#include "JackTrip.h"
#include "jacktrip_globals.h"
//class JackTrip; // forward declaration
class UdpMasterListener; // forward declaration
......@@ -69,7 +70,7 @@ class JackTripWorker : public QObject, public QRunnable
public:
/// \brief The class constructor
JackTripWorker(UdpMasterListener* udpmasterlistener, JackTrip::underrunModeT UnderRunMode = JackTrip::WAVETABLE);
JackTripWorker(UdpMasterListener* udpmasterlistener, int BufferQueueLength = gDefaultQueueLength, JackTrip::underrunModeT UnderRunMode = JackTrip::WAVETABLE);
/// \brief The class destructor
virtual ~JackTripWorker();
......@@ -124,6 +125,7 @@ private:
volatile bool mSpawning;
QMutex mMutex; ///< Mutex to protect mSpawning
JackTrip::underrunModeT mUnderRunMode;
int mBufferQueueLength;
int mID; ///< ID thread number
int mNumChans; ///< Number of Channels
......
......@@ -422,6 +422,7 @@ void Settings::startJackTrip()
cout << "Setting buffers to zero when underrun..." << endl;
cout << gPrintSeparator << std::endl;
udpmaster->setUnderRunMode(JackTrip::ZEROS);
udpmaster->setBufferQueueLength(mBufferQueueLength);
}
udpmaster->start();
......
......@@ -192,7 +192,7 @@ void UdpMasterListener::run()
// --------------------
// Register JackTripWorker with the master listener
delete mJTWorkers->at(id); // just in case the Worker was previously created
mJTWorkers->replace(id, new JackTripWorker(this, mUnderRunMode));
mJTWorkers->replace(id, new JackTripWorker(this, mBufferQueueLength, mUnderRunMode));
// redirect port and spawn listener
cout << "JackTrip HUB SERVER: Spawning JackTripWorker..." << endl;
{
......@@ -204,6 +204,8 @@ void UdpMasterListener::run()
1,
m_connectDefaultAudioPorts
); /// \todo temp default to 1 channel
qDebug() << "mPeerAddress" << id << mActiveAddress[id].address << mActiveAddress[id].port;
}
//send one thread to the pool
cout << "JackTrip HUB SERVER: Starting JackTripWorker..." << endl;
......
......@@ -138,6 +138,7 @@ private:
int mTotalRunningThreads; ///< Number of Threads running in the pool
QMutex mMutex;
JackTrip::underrunModeT mUnderRunMode;
int mBufferQueueLength;
bool m_connectDefaultAudioPorts;
......@@ -155,8 +156,8 @@ public :
void setHubPatch(unsigned int p) {mHubPatch = p;}
unsigned int getHubPatch() {return mHubPatch;}
void setUnderRunMode(JackTrip::underrunModeT UnderRunMode)
{ mUnderRunMode = UnderRunMode; }
void setUnderRunMode(JackTrip::underrunModeT UnderRunMode) { mUnderRunMode = UnderRunMode; }
void setBufferQueueLength(int BufferQueueLength) { mBufferQueueLength = BufferQueueLength; }
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment