1 |
capela |
1464 |
// qsamplerMainForm.h |
2 |
|
|
// |
3 |
|
|
/**************************************************************************** |
4 |
|
|
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
|
|
Copyright (C) 2007, Christian Schoenebeck |
6 |
schoenebeck |
1461 |
|
7 |
capela |
1464 |
This program is free software; you can redistribute it and/or |
8 |
|
|
modify it under the terms of the GNU General Public License |
9 |
|
|
as published by the Free Software Foundation; either version 2 |
10 |
|
|
of the License, or (at your option) any later version. |
11 |
|
|
|
12 |
|
|
This program is distributed in the hope that it will be useful, |
13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
|
GNU General Public License for more details. |
16 |
|
|
|
17 |
|
|
You should have received a copy of the GNU General Public License along |
18 |
|
|
with this program; if not, write to the Free Software Foundation, Inc., |
19 |
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20 |
|
|
|
21 |
|
|
*****************************************************************************/ |
22 |
|
|
|
23 |
|
|
#ifndef __qsamplerMainForm_h |
24 |
|
|
#define __qsamplerMainForm_h |
25 |
|
|
|
26 |
schoenebeck |
1461 |
#include "ui_qsamplerMainForm.h" |
27 |
|
|
|
28 |
capela |
1513 |
#include <lscp/client.h> |
29 |
schoenebeck |
1461 |
|
30 |
capela |
1513 |
class QProcess; |
31 |
capela |
1499 |
class QWorkspace; |
32 |
capela |
1513 |
class QSpinBox; |
33 |
|
|
class QSlider; |
34 |
|
|
class QLabel; |
35 |
capela |
1499 |
|
36 |
schoenebeck |
1461 |
namespace QSampler { |
37 |
|
|
|
38 |
capela |
1558 |
class Options; |
39 |
|
|
class Messages; |
40 |
|
|
class Channel; |
41 |
capela |
1513 |
class ChannelStrip; |
42 |
schoenebeck |
1461 |
class DeviceForm; |
43 |
capela |
1513 |
class InstrumentListForm; |
44 |
schoenebeck |
1461 |
|
45 |
capela |
1558 |
//------------------------------------------------------------------------- |
46 |
|
|
// QSampler::MainForm -- Main window form implementation. |
47 |
|
|
// |
48 |
capela |
1513 |
|
49 |
capela |
1509 |
class MainForm : public QMainWindow |
50 |
|
|
{ |
51 |
|
|
Q_OBJECT |
52 |
|
|
|
53 |
schoenebeck |
1461 |
public: |
54 |
|
|
|
55 |
capela |
1509 |
MainForm(QWidget *pParent = NULL); |
56 |
|
|
~MainForm(); |
57 |
|
|
|
58 |
capela |
1558 |
void setup(Options* pOptions); |
59 |
capela |
1509 |
|
60 |
capela |
1558 |
Options* options() const; |
61 |
capela |
1509 |
lscp_client_t* client() const; |
62 |
|
|
|
63 |
|
|
QString sessionName(const QString& sFilename); |
64 |
|
|
|
65 |
|
|
void appendMessages(const QString& s); |
66 |
|
|
void appendMessagesColor(const QString& s, const QString& c); |
67 |
|
|
void appendMessagesText(const QString& s); |
68 |
|
|
void appendMessagesError(const QString& s); |
69 |
|
|
void appendMessagesClient(const QString& s); |
70 |
|
|
|
71 |
capela |
1558 |
ChannelStrip* createChannelStrip(Channel *pChannel); |
72 |
capela |
1509 |
ChannelStrip* activeChannelStrip(); |
73 |
|
|
ChannelStrip* channelStripAt(int iChannel); |
74 |
|
|
ChannelStrip* channelStrip(int iChannelID); |
75 |
|
|
|
76 |
|
|
void contextMenuEvent(QContextMenuEvent *pEvent); |
77 |
|
|
|
78 |
|
|
static MainForm* getInstance(); |
79 |
|
|
|
80 |
schoenebeck |
1461 |
public slots: |
81 |
|
|
|
82 |
capela |
1509 |
void fileNew(); |
83 |
|
|
void fileOpen(); |
84 |
|
|
void fileOpenRecent(); |
85 |
|
|
void fileSave(); |
86 |
|
|
void fileSaveAs(); |
87 |
|
|
void fileReset(); |
88 |
|
|
void fileRestart(); |
89 |
|
|
void fileExit(); |
90 |
|
|
void editAddChannel(); |
91 |
|
|
void editRemoveChannel(); |
92 |
|
|
void editSetupChannel(); |
93 |
|
|
void editEditChannel(); |
94 |
|
|
void editResetChannel(); |
95 |
|
|
void editResetAllChannels(); |
96 |
|
|
void viewMenubar(bool bOn); |
97 |
|
|
void viewToolbar(bool bOn); |
98 |
|
|
void viewStatusbar(bool bOn); |
99 |
|
|
void viewMessages(bool bOn); |
100 |
|
|
void viewInstruments(); |
101 |
|
|
void viewDevices(); |
102 |
|
|
void viewOptions(); |
103 |
|
|
void channelsArrange(); |
104 |
|
|
void channelsAutoArrange(bool bOn); |
105 |
|
|
void helpAboutQt(); |
106 |
|
|
void helpAbout(); |
107 |
|
|
void volumeChanged(int iVolume); |
108 |
|
|
void channelStripChanged(ChannelStrip *pChannelStrip); |
109 |
|
|
void channelsMenuAboutToShow(); |
110 |
|
|
void channelsMenuActivated(); |
111 |
|
|
void timerSlot(); |
112 |
|
|
void readServerStdout(); |
113 |
|
|
void processServerExit(); |
114 |
|
|
void sessionDirty(); |
115 |
|
|
void stabilizeForm(); |
116 |
|
|
|
117 |
capela |
1499 |
protected slots: |
118 |
|
|
|
119 |
capela |
1509 |
void updateRecentFilesMenu(); |
120 |
capela |
1499 |
|
121 |
capela |
1514 |
// Channel strip activation/selection. |
122 |
|
|
void activateStrip(QWidget *pWidget); |
123 |
|
|
|
124 |
schoenebeck |
1461 |
protected: |
125 |
|
|
|
126 |
capela |
1509 |
bool queryClose(); |
127 |
|
|
void closeEvent(QCloseEvent* pCloseEvent); |
128 |
|
|
void dragEnterEvent(QDragEnterEvent *pDragEnterEvent); |
129 |
|
|
void dropEvent(QDropEvent *pDropEvent); |
130 |
|
|
void customEvent(QEvent* pCustomEvent); |
131 |
|
|
bool newSession(); |
132 |
|
|
bool openSession(); |
133 |
|
|
bool saveSession(bool bPrompt); |
134 |
|
|
bool closeSession(bool bForce); |
135 |
|
|
bool loadSessionFile(const QString& sFilename); |
136 |
|
|
bool saveSessionFile(const QString& sFilename); |
137 |
|
|
void updateSession(); |
138 |
|
|
void updateRecentFiles(const QString& sFilename); |
139 |
|
|
void updateInstrumentNames(); |
140 |
|
|
void updateDisplayFont(); |
141 |
|
|
void updateDisplayEffect(); |
142 |
|
|
void updateMaxVolume(); |
143 |
|
|
void updateMessagesFont(); |
144 |
|
|
void updateMessagesLimit(); |
145 |
|
|
void updateMessagesCapture(); |
146 |
|
|
void startSchedule(int iStartDelay); |
147 |
|
|
void stopSchedule(); |
148 |
|
|
void startServer(); |
149 |
schoenebeck |
1626 |
void stopServer(bool bInteractive = false); |
150 |
capela |
1509 |
bool startClient(); |
151 |
|
|
void stopClient(); |
152 |
|
|
|
153 |
schoenebeck |
1461 |
private: |
154 |
|
|
|
155 |
capela |
1509 |
Ui::qsamplerMainForm m_ui; |
156 |
schoenebeck |
1461 |
|
157 |
capela |
1558 |
Options *m_pOptions; |
158 |
|
|
Messages *m_pMessages; |
159 |
capela |
1509 |
QWorkspace *m_pWorkspace; |
160 |
|
|
QString m_sFilename; |
161 |
|
|
int m_iUntitled; |
162 |
|
|
int m_iDirtyCount; |
163 |
|
|
lscp_client_t *m_pClient; |
164 |
|
|
QProcess *m_pServer; |
165 |
schoenebeck |
1626 |
bool bForceServerStop; |
166 |
capela |
1509 |
int m_iStartDelay; |
167 |
|
|
int m_iTimerDelay; |
168 |
|
|
int m_iTimerSlot; |
169 |
|
|
QLabel *m_statusItem[5]; |
170 |
|
|
QList<ChannelStrip *> m_changedStrips; |
171 |
|
|
InstrumentListForm *m_pInstrumentListForm; |
172 |
|
|
DeviceForm *m_pDeviceForm; |
173 |
|
|
static MainForm *g_pMainForm; |
174 |
|
|
QSlider *m_pVolumeSlider; |
175 |
|
|
QSpinBox *m_pVolumeSpinBox; |
176 |
|
|
int m_iVolumeChanging; |
177 |
schoenebeck |
1461 |
}; |
178 |
|
|
|
179 |
|
|
} // namespace QSampler |
180 |
|
|
|
181 |
capela |
1464 |
#endif // __qsamplerMainForm_h |
182 |
|
|
|
183 |
|
|
|
184 |
capela |
1465 |
// end of qsamplerMainForm.h |