/[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 2681 by capela, Wed Dec 24 14:23:06 2014 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-2014, 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            // Channel toolbar orientation change.
130            void channelsToolbarOrientation(Qt::Orientation orientation);
131    
132  protected:  protected:
133      bool queryClose();  
134      void closeEvent(QCloseEvent* pCloseEvent);          bool queryClose();
135      void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);          void closeEvent(QCloseEvent* pCloseEvent);
136      void dropEvent(QDropEvent *pDropEvent);          void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
137      void customEvent(QEvent* pCustomEvent);          void dropEvent(QDropEvent *pDropEvent);
138      bool newSession();          void customEvent(QEvent* pCustomEvent);
139      bool openSession();          bool newSession();
140      bool saveSession(bool bPrompt);          bool openSession();
141      bool closeSession(bool bForce);          bool saveSession(bool bPrompt);
142      bool loadSessionFile(const QString& sFilename);          bool closeSession(bool bForce);
143      bool saveSessionFile(const QString& sFilename);          bool loadSessionFile(const QString& sFilename);
144      void updateSession();          bool saveSessionFile(const QString& sFilename);
145      void updateRecentFiles(const QString& sFilename);          void updateSession();
146      void updateInstrumentNames();          void updateRecentFiles(const QString& sFilename);
147      void updateDisplayFont();          void updateInstrumentNames();
148      void updateDisplayEffect();          void updateDisplayFont();
149      void updateMaxVolume();          void updateDisplayEffect();
150      void updateMessagesFont();          void updateMaxVolume();
151      void updateMessagesLimit();          void updateMessagesFont();
152      void updateMessagesCapture();          void updateMessagesLimit();
153      void startSchedule(int iStartDelay);          void updateMessagesCapture();
154      void stopSchedule();          void updateViewMidiDeviceStatusMenu();
155      void startServer();          void updateAllChannelStrips(bool bRemoveDeadStrips);
156      void stopServer();          void startSchedule(int iStartDelay);
157      bool startClient();          void stopSchedule();
158      void stopClient();          void startServer();
159            void stopServer(bool bInteractive = false);
160            bool startClient();
161            void stopClient();
162    
163  private:  private:
     Ui::qsamplerMainForm ui;  
164    
165      qsamplerOptions *m_pOptions;          Ui::qsamplerMainForm m_ui;
166      qsamplerMessages *m_pMessages;  
167      QWorkspace *m_pWorkspace;          Options *m_pOptions;
168      QString m_sFilename;          Messages *m_pMessages;
169      int m_iUntitled;          QMdiArea *m_pWorkspace;
170      int m_iDirtyCount;          QSocketNotifier *m_pUsr1Notifier;
171      lscp_client_t *m_pClient;          QString m_sFilename;
172      QProcess *m_pServer;          int m_iUntitled;
173      int m_iStartDelay;          int m_iDirtyCount;
174      int m_iTimerDelay;          lscp_client_t *m_pClient;
175      int m_iTimerSlot;          QProcess *m_pServer;
176      QLabel *m_statusItem[5];          bool bForceServerStop;
177      QList<ChannelStrip *> m_changedStrips;          int m_iStartDelay;
178      InstrumentListForm *m_pInstrumentListForm;          int m_iTimerDelay;
179      DeviceForm *m_pDeviceForm;          int m_iTimerSlot;
180      static MainForm *g_pMainForm;          QLabel *m_statusItem[5];
181      QSlider *m_pVolumeSlider;          QList<ChannelStrip *> m_changedStrips;
182      QSpinBox *m_pVolumeSpinBox;          InstrumentListForm *m_pInstrumentListForm;
183      int m_iVolumeChanging;          DeviceForm *m_pDeviceForm;
184            static MainForm *g_pMainForm;
185  private slots:          QSlider *m_pVolumeSlider;
186      void fileNew();          QSpinBox *m_pVolumeSpinBox;
187      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();  
188  };  };
189    
190  } // namespace QSampler  } // namespace QSampler

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

  ViewVC Help
Powered by ViewVC