Commit 56c95a26 authored by Chris Chafe's avatar Chris Chafe
Browse files

Juneteenth, 2020 -- renamed Hub mode properly

parent 8ab98cdb
---
master
master (this branch name will be deprecated when github follows through on interest in eliminating such terminology)
- (fixed) refactor "Master" to be "Hub"
- (fixed) 1.2 correctly tagged
---
1.2 (release candidate, not yet tagged)
......
......@@ -167,7 +167,7 @@ void JMess::setConnectedPorts()
}
//*******************************************************************************
void JMess::connectSpawnedPorts(int nChans, int hubPatch)
// called from UdpMasterListener::connectMesh
// called from UdpHubListener::connectMesh
{
QString IPS[gMAX_WAIRS];
int ctr = 0;
......@@ -307,7 +307,7 @@ void JMess::connectSpawnedPorts(int nChans, int hubPatch)
// this is brute force, does not look at individual clients, just patches the whole ensemble
// each time
void JMess::connectTUB(int /*nChans*/)
// called from UdpMasterListener::connectPatch
// called from UdpHubListener::connectPatch
{
for (int i = 0; i<=gMAX_TUB-gMIN_TUB; i++) // last IP decimal octet
for (int l = 1; l<=1; l++) // mono for now // chans are 1-based, 1...2
......
......@@ -435,7 +435,7 @@ unsigned int RtApiCore :: getDeviceCount( void )
{
// Find out how many audio devices there are, if any.
UInt32 dataSize;
AudioObjectPropertyAddress propertyAddress = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
AudioObjectPropertyAddress propertyAddress = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyDataSize( kAudioObjectSystemObject, &propertyAddress, 0, NULL, &dataSize );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDeviceCount: OS-X error getting device info!";
......@@ -453,7 +453,7 @@ unsigned int RtApiCore :: getDefaultInputDevice( void )
AudioDeviceID id;
UInt32 dataSize = sizeof( AudioDeviceID );
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDefaultInputDevice: OS-X system error getting device.";
......@@ -486,7 +486,7 @@ unsigned int RtApiCore :: getDefaultOutputDevice( void )
AudioDeviceID id;
UInt32 dataSize = sizeof( AudioDeviceID );
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDefaultOutputDevice: OS-X system error getting device.";
......@@ -533,7 +533,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
UInt32 dataSize = sizeof( AudioDeviceID ) * nDevices;
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDevices,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster };
kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property,
0, NULL, &dataSize, (void *) &deviceList );
if ( result != noErr ) {
......@@ -765,7 +765,7 @@ bool RtApiCore :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
UInt32 dataSize = sizeof( AudioDeviceID ) * nDevices;
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDevices,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster };
kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property,
0, NULL, &dataSize, (void *) &deviceList );
if ( result != noErr ) {
......
......@@ -472,7 +472,7 @@ RtApiCore:: RtApiCore()
CFRunLoopRef theRunLoop = NULL;
AudioObjectPropertyAddress property = { kAudioHardwarePropertyRunLoop,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster };
kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectSetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, sizeof(CFRunLoopRef), &theRunLoop);
if ( result != noErr ) {
errorText_ = "RtApiCore::RtApiCore: error setting run loop property!";
......@@ -493,7 +493,7 @@ unsigned int RtApiCore :: getDeviceCount( void )
{
// Find out how many audio devices there are, if any.
UInt32 dataSize;
AudioObjectPropertyAddress propertyAddress = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
AudioObjectPropertyAddress propertyAddress = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyDataSize( kAudioObjectSystemObject, &propertyAddress, 0, NULL, &dataSize );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDeviceCount: OS-X error getting device info!";
......@@ -511,7 +511,7 @@ unsigned int RtApiCore :: getDefaultInputDevice( void )
AudioDeviceID id;
UInt32 dataSize = sizeof( AudioDeviceID );
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDefaultInputDevice: OS-X system error getting device.";
......@@ -544,7 +544,7 @@ unsigned int RtApiCore :: getDefaultOutputDevice( void )
AudioDeviceID id;
UInt32 dataSize = sizeof( AudioDeviceID );
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDefaultOutputDevice: OS-X system error getting device.";
......@@ -593,7 +593,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
UInt32 dataSize = sizeof( AudioDeviceID ) * nDevices;
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDevices,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster };
kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property,
0, NULL, &dataSize, (void *) &deviceList );
if ( result != noErr ) {
......@@ -846,7 +846,7 @@ static OSStatus rateListener( AudioObjectID inDevice,
UInt32 dataSize = sizeof( Float64 );
AudioObjectPropertyAddress property = { kAudioDevicePropertyNominalSampleRate,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster };
kAudioObjectPropertyElementHub };
AudioObjectGetPropertyData( inDevice, &property, 0, NULL, &dataSize, rate );
return kAudioHardwareNoError;
}
......@@ -874,7 +874,7 @@ bool RtApiCore :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
UInt32 dataSize = sizeof( AudioDeviceID ) * nDevices;
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDevices,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster };
kAudioObjectPropertyElementHub };
OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property,
0, NULL, &dataSize, (void *) &deviceList );
if ( result != noErr ) {
......@@ -1065,7 +1065,7 @@ bool RtApiCore :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
// Set a property listener for the sample rate change
Float64 reportedRate = 0.0;
AudioObjectPropertyAddress tmp = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
AudioObjectPropertyAddress tmp = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementHub };
result = AudioObjectAddPropertyListener( id, &tmp, rateListener, (void *) &reportedRate );
if ( result != noErr ) {
errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") setting sample rate property listener for device (" << device << ").";
......
......@@ -909,7 +909,7 @@ typedef struct copr_msg {
*/
#define SOUND_MIXER_NRDEVICES 25
#define SOUND_MIXER_VOLUME 0 /* Master output level */
#define SOUND_MIXER_VOLUME 0 /* Hub output level */
#define SOUND_MIXER_BASS 1 /* Treble level of all output channels */
#define SOUND_MIXER_TREBLE 2 /* Bass level of all output channels */
#define SOUND_MIXER_SYNTH 3 /* Volume of synthesier input */
......
......@@ -22,7 +22,7 @@ moc_h = ['src/DataProtocol.h',
'src/PacketHeader.h',
'src/Settings.h',
'src/UdpDataProtocol.h',
'src/UdpMasterListener.h']
'src/UdpHubListener.h']
moc_files = qt5.preprocess(moc_headers : moc_h)
src = ['src/DataProtocol.cpp',
......@@ -38,7 +38,7 @@ src = ['src/DataProtocol.cpp',
'src/RingBuffer.cpp',
'src/Settings.cpp',
'src/UdpDataProtocol.cpp',
'src/UdpMasterListener.cpp',
'src/UdpHubListener.cpp',
'src/AudioInterface.cpp',
'src/JackAudioInterface.cpp']
......
......@@ -169,7 +169,7 @@ void JMess::setConnectedPorts()
}
//*******************************************************************************
void JMess::connectSpawnedPorts(int nChans, int hubPatch)
// called from UdpMasterListener::connectMesh
// called from UdpHubListener::connectMesh
{
QMutexLocker locker(&sJMessMutex);
......@@ -312,7 +312,7 @@ void JMess::connectSpawnedPorts(int nChans, int hubPatch)
// this is brute force, does not look at individual clients, just patches the whole ensemble
// each time
void JMess::connectTUB(int /*nChans*/)
// called from UdpMasterListener::connectPatch
// called from UdpHubListener::connectPatch
{
for (int i = 0; i<=gMAX_TUB-gMIN_TUB; i++) // last IP decimal octet
for (int l = 1; l<=1; l++) // mono for now // chans are 1-based, 1...2
......
......@@ -133,7 +133,7 @@ JackTrip::~JackTrip()
//*******************************************************************************
void JackTrip::setupAudio(
#ifdef WAIRTOMASTER // WAIR
#ifdef WAIRTOHUB // WAIR
int ID
#endif // endwhere
)
......@@ -156,7 +156,7 @@ void JackTrip::setupAudio(
#endif // endwhere
mAudioBitResolution);
#ifdef WAIRTOMASTER // WAIR
#ifdef WAIRTOHUB // WAIR
qDebug() << "mPeerAddress" << mPeerAddress << mPeerAddress.contains(gDOMAIN_TRIPLE);
QString VARIABLE_AUDIO_NAME = WAIR_AUDIO_NAME; // legacy for WAIR
QByteArray tmp = QString(mPeerAddress).replace(":", ".").toLatin1();
......@@ -319,7 +319,7 @@ void JackTrip::appendProcessPlugin(ProcessPlugin* plugin)
//*******************************************************************************
void JackTrip::startProcess(
#ifdef WAIRTOMASTER // WAIR
#ifdef WAIRTOHUB // WAIR
int ID
#endif // endwhere
)
......@@ -348,7 +348,7 @@ void JackTrip::startProcess(
// ------------------------------
if (gVerboseFlag) std::cout << " JackTrip:startProcess before setupAudio" << std::endl;
setupAudio(
#ifdef WAIRTOMASTER // wair
#ifdef WAIRTOHUB // wair
ID
#endif // endwhere
);
......
......@@ -161,7 +161,7 @@ public:
/// \brief Start the processing threads
virtual void startProcess(
#ifdef WAIRTOMASTER // wair
#ifdef WAIRTOHUB // wair
int ID
#endif // endwhere
);
......@@ -437,7 +437,7 @@ public:
/// \brief Set the AudioInteface object
virtual void setupAudio(
#ifdef WAIRTOMASTER // WAIR
#ifdef WAIRTOHUB // WAIR
int ID
#endif // endwhere
);
......
......@@ -44,7 +44,7 @@
#include "JackTripWorker.h"
#include "JackTrip.h"
#include "UdpMasterListener.h"
#include "UdpHubListener.h"
#include "NetKS.h"
#include "LoopBack.h"
#include "Settings.h"
......@@ -58,8 +58,8 @@
using std::cout; using std::endl;
//*******************************************************************************
JackTripWorker::JackTripWorker(UdpMasterListener* udpmasterlistener, int BufferQueueLength, JackTrip::underrunModeT UnderRunMode) :
mUdpMasterListener(udpmasterlistener),
JackTripWorker::JackTripWorker(UdpHubListener* udpmasterlistener, int BufferQueueLength, JackTrip::underrunModeT UnderRunMode) :
mUdpHubListener(udpmasterlistener),
m_connectDefaultAudioPorts(false),
mBufferQueueLength(BufferQueueLength),
mUnderRunMode(UnderRunMode),
......@@ -80,7 +80,7 @@ JackTripWorker::JackTripWorker(UdpMasterListener* udpmasterlistener, int BufferQ
//*******************************************************************************
JackTripWorker::~JackTripWorker()
{
//delete mUdpMasterListener;
//delete mUdpHubListener;
}
......@@ -128,14 +128,14 @@ void JackTripWorker::run()
// Create and setup JackTrip Object
//JackTrip jacktrip(JackTrip::SERVER, JackTrip::UDP, mNumChans, 2);
if (gVerboseFlag) cout << "---> JackTripWorker: Creating jacktrip objects..." << endl;
Settings* settings = mUdpMasterListener->getSettings();
Settings* settings = mUdpHubListener->getSettings();
#ifdef WAIR // WAIR
// forces BufferQueueLength to 2
// need to parse numNetChans from incoming header
// but force to 16 for now
#define FORCEBUFFERQ 2
if (mUdpMasterListener->isWAIR()) { // invoked with -Sw
if (mUdpHubListener->isWAIR()) { // invoked with -Sw
mWAIR = true;
mNumNetRevChans = NUMNETREVCHANSbecauseNOTINRECEIVEDheader;
} else {};
......@@ -210,7 +210,7 @@ void JackTripWorker::run()
if (gVerboseFlag) cout << "---> JackTripWorker: setJackTripFromClientHeader..." << endl;
int PeerConnectionMode = setJackTripFromClientHeader(jacktrip);
if ( PeerConnectionMode == -1 ) {
mUdpMasterListener->releaseThread(mID);
mUdpHubListener->releaseThread(mID);
{ QMutexLocker locker(&mMutex); mSpawning = false; }
return;
}
......@@ -218,7 +218,7 @@ void JackTripWorker::run()
// Start Threads and event loop
if (gVerboseFlag) cout << "---> JackTripWorker: startProcess..." << endl;
jacktrip.startProcess(
#ifdef WAIRTOMASTER // wair
#ifdef WAIRTOHUB // wair
mID
#endif // endwhere
);
......@@ -245,14 +245,14 @@ void JackTripWorker::run()
std::cerr << "Couldn't send thread to the Pool" << endl;
std::cerr << e.what() << endl;
std::cerr << gPrintSeparator << endl;
mUdpMasterListener->releaseThread(mID);
mUdpHubListener->releaseThread(mID);
{ QMutexLocker locker(&mMutex); mSpawning = false; }
return;
}
{
QMutexLocker locker(&mMutex);
mUdpMasterListener->releaseThread(mID);
mUdpHubListener->releaseThread(mID);
}
cout << "JackTrip ID = " << mID << " released from the THREAD POOL" << endl;
......
......@@ -50,7 +50,7 @@
#include "jacktrip_globals.h"
//class JackTrip; // forward declaration
class UdpMasterListener; // forward declaration
class UdpHubListener; // forward declaration
/** \brief Prototype of the worker class that will be cloned through sending threads to the
......@@ -70,7 +70,7 @@ class JackTripWorker : public QObject, public QRunnable
public:
/// \brief The class constructor
JackTripWorker(UdpMasterListener* udpmasterlistener, int BufferQueueLength = gDefaultQueueLength, JackTrip::underrunModeT UnderRunMode = JackTrip::WAVETABLE);
JackTripWorker(UdpHubListener* udpmasterlistener, int BufferQueueLength = gDefaultQueueLength, JackTrip::underrunModeT UnderRunMode = JackTrip::WAVETABLE);
/// \brief The class destructor
virtual ~JackTripWorker();
......@@ -111,7 +111,7 @@ private:
int setJackTripFromClientHeader(JackTrip& jacktrip);
JackTrip::connectionModeT getConnectionModeFromHeader();
UdpMasterListener* mUdpMasterListener; ///< Master Listener Socket
UdpHubListener* mUdpHubListener; ///< Hub Listener Socket
//QHostAddress mClientAddress; ///< Client Address
QString mClientAddress;
uint16_t mServerPort; ///< Server Ephemeral Incomming Port to use with Client
......
......@@ -44,7 +44,7 @@
#include "Stk16.dsp.h"
#endif // endwhere
#include "UdpMasterListener.h"
#include "UdpHubListener.h"
#include "JackTripWorker.h"
#include "jacktrip_globals.h"
......@@ -434,7 +434,7 @@ void Settings::startJackTrip()
/// \todo Change this, just here to test
if ( mJackTripServer ) {
UdpMasterListener* udpmaster = new UdpMasterListener;
UdpHubListener* udpmaster = new UdpHubListener;
udpmaster->setSettings(this);
#ifdef WAIR // WAIR
udpmaster->setWAIR(mWAIR);
......@@ -596,7 +596,7 @@ void Settings::startJackTrip()
// Start JackTrip
if (gVerboseFlag) std::cout << "Settings:startJackTrip before mJackTrip->startProcess" << std::endl;
mJackTrip->startProcess(
#ifdef WAIRTOMASTER // WAIR
#ifdef WAIRTOHUB // WAIR
0 // for WAIR compatibility, ID in jack client name
#endif // endwhere
);
......
......@@ -30,7 +30,7 @@
//*****************************************************************
/**
* \file UdpMasterListener.cpp
* \file UdpHubListener.cpp
* \author Juan-Pablo Caceres and Chris Chafe
* \date September 2008
*/
......@@ -45,7 +45,7 @@
#include <QStringList>
#include <QMutexLocker>
#include "UdpMasterListener.h"
#include "UdpHubListener.h"
#include "JackTripWorker.h"
#include "jacktrip_globals.h"
......@@ -53,7 +53,7 @@ using std::cout; using std::endl;
//*******************************************************************************
UdpMasterListener::UdpMasterListener(int server_port) :
UdpHubListener::UdpHubListener(int server_port) :
//mJTWorker(NULL),
mServerPort(server_port),
mStopped(false),
......@@ -94,7 +94,7 @@ UdpMasterListener::UdpMasterListener(int server_port) :
//*******************************************************************************
UdpMasterListener::~UdpMasterListener()
UdpHubListener::~UdpHubListener()
{
QMutexLocker lock(&mMutex);
mThreadPool.waitForDone();
......@@ -111,7 +111,7 @@ UdpMasterListener::~UdpMasterListener()
// the client is already on the thread pool, it means that a new connection is
// requested (the old was desconnected). So we have to remove that thread from
// the pool and then connect again.
void UdpMasterListener::run()
void UdpHubListener::run()
{
mStopped = false;
......@@ -234,12 +234,12 @@ void UdpMasterListener::run()
/*
// Create objects on the stack
QUdpSocket MasterUdpSocket;
QUdpSocket HubUdpSocket;
QHostAddress PeerAddress;
uint16_t peer_port; // Ougoing Peer port, in case they're not using the default
// Bind the socket to the well known port
bindUdpSocket(MasterUdpSocket, mServerPort);
bindUdpSocket(HubUdpSocket, mServerPort);
char buf[1];
cout << "Server Listening in UDP Port: " << mServerPort << endl;
......@@ -248,11 +248,11 @@ void UdpMasterListener::run()
while ( !mStopped )
{
//cout << "WAITING........................." << endl;
while ( MasterUdpSocket.hasPendingDatagrams() )
while ( HubUdpSocket.hasPendingDatagrams() )
{
cout << "Received request from Client!" << endl;
// Get Client IP Address and outgoing port from packet
int rv = MasterUdpSocket.readDatagram(buf, 1, &PeerAddress, &peer_port);
int rv = HubUdpSocket.readDatagram(buf, 1, &PeerAddress, &peer_port);
cout << "Peer Port in Server ==== " << peer_port << endl;
if (rv < 0) { std::cerr << "ERROR: Bad UDP packet read..." << endl; }
......@@ -286,7 +286,7 @@ void UdpMasterListener::run()
//*******************************************************************************
// Returns 0 on error
int UdpMasterListener::readClientUdpPort(QTcpSocket* clientConnection)
int UdpHubListener::readClientUdpPort(QTcpSocket* clientConnection)
{
// Read the size of the package
// ----------------------------
......@@ -312,7 +312,7 @@ int UdpMasterListener::readClientUdpPort(QTcpSocket* clientConnection)
//*******************************************************************************
int UdpMasterListener::sendUdpPort(QTcpSocket* clientConnection, int udp_port)
int UdpHubListener::sendUdpPort(QTcpSocket* clientConnection, int udp_port)
{
// Send Port Number to Client
// --------------------------
......@@ -334,7 +334,7 @@ int UdpMasterListener::sendUdpPort(QTcpSocket* clientConnection, int udp_port)
//*******************************************************************************
/*
void UdpMasterListener::sendToPoolPrototype(int id)
void UdpHubListener::sendToPoolPrototype(int id)
{
mJTWorker->setJackTrip(id, mActiveAddress[id][0],
mBasePort+(2*id), mActiveAddress[id][1],
......@@ -345,7 +345,7 @@ void UdpMasterListener::sendToPoolPrototype(int id)
//*******************************************************************************
void UdpMasterListener::bindUdpSocket(QUdpSocket& udpsocket, int port)
void UdpHubListener::bindUdpSocket(QUdpSocket& udpsocket, int port)
{
// QHostAddress::Any : let the kernel decide the active address
if ( !udpsocket.bind(QHostAddress::Any,
......@@ -362,7 +362,7 @@ void UdpMasterListener::bindUdpSocket(QUdpSocket& udpsocket, int port)
//*******************************************************************************
// check by comparing 32-bit addresses
int UdpMasterListener::isNewAddress(QString address, uint16_t port)
int UdpHubListener::isNewAddress(QString address, uint16_t port)
{
QMutexLocker lock(&mMutex);
bool busyAddress = false;
......@@ -407,7 +407,7 @@ int UdpMasterListener::isNewAddress(QString address, uint16_t port)
//*******************************************************************************
int UdpMasterListener::getPoolID(QString address, uint16_t port)
int UdpHubListener::getPoolID(QString address, uint16_t port)
{
QMutexLocker lock(&mMutex);
//for (int id = 0; id<mThreadPool.activeThreadCount(); id++ )
......@@ -421,7 +421,7 @@ int UdpMasterListener::getPoolID(QString address, uint16_t port)
//*******************************************************************************
int UdpMasterListener::releaseThread(int id)
int UdpHubListener::releaseThread(int id)
{
QMutexLocker lock(&mMutex);
mActiveAddress[id].address = "";
......@@ -437,7 +437,7 @@ int UdpMasterListener::releaseThread(int id)
#ifdef WAIR // wair
#include "JMess.h"
//*******************************************************************************
void UdpMasterListener::connectMesh(bool spawn)
void UdpHubListener::connectMesh(bool spawn)
{
cout << ((spawn)?"spawning":"releasing") << " jacktripWorker so change mesh" << endl;
JMess tmp;
......@@ -447,7 +447,7 @@ void UdpMasterListener::connectMesh(bool spawn)
}
//*******************************************************************************
void UdpMasterListener::enumerateRunningThreadIDs()
void UdpHubListener::enumerateRunningThreadIDs()
{
for (int id = 0; id<gMaxThreads; id++ )
{
......@@ -458,7 +458,7 @@ void UdpMasterListener::enumerateRunningThreadIDs()
#endif // endwhere
#include "JMess.h"
void UdpMasterListener::connectPatch(bool spawn)
void UdpHubListener::connectPatch(bool spawn)
{
cout << ((spawn)?"spawning":"releasing") << " jacktripWorker so change patch" << endl;
JMess tmp;
......
......@@ -30,13 +30,13 @@
//*****************************************************************
/**
* \file UdpMasterListener.h
* \file UdpHubListener.h
* \author Juan-Pablo Caceres and Chris Chafe
* \date September 2008
*/
#ifndef __UDPMASTERLISTENER_H__
#define __UDPMASTERLISTENER_H__
#ifndef __UDPHUBLISTENER_H__
#define __UDPHUBLISTENER_H__
#include <iostream>
#include <stdexcept>
......@@ -60,18 +60,18 @@ typedef struct {
int16_t port;
} addressPortPair;
/** \brief Master UDP listener on the Server.
/** \brief Hub UDP listener on the Server.
*
* This creates a server that will listen on the well know port (the server port) and will
* spawn JackTrip threads into the Thread pool. Clients request a connection.
*/
class UdpMasterListener : public QThread
class UdpHubListener : public QThread
{
Q_OBJECT;
public:
UdpMasterListener(int server_port = gServerUdpPort);
virtual ~UdpMasterListener();
UdpHubListener(int server_port = gServerUdpPort);
virtual ~UdpHubListener();
/// \brief Implements the Thread Loop. To start the thread, call start()
/// ( DO NOT CALL run() )
......@@ -125,7 +125,7 @@ private:
*/
int getPoolID(QString address, uint16_t port);
//QUdpSocket mUdpMasterSocket; ///< The UDP socket
//QUdpSocket mUdpHubSocket; ///< The UDP socket
//QHostAddress mPeerAddress; ///< The Peer Address
//JackTripWorker* mJTWorker; ///< Class that will be used as prototype
......@@ -166,4 +166,4 @@ public :
};
#endif //__UDPMASTERLISTENER_H__
#endif //__UDPHUBLISTENER_H__
......@@ -15,9 +15,9 @@ CONFIG(debug, debug|release) {
QT -= gui
QT += network
# rc.1.2 switch enables experimental wair build, merge some of it with WAIRTOMASTER
# rc.1.2 switch enables experimental wair build, merge some of it with WAIRTOHUB
# DEFINES += WAIR
DEFINES += WAIRTOMASTER
DEFINES += WAIRTOHUB
# http://wiki.qtcentre.org/index.php?title=Undocumented_qmake#Custom_tools
#cc DEFINES += __RT_AUDIO__
......@@ -135,7 +135,7 @@ HEADERS += DataProtocol.h \
TestRingBuffer.h \
ThreadPoolTest.h \
UdpDataProtocol.h \
UdpMasterListener.h \
UdpHubListener.h \
AudioInterface.h
!nojack {
......@@ -155,7 +155,7 @@ SOURCES += DataProtocol.cpp \
RingBuffer.cpp \
Settings.cpp \
UdpDataProtocol.cpp \
UdpMasterListener.cpp \
UdpHubListener.cpp \
AudioInterface.cpp
!nojack {
......
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