jacktrip_globals.h 5.08 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 globals.cpp
jcaceres's avatar
jcaceres committed
34
35
36
37
 * \author Juan-Pablo Caceres
 * \date June 2008
 */

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

41
42
#include "AudioInterface.h"
//#include "JackAudioInterface.h"
jcaceres's avatar
jcaceres committed
43

44
45
/// \todo Add this namespace
//namespace JackTrip
46

Aaron Wyatt's avatar
Aaron Wyatt committed
47
const char* const gVersion = "1.2beta2"; ///< JackTrip version
48

49
//*******************************************************************************
jcaceres's avatar
jcaceres committed
50
51
52
53
/// \name Default Values
//@{
const int gDefaultNumInChannels = 2;
const int gDefaultNumOutChannels = 2;
Chris Chafe's avatar
src/  
Chris Chafe committed
54
55

#define PROTOCOL_STACK QHostAddress::AnyIPv4 // as opposed to Any
56
57
// #define WAIR_AUDIO_NAME "JackTrip" // for jack connection
const QString WAIR_AUDIO_NAME = QString("JackTrip"); // keep legacy for WAIR
Chris Chafe's avatar
src/  
Chris Chafe committed
58
const int gMAX_WAIRS = 10; // jmess revision needed for string parse if > 1 digit
59

60
// hubpatch = 3 for TUB ensemble patching
Chris Chafe's avatar
Chris Chafe committed
61
62
63
64
65
66
67
68
69
70
///////////////////////////////
// test NUC as server
//const QString gDOMAIN_TRIPLE = QString("130.149.23"); // for TUB multiclient hub
//const int gMIN_TUB = 245; // lowest client address
//const int gMAX_TUB = 245; // highest client address
///////////////////////////////
// test Riviera as server
 const QString gDOMAIN_TRIPLE = QString("192.168.0"); // for TUB multiclient hub
 const int gMIN_TUB = 11; // lowest client address
 const int gMAX_TUB = 20; // highest client address
71

Chris Chafe's avatar
src/  
Chris Chafe committed
72
73
74
75
76
77
78
79
80
#ifdef WAIR // wair
// uses hub mode
// hard wire the number of netrev (comb filter) channels
  #define NUMNETREVCHANSbecauseNOTINRECEIVEDheader 16 // for jacktripworker, jmess
  const int gDefaultNumNetRevChannels = NUMNETREVCHANSbecauseNOTINRECEIVEDheader;
  const int gDefaultAddCombFilterLength = 0;
  const int gDefaultCombFilterFeedback = 0;
#endif // endwhere

81
82
83
//const JackAudioInterface::audioBitResolutionT gDefaultBitResolutionMode =
//    JackAudioInterface::BIT16;
const AudioInterface::audioBitResolutionT gDefaultBitResolutionMode =
84
        AudioInterface::BIT16;
jcaceres's avatar
jcaceres committed
85
const int gDefaultQueueLength = 4;
jcaceres's avatar
jcaceres committed
86
const int gDefaultOutputQueueLength = 4;
87
const uint32_t gDefaultSampleRate = 48000;
88
const uint32_t gDefaultDeviceID = 0;
89
const uint32_t gDefaultBufferSizeInSamples = 128;
90
const QString gDefaultLocalAddress = QString();
jcacerec's avatar
jcacerec committed
91
const int gDefaultRedundancy = 1;
jcacerec's avatar
jcacerec committed
92
const int gTimeOutMultiThreadedServer = 5000; // seconds
jcacerec's avatar
jcacerec committed
93
const int gWaitCounter = 60;
jcaceres's avatar
jcaceres committed
94
//@}
jcaceres's avatar
jcaceres committed
95

jcaceres's avatar
jcaceres committed
96

97
//*******************************************************************************
jcaceres's avatar
jcaceres committed
98
99
/// \name Network related ports
//@{
100
101
const int gDefaultPort = 4464; ///< Default JackTrip Port
//const int gInputPort_0 = 4464; ///< Input base port
102
//const int gOutputPort_0 = 4465; ///< Output base port
103
//const int gDefaultSendPort = 4464; ///< Default for to use to send packet
jcaceres's avatar
jcaceres committed
104
105
//@}

jcaceres's avatar
jcaceres committed
106

107
//*******************************************************************************
jcaceres's avatar
jcaceres committed
108
109
/// \name Separator for terminal printing
//@{
jcaceres's avatar
jcaceres committed
110
const char* const gPrintSeparator = "---------------------------------------------------------";
jcaceres's avatar
jcaceres committed
111
112
//@}

jcaceres's avatar
jcaceres committed
113

114
//*******************************************************************************
jcaceres's avatar
jcaceres committed
115
116
/// \name Global flags
//@{
117
extern int gVerboseFlag; ///< Verbose mode flag declaration
jcaceres's avatar
jcaceres committed
118
119
//@}

120

121
//*******************************************************************************
jcaceres's avatar
jcaceres committed
122
123
124
/// \name JackAudio
//@{
const int gJackBitResolution = 32; ///< Audio Bit Resolution of the Jack Server
Aaron Wyatt's avatar
Aaron Wyatt committed
125
const char* const gJackDefaultClientName = "JackTrip";
jcaceres's avatar
jcaceres committed
126
//@}
jcaceres's avatar
jcaceres committed
127

128
129
130

//*******************************************************************************
/// \name Global Functions
131

132
void setRealtimeProcessPriority();
133

134
135
136
137
138
139
140
141
142
143
144
145

//*******************************************************************************
/// \name JackTrip Server parameters
//@{
/// Maximum Threads that can be run at the same time
const int gMaxThreads = 290; // some pthread limit around 297?

/// Public well-known UDP port to where the clients will connect
const int gServerUdpPort = 4464;
//@}


jcaceres's avatar
jcaceres committed
146
#endif