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

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

  ViewVC Help
Powered by ViewVC