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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1461 by schoenebeck, Sun Oct 28 23:30:36 2007 UTC revision 2387 by capela, Sat Dec 29 00:21:11 2012 UTC
# Line 1  Line 1 
1  #ifndef QSAMPLER_MAIN_FORM_H  // qsamplerMainForm.h
2  #define QSAMPLER_MAIN_FORM_H  //
3    /****************************************************************************
4       Copyright (C) 2004-2012, rncbc aka Rui Nuno Capela. All rights reserved.
5       Copyright (C) 2007, 2008 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  #include <Qt3Support>  *****************************************************************************/
22    
23  #include <QWorkspace>  #ifndef __qsamplerMainForm_h
24  #include <QList>  #define __qsamplerMainForm_h
 #include <Q3PtrList>  
 #include <QProcess>  
 #include <QMenu>  
25    
26  #include "ui_qsamplerMainForm.h"  #include "ui_qsamplerMainForm.h"
27    
28  #include "qsamplerChannelStrip.h"  #include <lscp/client.h>
29  #include "qsamplerMessages.h"  
30  #include "qsamplerInstrumentListForm.h"  class QProcess;
31  #include "qsamplerDeviceForm.h"  class QMdiArea;
32    class QMdiSubWindow;
33    class QSocketNotifier;
34    class QSpinBox;
35    class QSlider;
36    class QLabel;
37    
38  namespace QSampler {  namespace QSampler {
39    
40    class Options;
41    class Messages;
42    class Channel;
43    class ChannelStrip;
44  class DeviceForm;  class DeviceForm;
45    class InstrumentListForm;
46    
47    //-------------------------------------------------------------------------
48    // QSampler::MainForm -- Main window form implementation.
49    //
50    
51    class MainForm : public QMainWindow
52    {
53            Q_OBJECT
54    
 class MainForm : public QMainWindow {  
 Q_OBJECT  
55  public:  public:
56      MainForm(QWidget* parent = 0);  
57     ~MainForm();          MainForm(QWidget *pParent = NULL);
58      void setup(qsamplerOptions* pOptions);          ~MainForm();
59      void contextMenuEvent(QContextMenuEvent *pEvent);  
60      qsamplerOptions* options(void);          void setup(Options* pOptions);
61      lscp_client_t* client(void);  
62      QString sessionName(const QString& sFilename);          Options* options() const;
63      void appendMessages(const QString& s);          lscp_client_t* client() const;
64      void appendMessagesColor(const QString& s, const QString& c);  
65      void appendMessagesText(const QString& s);          QString sessionName(const QString& sFilename);
66      void appendMessagesError(const QString& s);  
67      void appendMessagesClient(const QString& s);          void appendMessages(const QString& s);
68      ChannelStrip* createChannelStrip(qsamplerChannel *pChannel);          void appendMessagesColor(const QString& s, const QString& c);
69      ChannelStrip* activeChannelStrip(void);          void appendMessagesText(const QString& s);
70      ChannelStrip* channelStripAt(int iChannel);          void appendMessagesError(const QString& s);
71      ChannelStrip* channelStrip(int iChannelID);          void appendMessagesClient(const QString& s);
72      static MainForm* getInstance(void);  
73            ChannelStrip *createChannelStrip(Channel *pChannel);
74            void destroyChannelStrip(ChannelStrip *pChannelStrip);
75            ChannelStrip *activeChannelStrip();
76            ChannelStrip *channelStripAt(int iChannel);
77            ChannelStrip *channelStrip(int iChannelID);
78    
79            void contextMenuEvent(QContextMenuEvent *pEvent);
80    
81            static MainForm* getInstance();
82    
83  public slots:  public slots:
84      void sessionDirty(void);  
85      void stabilizeForm(void);          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            void handle_sigusr1();
121    
122    protected slots:
123    
124            void updateRecentFilesMenu();
125    
126            // Channel strip activation/selection.
127            void activateStrip(QMdiSubWindow *pMdiSubWindow);
128    
129  protected:  protected:
130      bool queryClose(void);  
131      void closeEvent(QCloseEvent* pCloseEvent);          bool queryClose();
132      bool decodeDragFiles(const QMimeSource* pEvent, QStringList& files);          void closeEvent(QCloseEvent* pCloseEvent);
133      void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);          void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
134      void dropEvent(QDropEvent *pDropEvent);          void dropEvent(QDropEvent *pDropEvent);
135      void customEvent(QEvent* pCustomEvent);          void customEvent(QEvent* pCustomEvent);
136      bool newSession(void);          bool newSession();
137      bool openSession(void);          bool openSession();
138      bool saveSession(bool bPrompt);          bool saveSession(bool bPrompt);
139      bool closeSession(bool bForce);          bool closeSession(bool bForce);
140      bool loadSessionFile(const QString& sFilename);          bool loadSessionFile(const QString& sFilename);
141      bool saveSessionFile(const QString& sFilename);          bool saveSessionFile(const QString& sFilename);
142      void updateSession();          void updateSession();
143      void updateRecentFiles(const QString& sFilename);          void updateRecentFiles(const QString& sFilename);
144      void updateRecentFilesMenu(void);          void updateInstrumentNames();
145      void updateInstrumentNames(void);          void updateDisplayFont();
146      void updateDisplayFont(void);          void updateDisplayEffect();
147      void updateDisplayEffect(void);          void updateMaxVolume();
148      void updateMaxVolume(void);          void updateMessagesFont();
149      void updateMessagesFont(void);          void updateMessagesLimit();
150      void updateMessagesLimit(void);          void updateMessagesCapture();
151      void updateMessagesCapture(void);          void updateViewMidiDeviceStatusMenu();
152      void startSchedule(int iStartDelay);          void updateAllChannelStrips(bool bRemoveDeadStrips);
153      void stopSchedule(void);          void startSchedule(int iStartDelay);
154      void startServer(void);          void stopSchedule();
155      void stopServer(void);          void startServer();
156      bool startClient(void);          void stopServer(bool bInteractive = false);
157      void stopClient(void);          bool startClient();
158            void stopClient();
159    
160  private:  private:
     Ui::qsamplerMainForm ui;  
161    
162      qsamplerOptions *m_pOptions;          Ui::qsamplerMainForm m_ui;
163      qsamplerMessages *m_pMessages;  
164      QWorkspace *m_pWorkspace;          Options *m_pOptions;
165      QString m_sFilename;          Messages *m_pMessages;
166      int m_iUntitled;          QMdiArea *m_pWorkspace;
167      int m_iDirtyCount;          QSocketNotifier *m_pUsr1Notifier;
168      lscp_client_t *m_pClient;          QString m_sFilename;
169      QProcess *m_pServer;          int m_iUntitled;
170      int m_iStartDelay;          int m_iDirtyCount;
171      int m_iTimerDelay;          lscp_client_t *m_pClient;
172      int m_iTimerSlot;          QProcess *m_pServer;
173      QLabel *m_statusItem[5];          bool bForceServerStop;
174      QMenu *m_pRecentFilesMenu;          int m_iStartDelay;
175      Q3PtrList<ChannelStrip> m_changedStrips;          int m_iTimerDelay;
176      InstrumentListForm *m_pInstrumentListForm;          int m_iTimerSlot;
177      DeviceForm *m_pDeviceForm;          QLabel *m_statusItem[5];
178      static MainForm *g_pMainForm;          QList<ChannelStrip *> m_changedStrips;
179      QSlider *m_pVolumeSlider;          InstrumentListForm *m_pInstrumentListForm;
180      QSpinBox *m_pVolumeSpinBox;          DeviceForm *m_pDeviceForm;
181      int m_iVolumeChanging;          static MainForm *g_pMainForm;
182      QToolBar* fileToolbar;          QSlider *m_pVolumeSlider;
183      QToolBar* editToolbar;          QSpinBox *m_pVolumeSpinBox;
184      QToolBar* channelsToolbar;          int m_iVolumeChanging;
   
 private slots:  
     void fileNew(void);  
     void fileOpen(void);  
     void fileOpenRecent(int iIndex);  
     void fileSave(void);  
     void fileSaveAs(void);  
     void fileReset(void);  
     void fileRestart(void);  
     void fileExit(void);  
     void editAddChannel(void);  
     void editRemoveChannel(void);  
     void editSetupChannel(void);  
     void editEditChannel(void);  
     void editResetChannel(void);  
     void editResetAllChannels(void);  
     void viewMenubar(bool bOn);  
     void viewToolbar(bool bOn);  
     void viewStatusbar(bool bOn);  
     void viewMessages(bool bOn);  
     void viewInstruments(void);  
     void viewDevices(void);  
     void viewOptions(void);  
     void channelsArrange(void);  
     void channelsAutoArrange(bool bOn);  
     void helpAboutQt(void);  
     void helpAbout(void);  
     void volumeChanged(int iVolume);  
     void channelStripChanged(ChannelStrip *pChannelStrip);  
     void channelsMenuAboutToShow();  
     void channelsMenuActivated(int iChannel);  
     void timerSlot(void);  
     void readServerStdout(void);  
     void processServerExit(void);  
185  };  };
186    
187  } // namespace QSampler  } // namespace QSampler
188    
189  #endif // QSAMPLER_MAIN_FORM_H  #endif // __qsamplerMainForm_h
190    
191    
192    // end of qsamplerMainForm.h

Legend:
Removed from v.1461  
changed lines
  Added in v.2387

  ViewVC Help
Powered by ViewVC