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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2722 - (hide annotations) (download) (as text)
Tue Mar 3 17:41:04 2015 UTC (9 years, 1 month ago) by capela
File MIME type: text/x-c++hdr
File size: 5170 byte(s)
* Added this "Don't ask/show this again" option to some if not most
  of the nagging warning/error message boxes. (EXPERIMENTAL)
1 capela 1464 // qsamplerMainForm.h
2     //
3     /****************************************************************************
4 capela 2718 Copyright (C) 2004-2015, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007,2008,2015 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 capela 2722 void appendMessages(const QString& sText);
68     void appendMessagesColor(const QString& sText, const QString& sColor);
69     void appendMessagesText(const QString& sText);
70     void appendMessagesError(const QString& sText);
71     void appendMessagesClient(const QString& sText);
72 capela 1509
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 capela 2681 // Channel toolbar orientation change.
130     void channelsToolbarOrientation(Qt::Orientation orientation);
131    
132 schoenebeck 1461 protected:
133    
134 capela 1509 bool queryClose();
135     void closeEvent(QCloseEvent* pCloseEvent);
136     void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
137     void dropEvent(QDropEvent *pDropEvent);
138     void customEvent(QEvent* pCustomEvent);
139     bool newSession();
140     bool openSession();
141     bool saveSession(bool bPrompt);
142     bool closeSession(bool bForce);
143     bool loadSessionFile(const QString& sFilename);
144     bool saveSessionFile(const QString& sFilename);
145     void updateSession();
146     void updateRecentFiles(const QString& sFilename);
147     void updateInstrumentNames();
148     void updateDisplayFont();
149     void updateDisplayEffect();
150     void updateMaxVolume();
151     void updateMessagesFont();
152     void updateMessagesLimit();
153     void updateMessagesCapture();
154 schoenebeck 1698 void updateViewMidiDeviceStatusMenu();
155 schoenebeck 1702 void updateAllChannelStrips(bool bRemoveDeadStrips);
156 capela 1509 void startSchedule(int iStartDelay);
157     void stopSchedule();
158     void startServer();
159 schoenebeck 1626 void stopServer(bool bInteractive = false);
160 capela 1509 bool startClient();
161     void stopClient();
162    
163 schoenebeck 1461 private:
164    
165 capela 1509 Ui::qsamplerMainForm m_ui;
166 schoenebeck 1461
167 capela 1558 Options *m_pOptions;
168     Messages *m_pMessages;
169 capela 2387 QMdiArea *m_pWorkspace;
170 capela 2112 QSocketNotifier *m_pUsr1Notifier;
171 capela 1509 QString m_sFilename;
172     int m_iUntitled;
173     int m_iDirtyCount;
174     lscp_client_t *m_pClient;
175     QProcess *m_pServer;
176 schoenebeck 1626 bool bForceServerStop;
177 capela 1509 int m_iStartDelay;
178     int m_iTimerDelay;
179     int m_iTimerSlot;
180     QLabel *m_statusItem[5];
181     QList<ChannelStrip *> m_changedStrips;
182     InstrumentListForm *m_pInstrumentListForm;
183     DeviceForm *m_pDeviceForm;
184     static MainForm *g_pMainForm;
185     QSlider *m_pVolumeSlider;
186     QSpinBox *m_pVolumeSpinBox;
187     int m_iVolumeChanging;
188 schoenebeck 1461 };
189    
190     } // namespace QSampler
191    
192 capela 1464 #endif // __qsamplerMainForm_h
193    
194    
195 capela 1465 // end of qsamplerMainForm.h

  ViewVC Help
Powered by ViewVC