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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2415 - (hide annotations) (download) (as text)
Thu Feb 14 14:57:43 2013 UTC (11 years, 2 months ago) by capela
File MIME type: text/x-c++hdr
File size: 5037 byte(s)
- Yet another Qt5 preparations fix.
1 capela 1464 // qsamplerMainForm.h
2     //
3     /****************************************************************************
4 capela 2415 Copyright (C) 2004-2013, rncbc aka Rui Nuno Capela. All rights reserved.
5 schoenebeck 1698 Copyright (C) 2007, 2008 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 2387 class QMdiArea;
32     class QMdiSubWindow;
33 capela 2112 class QSocketNotifier;
34 capela 1513 class QSpinBox;
35     class QSlider;
36     class QLabel;
37 capela 1499
38 schoenebeck 1461 namespace QSampler {
39    
40 capela 1558 class Options;
41     class Messages;
42     class Channel;
43 capela 1513 class ChannelStrip;
44 schoenebeck 1461 class DeviceForm;
45 capela 1513 class InstrumentListForm;
46 schoenebeck 1461
47 capela 1558 //-------------------------------------------------------------------------
48     // QSampler::MainForm -- Main window form implementation.
49     //
50 capela 1513
51 capela 1509 class MainForm : public QMainWindow
52     {
53     Q_OBJECT
54    
55 schoenebeck 1461 public:
56    
57 capela 1509 MainForm(QWidget *pParent = NULL);
58     ~MainForm();
59    
60 capela 1558 void setup(Options* pOptions);
61 capela 1509
62 capela 1558 Options* options() const;
63 capela 1509 lscp_client_t* client() const;
64    
65     QString sessionName(const QString& sFilename);
66    
67     void appendMessages(const QString& s);
68     void appendMessagesColor(const QString& s, const QString& c);
69     void appendMessagesText(const QString& s);
70     void appendMessagesError(const QString& s);
71     void appendMessagesClient(const QString& s);
72    
73 capela 2387 ChannelStrip *createChannelStrip(Channel *pChannel);
74     void destroyChannelStrip(ChannelStrip *pChannelStrip);
75     ChannelStrip *activeChannelStrip();
76     ChannelStrip *channelStripAt(int iChannel);
77     ChannelStrip *channelStrip(int iChannelID);
78 capela 1509
79     void contextMenuEvent(QContextMenuEvent *pEvent);
80    
81     static MainForm* getInstance();
82    
83 schoenebeck 1461 public slots:
84    
85 capela 1509 void fileNew();
86     void fileOpen();
87     void fileOpenRecent();
88     void fileSave();
89     void fileSaveAs();
90     void fileReset();
91     void fileRestart();
92     void fileExit();
93     void editAddChannel();
94     void editRemoveChannel();
95     void editSetupChannel();
96     void editEditChannel();
97     void editResetChannel();
98     void editResetAllChannels();
99     void viewMenubar(bool bOn);
100     void viewToolbar(bool bOn);
101     void viewStatusbar(bool bOn);
102     void viewMessages(bool bOn);
103     void viewInstruments();
104     void viewDevices();
105     void viewOptions();
106     void channelsArrange();
107     void channelsAutoArrange(bool bOn);
108     void helpAboutQt();
109     void helpAbout();
110     void volumeChanged(int iVolume);
111     void channelStripChanged(ChannelStrip *pChannelStrip);
112     void channelsMenuAboutToShow();
113     void channelsMenuActivated();
114     void timerSlot();
115     void readServerStdout();
116     void processServerExit();
117     void sessionDirty();
118     void stabilizeForm();
119    
120 capela 2112 void handle_sigusr1();
121    
122 capela 1499 protected slots:
123    
124 capela 1509 void updateRecentFilesMenu();
125 capela 1499
126 capela 1514 // Channel strip activation/selection.
127 capela 2387 void activateStrip(QMdiSubWindow *pMdiSubWindow);
128 capela 1514
129 schoenebeck 1461 protected:
130    
131 capela 1509 bool queryClose();
132     void closeEvent(QCloseEvent* pCloseEvent);
133     void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
134     void dropEvent(QDropEvent *pDropEvent);
135     void customEvent(QEvent* pCustomEvent);
136     bool newSession();
137     bool openSession();
138     bool saveSession(bool bPrompt);
139     bool closeSession(bool bForce);
140     bool loadSessionFile(const QString& sFilename);
141     bool saveSessionFile(const QString& sFilename);
142     void updateSession();
143     void updateRecentFiles(const QString& sFilename);
144     void updateInstrumentNames();
145     void updateDisplayFont();
146     void updateDisplayEffect();
147     void updateMaxVolume();
148     void updateMessagesFont();
149     void updateMessagesLimit();
150     void updateMessagesCapture();
151 schoenebeck 1698 void updateViewMidiDeviceStatusMenu();
152 schoenebeck 1702 void updateAllChannelStrips(bool bRemoveDeadStrips);
153 capela 1509 void startSchedule(int iStartDelay);
154     void stopSchedule();
155     void startServer();
156 schoenebeck 1626 void stopServer(bool bInteractive = false);
157 capela 1509 bool startClient();
158     void stopClient();
159    
160 schoenebeck 1461 private:
161    
162 capela 1509 Ui::qsamplerMainForm m_ui;
163 schoenebeck 1461
164 capela 1558 Options *m_pOptions;
165     Messages *m_pMessages;
166 capela 2387 QMdiArea *m_pWorkspace;
167 capela 2112 QSocketNotifier *m_pUsr1Notifier;
168 capela 1509 QString m_sFilename;
169     int m_iUntitled;
170     int m_iDirtyCount;
171     lscp_client_t *m_pClient;
172     QProcess *m_pServer;
173 schoenebeck 1626 bool bForceServerStop;
174 capela 1509 int m_iStartDelay;
175     int m_iTimerDelay;
176     int m_iTimerSlot;
177     QLabel *m_statusItem[5];
178     QList<ChannelStrip *> m_changedStrips;
179     InstrumentListForm *m_pInstrumentListForm;
180     DeviceForm *m_pDeviceForm;
181     static MainForm *g_pMainForm;
182     QSlider *m_pVolumeSlider;
183     QSpinBox *m_pVolumeSpinBox;
184     int m_iVolumeChanging;
185 schoenebeck 1461 };
186    
187     } // namespace QSampler
188    
189 capela 1464 #endif // __qsamplerMainForm_h
190    
191    
192 capela 1465 // end of qsamplerMainForm.h

  ViewVC Help
Powered by ViewVC