Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TPF
jacktrip
Commits
56c95a26
Commit
56c95a26
authored
Jun 19, 2020
by
Chris Chafe
Browse files
Juneteenth, 2020 -- renamed Hub mode properly
parent
8ab98cdb
Changes
17
Hide whitespace changes
Inline
Side-by-side
CHANGESLOG.txt
View file @
56c95a26
---
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)
...
...
JMess.cpp
View file @
56c95a26
...
...
@@ -167,7 +167,7 @@ void JMess::setConnectedPorts()
}
//*******************************************************************************
void
JMess
::
connectSpawnedPorts
(
int
nChans
,
int
hubPatch
)
// called from Udp
Master
Listener::connectMesh
// called from Udp
Hub
Listener::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 Udp
Master
Listener::connectPatch
// called from Udp
Hub
Listener::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
...
...
externals/includes/QTWindows/libjack.dll
View file @
56c95a26
No preview for this file type
externals/includes/QTWindows/libjack.lib
View file @
56c95a26
No preview for this file type
externals/includes/rtaudio-4.0.7/RtAudio.cpp
View file @
56c95a26
...
...
@@ -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
,
kAudioObjectPropertyElement
Master
};
AudioObjectPropertyAddress
propertyAddress
=
{
kAudioHardwarePropertyDevices
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
AudioObjectPropertyAddress
property
=
{
kAudioHardwarePropertyDefaultInputDevice
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
AudioObjectPropertyAddress
property
=
{
kAudioHardwarePropertyDefaultOutputDevice
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
kAudioObjectPropertyElement
Hub
};
OSStatus
result
=
AudioObjectGetPropertyData
(
kAudioObjectSystemObject
,
&
property
,
0
,
NULL
,
&
dataSize
,
(
void
*
)
&
deviceList
);
if
(
result
!=
noErr
)
{
...
...
externals/rtaudio-4.1.1/RtAudio.cpp
View file @
56c95a26
...
...
@@ -472,7 +472,7 @@ RtApiCore:: RtApiCore()
CFRunLoopRef
theRunLoop
=
NULL
;
AudioObjectPropertyAddress
property
=
{
kAudioHardwarePropertyRunLoop
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElement
Master
};
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
AudioObjectPropertyAddress
propertyAddress
=
{
kAudioHardwarePropertyDevices
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
AudioObjectPropertyAddress
property
=
{
kAudioHardwarePropertyDefaultInputDevice
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
AudioObjectPropertyAddress
property
=
{
kAudioHardwarePropertyDefaultOutputDevice
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
kAudioObjectPropertyElement
Hub
};
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
,
kAudioObjectPropertyElement
Master
};
AudioObjectPropertyAddress
tmp
=
{
kAudioDevicePropertyNominalSampleRate
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElement
Hub
};
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
<<
")."
;
...
...
externals/rtaudio-4.1.1/include/soundcard.h
View file @
56c95a26
...
...
@@ -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 */
...
...
meson.build
View file @
56c95a26
...
...
@@ -22,7 +22,7 @@ moc_h = ['src/DataProtocol.h',
'src/PacketHeader.h',
'src/Settings.h',
'src/UdpDataProtocol.h',
'src/Udp
Master
Listener.h']
'src/Udp
Hub
Listener.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/Udp
Master
Listener.cpp',
'src/Udp
Hub
Listener.cpp',
'src/AudioInterface.cpp',
'src/JackAudioInterface.cpp']
...
...
src/JMess.cpp
View file @
56c95a26
...
...
@@ -169,7 +169,7 @@ void JMess::setConnectedPorts()
}
//*******************************************************************************
void
JMess
::
connectSpawnedPorts
(
int
nChans
,
int
hubPatch
)
// called from Udp
Master
Listener::connectMesh
// called from Udp
Hub
Listener::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 Udp
Master
Listener::connectPatch
// called from Udp
Hub
Listener::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
...
...
src/JackTrip.cpp
View file @
56c95a26
...
...
@@ -133,7 +133,7 @@ JackTrip::~JackTrip()
//*******************************************************************************
void
JackTrip
::
setupAudio
(
#ifdef WAIRTO
MASTER
// WAIR
#ifdef WAIRTO
HUB
// WAIR
int
ID
#endif // endwhere
)
...
...
@@ -156,7 +156,7 @@ void JackTrip::setupAudio(
#endif // endwhere
mAudioBitResolution
);
#ifdef WAIRTO
MASTER
// WAIR
#ifdef WAIRTO
HUB
// 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 WAIRTO
MASTER
// WAIR
#ifdef WAIRTO
HUB
// WAIR
int
ID
#endif // endwhere
)
...
...
@@ -348,7 +348,7 @@ void JackTrip::startProcess(
// ------------------------------
if
(
gVerboseFlag
)
std
::
cout
<<
" JackTrip:startProcess before setupAudio"
<<
std
::
endl
;
setupAudio
(
#ifdef WAIRTO
MASTER
// wair
#ifdef WAIRTO
HUB
// wair
ID
#endif // endwhere
);
...
...
src/JackTrip.h
View file @
56c95a26
...
...
@@ -161,7 +161,7 @@ public:
/// \brief Start the processing threads
virtual
void
startProcess
(
#ifdef WAIRTO
MASTER
// wair
#ifdef WAIRTO
HUB
// wair
int
ID
#endif // endwhere
);
...
...
@@ -437,7 +437,7 @@ public:
/// \brief Set the AudioInteface object
virtual
void
setupAudio
(
#ifdef WAIRTO
MASTER
// WAIR
#ifdef WAIRTO
HUB
// WAIR
int
ID
#endif // endwhere
);
...
...
src/JackTripWorker.cpp
View file @
56c95a26
...
...
@@ -44,7 +44,7 @@
#include
"JackTripWorker.h"
#include
"JackTrip.h"
#include
"Udp
Master
Listener.h"
#include
"Udp
Hub
Listener.h"
#include
"NetKS.h"
#include
"LoopBack.h"
#include
"Settings.h"
...
...
@@ -58,8 +58,8 @@
using
std
::
cout
;
using
std
::
endl
;
//*******************************************************************************
JackTripWorker
::
JackTripWorker
(
Udp
Master
Listener
*
udpmasterlistener
,
int
BufferQueueLength
,
JackTrip
::
underrunModeT
UnderRunMode
)
:
mUdp
Master
Listener
(
udpmasterlistener
),
JackTripWorker
::
JackTripWorker
(
Udp
Hub
Listener
*
udpmasterlistener
,
int
BufferQueueLength
,
JackTrip
::
underrunModeT
UnderRunMode
)
:
mUdp
Hub
Listener
(
udpmasterlistener
),
m_connectDefaultAudioPorts
(
false
),
mBufferQueueLength
(
BufferQueueLength
),
mUnderRunMode
(
UnderRunMode
),
...
...
@@ -80,7 +80,7 @@ JackTripWorker::JackTripWorker(UdpMasterListener* udpmasterlistener, int BufferQ
//*******************************************************************************
JackTripWorker
::~
JackTripWorker
()
{
//delete mUdp
Master
Listener;
//delete mUdp
Hub
Listener;
}
...
...
@@ -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
=
mUdp
Master
Listener
->
getSettings
();
Settings
*
settings
=
mUdp
Hub
Listener
->
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
(
mUdp
Master
Listener
->
isWAIR
())
{
// invoked with -Sw
if
(
mUdp
Hub
Listener
->
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
)
{
mUdp
Master
Listener
->
releaseThread
(
mID
);
mUdp
Hub
Listener
->
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 WAIRTO
MASTER
// wair
#ifdef WAIRTO
HUB
// 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
;
mUdp
Master
Listener
->
releaseThread
(
mID
);
mUdp
Hub
Listener
->
releaseThread
(
mID
);
{
QMutexLocker
locker
(
&
mMutex
);
mSpawning
=
false
;
}
return
;
}
{
QMutexLocker
locker
(
&
mMutex
);
mUdp
Master
Listener
->
releaseThread
(
mID
);
mUdp
Hub
Listener
->
releaseThread
(
mID
);
}
cout
<<
"JackTrip ID = "
<<
mID
<<
" released from the THREAD POOL"
<<
endl
;
...
...
src/JackTripWorker.h
View file @
56c95a26
...
...
@@ -50,7 +50,7 @@
#include
"jacktrip_globals.h"
//class JackTrip; // forward declaration
class
Udp
Master
Listener
;
// forward declaration
class
Udp
Hub
Listener
;
// 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
(
Udp
Master
Listener
*
udpmasterlistener
,
int
BufferQueueLength
=
gDefaultQueueLength
,
JackTrip
::
underrunModeT
UnderRunMode
=
JackTrip
::
WAVETABLE
);
JackTripWorker
(
Udp
Hub
Listener
*
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
();
Udp
Master
Listener
*
mUdp
Master
Listener
;
///<
Master
Listener Socket
Udp
Hub
Listener
*
mUdp
Hub
Listener
;
///<
Hub
Listener Socket
//QHostAddress mClientAddress; ///< Client Address
QString
mClientAddress
;
uint16_t
mServerPort
;
///< Server Ephemeral Incomming Port to use with Client
...
...
src/Settings.cpp
View file @
56c95a26
...
...
@@ -44,7 +44,7 @@
#include
"Stk16.dsp.h"
#endif // endwhere
#include
"Udp
Master
Listener.h"
#include
"Udp
Hub
Listener.h"
#include
"JackTripWorker.h"
#include
"jacktrip_globals.h"
...
...
@@ -434,7 +434,7 @@ void Settings::startJackTrip()
/// \todo Change this, just here to test
if
(
mJackTripServer
)
{
Udp
Master
Listener
*
udpmaster
=
new
Udp
Master
Listener
;
Udp
Hub
Listener
*
udpmaster
=
new
Udp
Hub
Listener
;
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 WAIRTO
MASTER
// WAIR
#ifdef WAIRTO
HUB
// WAIR
0
// for WAIR compatibility, ID in jack client name
#endif // endwhere
);
...
...
src/Udp
Master
Listener.cpp
→
src/Udp
Hub
Listener.cpp
View file @
56c95a26
...
...
@@ -30,7 +30,7 @@
//*****************************************************************
/**
* \file Udp
Master
Listener.cpp
* \file Udp
Hub
Listener.cpp
* \author Juan-Pablo Caceres and Chris Chafe
* \date September 2008
*/
...
...
@@ -45,7 +45,7 @@
#include
<QStringList>
#include
<QMutexLocker>
#include
"Udp
Master
Listener.h"
#include
"Udp
Hub
Listener.h"
#include
"JackTripWorker.h"
#include
"jacktrip_globals.h"
...
...
@@ -53,7 +53,7 @@ using std::cout; using std::endl;
//*******************************************************************************
Udp
Master
Listener
::
Udp
Master
Listener
(
int
server_port
)
:
Udp
Hub
Listener
::
Udp
Hub
Listener
(
int
server_port
)
:
//mJTWorker(NULL),
mServerPort
(
server_port
),
mStopped
(
false
),
...
...
@@ -94,7 +94,7 @@ UdpMasterListener::UdpMasterListener(int server_port) :
//*******************************************************************************
Udp
Master
Listener
::~
Udp
Master
Listener
()
Udp
Hub
Listener
::~
Udp
Hub
Listener
()
{
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
Udp
Master
Listener
::
run
()
void
Udp
Hub
Listener
::
run
()
{
mStopped
=
false
;
...
...
@@ -234,12 +234,12 @@ void UdpMasterListener::run()
/*
// Create objects on the stack
QUdpSocket
Master
UdpSocket;
QUdpSocket
Hub
UdpSocket;
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(
Master
UdpSocket, mServerPort);
bindUdpSocket(
Hub
UdpSocket, 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 (
Master
UdpSocket.hasPendingDatagrams() )
while (
Hub
UdpSocket.hasPendingDatagrams() )
{
cout << "Received request from Client!" << endl;
// Get Client IP Address and outgoing port from packet
int rv =
Master
UdpSocket.readDatagram(buf, 1, &PeerAddress, &peer_port);
int rv =
Hub
UdpSocket.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
Udp
Master
Listener
::
readClientUdpPort
(
QTcpSocket
*
clientConnection
)
int
Udp
Hub
Listener
::
readClientUdpPort
(
QTcpSocket
*
clientConnection
)
{
// Read the size of the package
// ----------------------------
...
...
@@ -312,7 +312,7 @@ int UdpMasterListener::readClientUdpPort(QTcpSocket* clientConnection)
//*******************************************************************************
int
Udp
Master
Listener
::
sendUdpPort
(
QTcpSocket
*
clientConnection
,
int
udp_port
)
int
Udp
Hub
Listener
::
sendUdpPort
(
QTcpSocket
*
clientConnection
,
int
udp_port
)
{
// Send Port Number to Client
// --------------------------
...
...
@@ -334,7 +334,7 @@ int UdpMasterListener::sendUdpPort(QTcpSocket* clientConnection, int udp_port)
//*******************************************************************************
/*
void Udp
Master
Listener::sendToPoolPrototype(int id)
void Udp
Hub
Listener::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
Udp
Master
Listener
::
bindUdpSocket
(
QUdpSocket
&
udpsocket
,
int
port
)
void
Udp
Hub
Listener
::
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
Udp
Master
Listener
::
isNewAddress
(
QString
address
,
uint16_t
port
)
int
Udp
Hub
Listener
::
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
Udp
Master
Listener
::
getPoolID
(
QString
address
,
uint16_t
port
)
int
Udp
Hub
Listener
::
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
Udp
Master
Listener
::
releaseThread
(
int
id
)
int
Udp
Hub
Listener
::
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
Udp
Master
Listener
::
connectMesh
(
bool
spawn
)
void
Udp
Hub
Listener
::
connectMesh
(
bool
spawn
)
{
cout
<<
((
spawn
)
?
"spawning"
:
"releasing"
)
<<
" jacktripWorker so change mesh"
<<
endl
;
JMess
tmp
;
...
...
@@ -447,7 +447,7 @@ void UdpMasterListener::connectMesh(bool spawn)
}
//*******************************************************************************
void
Udp
Master
Listener
::
enumerateRunningThreadIDs
()
void
Udp
Hub
Listener
::
enumerateRunningThreadIDs
()
{
for
(
int
id
=
0
;
id
<
gMaxThreads
;
id
++
)
{
...
...
@@ -458,7 +458,7 @@ void UdpMasterListener::enumerateRunningThreadIDs()
#endif // endwhere
#include
"JMess.h"
void
Udp
Master
Listener
::
connectPatch
(
bool
spawn
)
void
Udp
Hub
Listener
::
connectPatch
(
bool
spawn
)
{
cout
<<
((
spawn
)
?
"spawning"
:
"releasing"
)
<<
" jacktripWorker so change patch"
<<
endl
;
JMess
tmp
;
...
...
src/Udp
Master
Listener.h
→
src/Udp
Hub
Listener.h
View file @
56c95a26
...
...
@@ -30,13 +30,13 @@
//*****************************************************************
/**
* \file Udp
Master
Listener.h
* \file Udp
Hub
Listener.h
* \author Juan-Pablo Caceres and Chris Chafe
* \date September 2008
*/
#ifndef __UDP
MASTER
LISTENER_H__
#define __UDP
MASTER
LISTENER_H__
#ifndef __UDP
HUB
LISTENER_H__
#define __UDP
HUB
LISTENER_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
Udp
Master
Listener
:
public
QThread
class
Udp
Hub
Listener
:
public
QThread
{
Q_OBJECT
;
public:
Udp
Master
Listener
(
int
server_port
=
gServerUdpPort
);
virtual
~
Udp
Master
Listener
();
Udp
Hub
Listener
(
int
server_port
=
gServerUdpPort
);
virtual
~
Udp
Hub
Listener
();
/// \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 mUdp
Master
Socket; ///< The UDP socket
//QUdpSocket mUdp
Hub
Socket; ///< The UDP socket
//QHostAddress mPeerAddress; ///< The Peer Address
//JackTripWorker* mJTWorker; ///< Class that will be used as prototype
...
...
@@ -166,4 +166,4 @@ public :
};
#endif //__UDP
MASTER
LISTENER_H__
#endif //__UDP
HUB
LISTENER_H__
src/jacktrip.pro
View file @
56c95a26
...
...
@@ -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
WAIRTO
MASTER
#
rc
.
1.2
switch
enables
experimental
wair
build
,
merge
some
of
it
with
WAIRTO
HUB
#
DEFINES
+=
WAIR
DEFINES
+=
WAIRTO
MASTER
DEFINES
+=
WAIRTO
HUB
#
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
\
Udp
Master
Listener
.
h
\
Udp
Hub
Listener
.
h
\
AudioInterface
.
h
!
nojack
{
...
...
@@ -155,7 +155,7 @@ SOURCES += DataProtocol.cpp \
RingBuffer
.
cpp
\
Settings
.
cpp
\
UdpDataProtocol
.
cpp
\
Udp
Master
Listener
.
cpp
\
Udp
Hub
Listener
.
cpp
\
AudioInterface
.
cpp
!
nojack
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment