1
//=========================================================
4
// $Id: globals.cpp,v 1.15.2.3 2005/06/13 18:30:48 lunar_shuttle Exp $
6
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
7
//=========================================================
16
int recFileNumber = 1;
18
int sampleRate = 44100;
19
unsigned segmentSize = 1024U; // segmentSize in frames (set by JACK)
22
bool overrideAudioOutput = false;
23
bool overrideAudioInput = false;
25
QTimer* heartBeatTimer;
27
bool hIsB = true; // call note h "b"
29
const signed char sharpTab[14][7] = {
30
{ 0, 3, -1, 2, 5, 1, 4 },
31
{ 0, 3, -1, 2, 5, 1, 4 },
32
{ 0, 3, -1, 2, 5, 1, 4 },
33
{ 0, 3, -1, 2, 5, 1, 4 },
34
{ 2, 5, 1, 4, 7, 3, 6 },
35
{ 2, 5, 1, 4, 7, 3, 6 },
36
{ 2, 5, 1, 4, 7, 3, 6 },
37
{ 4, 0, 3, -1, 2, 5, 1 },
38
{ 7, 3, 6, 2, 5, 1, 4 },
39
{ 5, 8, 4, 7, 3, 6, 2 },
40
{ 3, 6, 2, 5, 1, 4, 7 },
41
{ 1, 4, 0, 3, 6, 2, 5 },
42
{ 6, 2, 5, 1, 4, 0, 3 },
43
{ 0, 3, -1, 2, 5, 1, 4 },
45
const signed char flatTab[14][7] = {
46
{ 4, 1, 5, 2, 6, 3, 7 },
47
{ 4, 1, 5, 2, 6, 3, 7 },
48
{ 4, 1, 5, 2, 6, 3, 7 },
49
{ 4, 1, 5, 2, 6, 3, 7 },
50
{ 6, 3, 7, 4, 8, 5, 9 },
51
{ 6, 3, 7, 4, 8, 5, 9 },
52
{ 6, 3, 7, 4, 8, 5, 9 },
54
{ 1, 5, 2, 6, 3, 7, 4 },
55
{ 4, 1, 5, 2, 6, 3, 7 },
56
{ 2, 6, 3, 7, 4, 8, 5 },
57
{ 7, 4, 1, 5, 2, 6, 3 },
58
{ 5, 2, 6, 3, 7, 4, 8 },
59
{ 3, 0, 4, 1, 5, 2, 6 },
60
{ 4, 1, 5, 2, 6, 3, 7 },
63
QString museGlobalLib;
64
QString museGlobalShare;
67
QString museProjectInitPath("./");
70
QString lastWavePath(".");
71
QString lastMidiPath(".");
73
bool debugMode = false;
74
bool debugMsg = false;
75
bool midiInputTrace = false;
76
bool midiOutputTrace = false;
77
bool realTimeScheduling = false;
78
int realTimePriority = 80;
79
bool loadPlugins = true;
82
const char* midi_file_pattern[] = {
83
"Midi/Kar (*.mid *.kar *.mid.gz *.mid.bz2)",
84
"Midi (*.mid *.mid.gz *.mid.bz2)",
85
"Karaoke (*.kar *.kar.gz *.kar.bz2)",
89
const char* med_file_pattern[] = {
90
"med Files (*.med *.med.gz *.med.bz2)",
94
const char* image_file_pattern[] = {
95
"(*.jpg *.gif *.png)",
103
const char* ctrl_file_pattern[] = {
104
"ctrl Files (*.ctrl *.ctrl.gz *.ctrl.bz2)",
109
const char* part_file_pattern[] = {
110
"part Files (*.mpt)",
115
Qt::ButtonState globalKeyState;
117
// Midi Filter Parameter
118
int midiInputPorts = 0; // receive from all devices
119
int midiInputChannel = 0; // receive all channel
120
int midiRecordType = 0; // receive all events
121
int midiThruType = 0; // transmit all events
122
int midiFilterCtrl1 = 0;
123
int midiFilterCtrl2 = 0;
124
int midiFilterCtrl3 = 0;
125
int midiFilterCtrl4 = 0;
127
QActionGroup* undoRedo;
130
QActionGroup* transportAction;
132
QAction* startAction;
134
QAction* rewindAction;
135
QAction* forwardAction;
137
QAction* punchinAction;
138
QAction* punchoutAction;
139
QAction* recordAction;
140
QAction* panicAction;
142
AudioMixerApp* audioMixer;
146
unsigned char measureClickNote = 63;
147
unsigned char measureClickVelo = 127;
148
unsigned char beatClickNote = 63;
149
unsigned char beatClickVelo = 70;
150
unsigned char clickChan = 9;
151
unsigned char clickPort = 0;
152
bool precountEnableFlag = false;
153
bool precountFromMastertrackFlag = false;
154
int precountSigZ = 4;
155
int precountSigN = 4;
156
bool precountPrerecord = false;
157
bool precountPreroll = false;
158
bool midiClickFlag = true;
159
bool audioClickFlag = true;
160
float audioClickVolume = 0.1f;
162
bool rcEnable = false;
163
unsigned char rcStopNote = 28;
164
unsigned char rcRecordNote = 31;
165
unsigned char rcGotoLeftMarkNote = 33;
166
unsigned char rcPlayNote = 29;
167
bool automation = true;
169
uid_t euid, ruid; // effective user id, real user id
171
bool midiSeqRunning = false;
173
//---------------------------------------------------------
175
// Restore the effective UID to its original value.
176
//---------------------------------------------------------
182
#ifdef _POSIX_SAVED_IDS
183
status = seteuid (euid);
185
status = setreuid (ruid, euid);
188
perror("doSetuid: Couldn't set uid");
193
//---------------------------------------------------------
195
// Set the effective UID to the real UID.
196
//---------------------------------------------------------
203
#ifdef _POSIX_SAVED_IDS
204
status = seteuid (ruid);
206
status = setreuid (euid, ruid);
209
fprintf(stderr, "undoSetuid: Couldn't set uid (eff:%d,real:%d): %s\n",
210
euid, ruid, strerror(errno));