-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkmidi.h
298 lines (251 loc) · 6.21 KB
/
kmidi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
/*
kmidi - a midi to wav converter
Copyright 1997 Bernd Johannes Wuebben math.cornell.edu
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef KMIDI_PLAYER_H
#define KMIDI_PLAYER_H
#include "version.h"
#include "bwlednum.h"
#include <qfileinfo.h>
#include <qdatastream.h>
#include <qfile.h>
#include <qtabdialog.h>
#include <qfiledialog.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qlabel.h>
#include <qlistbox.h>
#include <qtimer.h>
#include <qbitmap.h>
#include <qslider.h>
#include <qcombobox.h>
#include <qscrollbar.h>
#include <qspinbox.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qtooltip.h>
#include <qregexp.h>
#include <qgroupbox.h>
#include <qwidget.h>
#include <qpainter.h>
#include <qdragobject.h>
#include <qwhatsthis.h>
#include <pwd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <sys/utsname.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <kapplication.h>
#include <kled.h>
#include <kmenubar.h>
#include <krandomsequence.h>
#define PLAYLIST_WIDTH 550
#define PLAYLIST_HEIGHT 440
#include "configdlg.h"
#include "log.h"
class PlaylistEdit;
class ConfigDlg;
//
// MeterWidget - draws meter
//
class MeterWidget : public QWidget {
Q_OBJECT
public:
MeterWidget( QWidget *parent=0, const char *name=0 );
~MeterWidget();
QTimer *metertimer;
QColor led_color;
QColor background_color;
public slots:
void remeter();
protected:
void paintEvent( QPaintEvent * );
private:
};
class KMidi : public QWidget {
Q_OBJECT
public:
~KMidi();
QPushButton *playPB;
QPushButton *stopPB;
QPushButton *prevPB;
QPushButton *nextPB;
QPushButton *fwdPB;
QPushButton *bwdPB;
QPushButton *quitPB;
QPushButton *whatbutton;
QPushButton *replayPB;
QPushButton *ejectPB;
QPushButton *aboutPB;
QPushButton *shufflebutton;
QPushButton *configurebutton;
QTabDialog *tabdialog;
QPushButton *infobutton;
BW_LED_Number *trackTimeLED[9];
KLed *led[18];
QComboBox *patchbox;
QComboBox *playbox;
QComboBox *playlistbox;
//Table *channelwindow;
QButtonGroup *ichecks;
QCheckBox *ich[4];
QButtonGroup *rchecks;
QCheckBox *rcb1;
QCheckBox *rcb2;
QCheckBox *rcb3;
QCheckBox *rcb4;
QPushButton *effectbutton;
QSpinBox *meterspin;
QSpinBox *voicespin;
QPushButton *filterbutton;
MeterWidget *meter;
QSize regularsize;
QSize extendedsize;
QSize topbarssize;
QPixmap folder_pixmap;
QPixmap file_pixmap;
QPixmap cdup_pixmap;
QTimer* readtimer;
QLabel *statusLA;
QLabel *volLA;
QLabel *titleLA;
QLabel *propertiesLA;
QLabel *properties2LA;
QLabel *modlabel;
QLabel *totaltimelabel;
QLabel *looplabel;
QLabel *speedLA;
QLabel *song_count_label;
QTimer *timer;
QComboBox *songListCB;
QSlider *volSB;
QSlider *timeSB;
QWidget *backdrop;
QPushButton *makeButton( int, int, int, int, const QString & );
int mixerFd;
bool StopRequested;
bool loop;
int init_volume;
int Child;
bool driver_error;
bool starting_up;
bool looping;
int timestopped;
int max_sec;
int song_number;
int last_sec;
int fastforward;
int fastrewind;
bool randomplay;
bool singleplay;
bool playing;
bool blink;
bool flag_new_playlist;
QString fileName;
QStringList *playlist;
QStringList *listplaylists;
QStringList *errorlist;
LogWindow *logwindow;
ConfigDlg *configdlg;
PlaylistEdit *playlistdlg;
KConfig *config;
KRandomSequence randomSeq;
QDir current_dir;
private:
int smallPtSize();
void display_playmode();
int randomSong();
void resetPos();
void setLEDs(const QString &);
void drawPanel();
void cleanUp();
void loadBitmaps();
//void initMixer( const char *mixer = "/dev/mixer" );
void playthemod(QString );
void redoplaylistbox();
void myresize(int w, int h);
void myresize(QSize newsize);
void enableLowerPanel(bool on);
protected:
void resizeEvent(QResizeEvent *e);
QWhatsThis *what;
public:
KMidi( QWidget *parent=0, const char *name=0 );
void redoplaybox();
void restartPlaybox();
void restartPlayboxWith(const QString &songpath);
void setDry(bool);
void setReverb(int level);
void setChorus(int level);
void setExpressionCurve( int curve );
void setVolumeCurve( int curve );
void setSurround( int yesno );
void postError(const QString& s);
void setCurrentDir(const QString &dir);
signals:
void play();
public slots:
void loadplaylist(int);
void randomPlay();
void updateUI();
void randomClicked();
void ReadPipe();
void setToolTips();
void PlayCommandlineMods();
void PlayMOD();
void readConfig();
void writeConfig();
void setColors();
void playClicked();
void stopClicked();
void infoslot();
void prevClicked();
void nextClicked();
void fwdPressed();
void bwdPressed();
void fwdReleased();
void bwdReleased();
void quitClicked();
void replayClicked();
void ejectClicked();
void aboutClicked();
void logoClicked();
void check_meter_visible();
void volChanged( int );
void timeStart();
void timeStop();
void setPatch( int );
void setEffects( bool );
void setFilter( bool );
void setSong( int );
void resetSong();
void voicesChanged( int );
void meterfudgeChanged( int );
void updateRChecks( int );
void updateIChecks( int );
void dropEvent( QDropEvent * );
void dragEnterEvent( QDragEnterEvent *e );
void plActivated( int );
void acceptPlaylist();
};
extern KMidi *kmidi;
#endif