/[svn]/qsampler/trunk/src/qsamplerMainForm.h
ViewVC logotype

Contents of /qsampler/trunk/src/qsamplerMainForm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1465 - (show annotations) (download) (as text)
Thu Nov 1 17:49:27 2007 UTC (16 years, 5 months ago) by capela
File MIME type: text/x-c++hdr
File size: 5251 byte(s)
- Qt4 migration: main toolbars and messages dock-widget fix.

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

  ViewVC Help
Powered by ViewVC