/[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 1499 by capela, Tue Nov 20 16:48:04 2007 UTC revision 2387 by capela, Sat Dec 29 00:21:11 2012 UTC
# Line 1  Line 1 
1  // qsamplerMainForm.h  // qsamplerMainForm.h
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2012, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, Christian Schoenebeck     Copyright (C) 2007, 2008 Christian Schoenebeck
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 25  Line 25 
25    
26  #include "ui_qsamplerMainForm.h"  #include "ui_qsamplerMainForm.h"
27    
28  #include "qsamplerMessages.h"  #include <lscp/client.h>
 #include "qsamplerChannelStrip.h"  
 #include "qsamplerInstrumentListForm.h"  
 #include "qsamplerDeviceForm.h"  
29    
 class QWorkspace;  
30  class QProcess;  class QProcess;
31    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 setup(Options* pOptions);
61      lscp_client_t* client();  
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 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();  
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();  
85      void stabilizeForm();          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:  protected slots:
123    
124      void updateRecentFilesMenu();          void updateRecentFilesMenu();
125    
126            // Channel strip activation/selection.
127            void activateStrip(QMdiSubWindow *pMdiSubWindow);
128    
129  protected:  protected:
130      bool queryClose();  
131      void closeEvent(QCloseEvent* pCloseEvent);          bool queryClose();
132      void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);          void closeEvent(QCloseEvent* pCloseEvent);
133      void dropEvent(QDropEvent *pDropEvent);          void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
134      void customEvent(QEvent* pCustomEvent);          void dropEvent(QDropEvent *pDropEvent);
135      bool newSession();          void customEvent(QEvent* pCustomEvent);
136      bool openSession();          bool newSession();
137      bool saveSession(bool bPrompt);          bool openSession();
138      bool closeSession(bool bForce);          bool saveSession(bool bPrompt);
139      bool loadSessionFile(const QString& sFilename);          bool closeSession(bool bForce);
140      bool saveSessionFile(const QString& sFilename);          bool loadSessionFile(const QString& sFilename);
141      void updateSession();          bool saveSessionFile(const QString& sFilename);
142      void updateRecentFiles(const QString& sFilename);          void updateSession();
143      void updateInstrumentNames();          void updateRecentFiles(const QString& sFilename);
144      void updateDisplayFont();          void updateInstrumentNames();
145      void updateDisplayEffect();          void updateDisplayFont();
146      void updateMaxVolume();          void updateDisplayEffect();
147      void updateMessagesFont();          void updateMaxVolume();
148      void updateMessagesLimit();          void updateMessagesFont();
149      void updateMessagesCapture();          void updateMessagesLimit();
150      void startSchedule(int iStartDelay);          void updateMessagesCapture();
151      void stopSchedule();          void updateViewMidiDeviceStatusMenu();
152      void startServer();          void updateAllChannelStrips(bool bRemoveDeadStrips);
153      void stopServer();          void startSchedule(int iStartDelay);
154      bool startClient();          void stopSchedule();
155      void stopClient();          void startServer();
156            void stopServer(bool bInteractive = false);
157            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      QList<ChannelStrip *> m_changedStrips;          int m_iStartDelay;
175      InstrumentListForm *m_pInstrumentListForm;          int m_iTimerDelay;
176      DeviceForm *m_pDeviceForm;          int m_iTimerSlot;
177      static MainForm *g_pMainForm;          QLabel *m_statusItem[5];
178      QSlider *m_pVolumeSlider;          QList<ChannelStrip *> m_changedStrips;
179      QSpinBox *m_pVolumeSpinBox;          InstrumentListForm *m_pInstrumentListForm;
180      int m_iVolumeChanging;          DeviceForm *m_pDeviceForm;
181            static MainForm *g_pMainForm;
182  private slots:          QSlider *m_pVolumeSlider;
183      void fileNew();          QSpinBox *m_pVolumeSpinBox;
184      void fileOpen();          int m_iVolumeChanging;
     void fileOpenRecent();  
     void fileSave();  
     void fileSaveAs();  
     void fileReset();  
     void fileRestart();  
     void fileExit();  
     void editAddChannel();  
     void editRemoveChannel();  
     void editSetupChannel();  
     void editEditChannel();  
     void editResetChannel();  
     void editResetAllChannels();  
     void viewMenubar(bool bOn);  
     void viewToolbar(bool bOn);  
     void viewStatusbar(bool bOn);  
     void viewMessages(bool bOn);  
     void viewInstruments();  
     void viewDevices();  
     void viewOptions();  
     void channelsArrange();  
     void channelsAutoArrange(bool bOn);  
     void helpAboutQt();  
     void helpAbout();  
     void volumeChanged(int iVolume);  
     void channelStripChanged(ChannelStrip *pChannelStrip);  
     void channelsMenuAboutToShow();  
     void channelsMenuActivated();  
     void timerSlot();  
     void readServerStdout();  
     void processServerExit();  
185  };  };
186    
187  } // namespace QSampler  } // namespace QSampler

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

  ViewVC Help
Powered by ViewVC