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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2978 - (hide annotations) (download) (as text)
Mon Aug 15 19:10:16 2016 UTC (7 years, 8 months ago) by capela
File MIME type: text/x-c++hdr
File size: 5279 byte(s)
* Fixed a race condition on creating sampler channels that ended
  in duplicate channel strips; also fixed channel auto-arrange.
1 capela 1464 // qsamplerMainForm.h
2     //
3     /****************************************************************************
4 capela 2978 Copyright (C) 2004-2016, rncbc aka Rui Nuno Capela. All rights reserved.
5 capela 2718 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 2978 void addChannelStrip();
135     void removeChannelStrip();
136    
137 capela 1509 bool queryClose();
138     void closeEvent(QCloseEvent* pCloseEvent);
139     void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
140     void dropEvent(QDropEvent *pDropEvent);
141 capela 2978 void customEvent(QEvent *pCustomEvent);
142     void resizeEvent(QResizeEvent *);
143 capela 1509 bool newSession();
144     bool openSession();
145     bool saveSession(bool bPrompt);
146     bool closeSession(bool bForce);
147     bool loadSessionFile(const QString& sFilename);
148     bool saveSessionFile(const QString& sFilename);
149     void updateSession();
150     void updateRecentFiles(const QString& sFilename);
151     void updateInstrumentNames();
152     void updateDisplayFont();
153     void updateDisplayEffect();
154     void updateMaxVolume();
155     void updateMessagesFont();
156     void updateMessagesLimit();
157     void updateMessagesCapture();
158 schoenebeck 1698 void updateViewMidiDeviceStatusMenu();
159 schoenebeck 1702 void updateAllChannelStrips(bool bRemoveDeadStrips);
160 capela 1509 void startSchedule(int iStartDelay);
161     void stopSchedule();
162     void startServer();
163 schoenebeck 1626 void stopServer(bool bInteractive = false);
164 capela 1509 bool startClient();
165     void stopClient();
166    
167 schoenebeck 1461 private:
168    
169 capela 1509 Ui::qsamplerMainForm m_ui;
170 schoenebeck 1461
171 capela 1558 Options *m_pOptions;
172     Messages *m_pMessages;
173 capela 2387 QMdiArea *m_pWorkspace;
174 capela 2112 QSocketNotifier *m_pUsr1Notifier;
175 capela 1509 QString m_sFilename;
176     int m_iUntitled;
177 capela 2978 int m_iDirtySetup;
178 capela 1509 int m_iDirtyCount;
179     lscp_client_t *m_pClient;
180     QProcess *m_pServer;
181 schoenebeck 1626 bool bForceServerStop;
182 capela 1509 int m_iStartDelay;
183     int m_iTimerDelay;
184     int m_iTimerSlot;
185     QLabel *m_statusItem[5];
186     QList<ChannelStrip *> m_changedStrips;
187     InstrumentListForm *m_pInstrumentListForm;
188     DeviceForm *m_pDeviceForm;
189     static MainForm *g_pMainForm;
190     QSlider *m_pVolumeSlider;
191     QSpinBox *m_pVolumeSpinBox;
192     int m_iVolumeChanging;
193 schoenebeck 1461 };
194    
195     } // namespace QSampler
196    
197 capela 1464 #endif // __qsamplerMainForm_h
198    
199    
200 capela 1465 // end of qsamplerMainForm.h

  ViewVC Help
Powered by ViewVC