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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1499 - (show annotations) (download) (as text)
Tue Nov 20 16:48:04 2007 UTC (16 years, 5 months ago) by capela
File MIME type: text/x-c++hdr
File size: 4796 byte(s)
* Qt4 migration: one first step forward to kiss Qt3Support goodbye.

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

  ViewVC Help
Powered by ViewVC