~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to muse/globals.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2005-08-23 17:19:39 UTC
  • mto: (4.1.1 breezy) (1.1.9) (10.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20050823171939-hd8fgzokb4dbj007
Tags: upstream-0.7.1+0.7.2pre2
ImportĀ upstreamĀ versionĀ 0.7.1+0.7.2pre2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=========================================================
 
2
//  MusE
 
3
//  Linux Music Editor
 
4
//  $Id: globals.cpp,v 1.15.2.3 2005/06/13 18:30:48 lunar_shuttle Exp $
 
5
//
 
6
//  (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
 
7
//=========================================================
 
8
 
 
9
#include <qpixmap.h>
 
10
#include <errno.h>
 
11
#include <unistd.h>
 
12
#include <stdlib.h>
 
13
#include "globals.h"
 
14
#include "config.h"
 
15
 
 
16
int recFileNumber = 1;
 
17
 
 
18
int sampleRate   = 44100;
 
19
unsigned segmentSize  = 1024U;    // segmentSize in frames (set by JACK)
 
20
int segmentCount = 2;
 
21
 
 
22
bool overrideAudioOutput = false;
 
23
bool overrideAudioInput = false;
 
24
 
 
25
QTimer* heartBeatTimer;
 
26
 
 
27
bool hIsB = true;             // call note h "b"
 
28
 
 
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 },
 
44
      };
 
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 },
 
53
 
 
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 },
 
61
      };
 
62
 
 
63
QString museGlobalLib;
 
64
QString museGlobalShare;
 
65
QString museUser;
 
66
QString museProject;
 
67
QString museProjectInitPath("./");
 
68
QString configName;
 
69
 
 
70
QString lastWavePath(".");
 
71
QString lastMidiPath(".");
 
72
 
 
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;
 
80
bool loadVST = true;
 
81
 
 
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)",
 
86
      "All Files (*)",
 
87
      0
 
88
      };
 
89
const char* med_file_pattern[] = {
 
90
      "med Files (*.med *.med.gz *.med.bz2)",
 
91
      "All Files (*)",
 
92
      0
 
93
      };
 
94
const char* image_file_pattern[] = {
 
95
      "(*.jpg *.gif *.png)",
 
96
      "(*.jpg)",
 
97
      "(*.gif)",
 
98
      "(*.png)",
 
99
      "All Files (*)",
 
100
      0
 
101
      };
 
102
 
 
103
const char* ctrl_file_pattern[] = {
 
104
      "ctrl Files (*.ctrl *.ctrl.gz *.ctrl.bz2)",
 
105
      "All Files (*)",
 
106
      0
 
107
      };
 
108
 
 
109
const char* part_file_pattern[] = {
 
110
      "part Files (*.mpt)",
 
111
      "All Files (*)",
 
112
      0
 
113
      };
 
114
 
 
115
Qt::ButtonState globalKeyState;
 
116
 
 
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;
 
126
 
 
127
QActionGroup* undoRedo;
 
128
QAction* undoAction;
 
129
QAction* redoAction;
 
130
QActionGroup* transportAction;
 
131
QAction* playAction;
 
132
QAction* startAction;
 
133
QAction* stopAction;
 
134
QAction* rewindAction;
 
135
QAction* forwardAction;
 
136
QAction* loopAction;
 
137
QAction* punchinAction;
 
138
QAction* punchoutAction;
 
139
QAction* recordAction;
 
140
QAction* panicAction;
 
141
 
 
142
AudioMixerApp* audioMixer;
 
143
MusE* muse;
 
144
 
 
145
int preMeasures = 2;
 
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;
 
161
 
 
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;
 
168
 
 
169
uid_t euid, ruid;  // effective user id, real user id
 
170
 
 
171
bool midiSeqRunning = false;
 
172
 
 
173
//---------------------------------------------------------
 
174
//   doSetuid
 
175
//    Restore the effective UID to its original value.
 
176
//---------------------------------------------------------
 
177
 
 
178
void doSetuid()
 
179
      {
 
180
#ifndef RTCAP
 
181
      int status;
 
182
#ifdef _POSIX_SAVED_IDS
 
183
      status = seteuid (euid);
 
184
#else
 
185
      status = setreuid (ruid, euid);
 
186
#endif
 
187
      if (status < 0) {
 
188
            perror("doSetuid: Couldn't set uid");
 
189
            }
 
190
#endif
 
191
      }
 
192
 
 
193
//---------------------------------------------------------
 
194
//   undoSetuid
 
195
//    Set the effective UID to the real UID.
 
196
//---------------------------------------------------------
 
197
 
 
198
void undoSetuid()
 
199
      {
 
200
#ifndef RTCAP
 
201
      int status;
 
202
 
 
203
#ifdef _POSIX_SAVED_IDS
 
204
      status = seteuid (ruid);
 
205
#else
 
206
      status = setreuid (euid, ruid);
 
207
#endif
 
208
      if (status < 0) {
 
209
            fprintf(stderr, "undoSetuid: Couldn't set uid (eff:%d,real:%d): %s\n",
 
210
               euid, ruid, strerror(errno));
 
211
            exit (status);
 
212
            }
 
213
#endif
 
214
      }
 
215