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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1466 - (show annotations) (download) (as text)
Thu Nov 1 19:25:10 2007 UTC (16 years, 5 months ago) by capela
File MIME type: text/x-c++hdr
File size: 5166 byte(s)
* Qt4 migration: added missing signal/slot connections for most forms.

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
124 private slots:
125 void fileNew(void);
126 void fileOpen(void);
127 void fileOpenRecent(int iIndex);
128 void fileSave(void);
129 void fileSaveAs(void);
130 void fileReset(void);
131 void fileRestart(void);
132 void fileExit(void);
133 void editAddChannel(void);
134 void editRemoveChannel(void);
135 void editSetupChannel(void);
136 void editEditChannel(void);
137 void editResetChannel(void);
138 void editResetAllChannels(void);
139 void viewMenubar(bool bOn);
140 void viewToolbar(bool bOn);
141 void viewStatusbar(bool bOn);
142 void viewMessages(bool bOn);
143 void viewInstruments(void);
144 void viewDevices(void);
145 void viewOptions(void);
146 void channelsArrange(void);
147 void channelsAutoArrange(bool bOn);
148 void helpAboutQt(void);
149 void helpAbout(void);
150 void volumeChanged(int iVolume);
151 void channelStripChanged(ChannelStrip *pChannelStrip);
152 void channelsMenuAboutToShow();
153 void channelsMenuActivated(int iChannel);
154 void timerSlot(void);
155 void readServerStdout(void);
156 void processServerExit(void);
157 };
158
159 } // namespace QSampler
160
161 #endif // __qsamplerMainForm_h
162
163
164 // end of qsamplerMainForm.h

  ViewVC Help
Powered by ViewVC