1 |
// qsamplerMainForm.h |
2 |
// |
3 |
/**************************************************************************** |
4 |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, Christian Schoenebeck |
6 |
|
7 |
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 |
#include "ui_qsamplerMainForm.h" |
27 |
|
28 |
#include "qsamplerMessages.h" |
29 |
#include "qsamplerChannelStrip.h" |
30 |
#include "qsamplerInstrumentListForm.h" |
31 |
#include "qsamplerDeviceForm.h" |
32 |
|
33 |
class QWorkspace; |
34 |
class QProcess; |
35 |
|
36 |
|
37 |
namespace QSampler { |
38 |
|
39 |
class DeviceForm; |
40 |
|
41 |
class MainForm : public QMainWindow |
42 |
{ |
43 |
Q_OBJECT |
44 |
|
45 |
public: |
46 |
|
47 |
MainForm(QWidget *pParent = NULL); |
48 |
~MainForm(); |
49 |
|
50 |
void setup(qsamplerOptions* pOptions); |
51 |
|
52 |
qsamplerOptions* options() const; |
53 |
lscp_client_t* client() const; |
54 |
|
55 |
QString sessionName(const QString& sFilename); |
56 |
|
57 |
void appendMessages(const QString& s); |
58 |
void appendMessagesColor(const QString& s, const QString& c); |
59 |
void appendMessagesText(const QString& s); |
60 |
void appendMessagesError(const QString& s); |
61 |
void appendMessagesClient(const QString& s); |
62 |
|
63 |
ChannelStrip* createChannelStrip(qsamplerChannel *pChannel); |
64 |
ChannelStrip* activeChannelStrip(); |
65 |
ChannelStrip* channelStripAt(int iChannel); |
66 |
ChannelStrip* channelStrip(int iChannelID); |
67 |
|
68 |
void contextMenuEvent(QContextMenuEvent *pEvent); |
69 |
|
70 |
static MainForm* getInstance(); |
71 |
|
72 |
public slots: |
73 |
|
74 |
void fileNew(); |
75 |
void fileOpen(); |
76 |
void fileOpenRecent(); |
77 |
void fileSave(); |
78 |
void fileSaveAs(); |
79 |
void fileReset(); |
80 |
void fileRestart(); |
81 |
void fileExit(); |
82 |
void editAddChannel(); |
83 |
void editRemoveChannel(); |
84 |
void editSetupChannel(); |
85 |
void editEditChannel(); |
86 |
void editResetChannel(); |
87 |
void editResetAllChannels(); |
88 |
void viewMenubar(bool bOn); |
89 |
void viewToolbar(bool bOn); |
90 |
void viewStatusbar(bool bOn); |
91 |
void viewMessages(bool bOn); |
92 |
void viewInstruments(); |
93 |
void viewDevices(); |
94 |
void viewOptions(); |
95 |
void channelsArrange(); |
96 |
void channelsAutoArrange(bool bOn); |
97 |
void helpAboutQt(); |
98 |
void helpAbout(); |
99 |
void volumeChanged(int iVolume); |
100 |
void channelStripChanged(ChannelStrip *pChannelStrip); |
101 |
void channelsMenuAboutToShow(); |
102 |
void channelsMenuActivated(); |
103 |
void timerSlot(); |
104 |
void readServerStdout(); |
105 |
void processServerExit(); |
106 |
void sessionDirty(); |
107 |
void stabilizeForm(); |
108 |
|
109 |
protected slots: |
110 |
|
111 |
void updateRecentFilesMenu(); |
112 |
|
113 |
protected: |
114 |
|
115 |
bool queryClose(); |
116 |
void closeEvent(QCloseEvent* pCloseEvent); |
117 |
void dragEnterEvent(QDragEnterEvent *pDragEnterEvent); |
118 |
void dropEvent(QDropEvent *pDropEvent); |
119 |
void customEvent(QEvent* pCustomEvent); |
120 |
bool newSession(); |
121 |
bool openSession(); |
122 |
bool saveSession(bool bPrompt); |
123 |
bool closeSession(bool bForce); |
124 |
bool loadSessionFile(const QString& sFilename); |
125 |
bool saveSessionFile(const QString& sFilename); |
126 |
void updateSession(); |
127 |
void updateRecentFiles(const QString& sFilename); |
128 |
void updateInstrumentNames(); |
129 |
void updateDisplayFont(); |
130 |
void updateDisplayEffect(); |
131 |
void updateMaxVolume(); |
132 |
void updateMessagesFont(); |
133 |
void updateMessagesLimit(); |
134 |
void updateMessagesCapture(); |
135 |
void startSchedule(int iStartDelay); |
136 |
void stopSchedule(); |
137 |
void startServer(); |
138 |
void stopServer(); |
139 |
bool startClient(); |
140 |
void stopClient(); |
141 |
|
142 |
private: |
143 |
|
144 |
Ui::qsamplerMainForm m_ui; |
145 |
|
146 |
qsamplerOptions *m_pOptions; |
147 |
qsamplerMessages *m_pMessages; |
148 |
QWorkspace *m_pWorkspace; |
149 |
QString m_sFilename; |
150 |
int m_iUntitled; |
151 |
int m_iDirtyCount; |
152 |
lscp_client_t *m_pClient; |
153 |
QProcess *m_pServer; |
154 |
int m_iStartDelay; |
155 |
int m_iTimerDelay; |
156 |
int m_iTimerSlot; |
157 |
QLabel *m_statusItem[5]; |
158 |
QList<ChannelStrip *> m_changedStrips; |
159 |
InstrumentListForm *m_pInstrumentListForm; |
160 |
DeviceForm *m_pDeviceForm; |
161 |
static MainForm *g_pMainForm; |
162 |
QSlider *m_pVolumeSlider; |
163 |
QSpinBox *m_pVolumeSpinBox; |
164 |
int m_iVolumeChanging; |
165 |
}; |
166 |
|
167 |
} // namespace QSampler |
168 |
|
169 |
#endif // __qsamplerMainForm_h |
170 |
|
171 |
|
172 |
// end of qsamplerMainForm.h |