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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2112 - (hide annotations) (download) (as text)
Wed Jul 21 18:33:25 2010 UTC (13 years, 9 months ago) by capela
File MIME type: text/x-c++hdr
File size: 5008 byte(s)
- Moving from old deprecated Qt3'ish custom event post handling
  into regular asynchronous signal/slot strategy. (EXPERIMENTAL)

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

  ViewVC Help
Powered by ViewVC