/[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 3788 by capela, Thu Jun 11 16:59:09 2020 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-2020, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, Christian Schoenebeck     Copyright (C) 2007-2019 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 QMdiSubWindow;
32    class QSocketNotifier;
33    class QSpinBox;
34    class QSlider;
35    class QLabel;
36    
37  namespace QSampler {  namespace QSampler {
38    
39    class Workspace;
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 = nullptr);
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 QColor& rgb);
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 channelsArrangeAuto();
80            void contextMenuEvent(QContextMenuEvent *pEvent);
81            void sessionDirty();
82    
83            static MainForm *getInstance();
84    
85  public slots:  public slots:
86      void sessionDirty();  
87      void stabilizeForm();          void fileNew();
88            void fileOpen();
89            void fileOpenRecent();
90            void fileSave();
91            void fileSaveAs();
92            void fileReset();
93            void fileRestart();
94            void fileExit();
95            void editAddChannel();
96            void editRemoveChannel();
97            void editSetupChannel();
98            void editEditChannel();
99            void editResetChannel();
100            void editResetAllChannels();
101            void viewMenubar(bool bOn);
102            void viewToolbar(bool bOn);
103            void viewStatusbar(bool bOn);
104            void viewMessages(bool bOn);
105            void viewInstruments();
106            void viewDevices();
107            void viewOptions();
108            void channelsArrange();
109            void channelsAutoArrange(bool bOn);
110            void helpAboutQt();
111            void helpAbout();
112    
113            void stabilizeForm();
114    
115  protected slots:  protected slots:
116    
117      void updateRecentFilesMenu();          void updateRecentFilesMenu();
118    
119            void volumeChanged(int iVolume);
120            void channelStripChanged(ChannelStrip *pChannelStrip);
121            void channelsMenuAboutToShow();
122            void channelsMenuActivated();
123            void timerSlot();
124            void readServerStdout();
125            void processServerExit();
126            void autoReconnectClient();
127    
128            void handle_sigusr1();
129            void handle_sigterm();
130    
131            // Channel strip activation/selection.
132            void activateStrip(QMdiSubWindow *pMdiSubWindow);
133    
134            // Channel toolbar orientation change.
135            void channelsToolbarOrientation(Qt::Orientation orientation);
136    
137  protected:  protected:
138      bool queryClose();  
139      void closeEvent(QCloseEvent* pCloseEvent);          void addChannelStrip();
140      void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);          void removeChannelStrip();
141      void dropEvent(QDropEvent *pDropEvent);  
142      void customEvent(QEvent* pCustomEvent);          bool queryClose();
143      bool newSession();          void closeEvent(QCloseEvent* pCloseEvent);
144      bool openSession();          void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
145      bool saveSession(bool bPrompt);          void dropEvent(QDropEvent *pDropEvent);
146      bool closeSession(bool bForce);          void customEvent(QEvent *pCustomEvent);
147      bool loadSessionFile(const QString& sFilename);          bool newSession();
148      bool saveSessionFile(const QString& sFilename);          bool openSession();
149      void updateSession();          bool saveSession(bool bPrompt);
150      void updateRecentFiles(const QString& sFilename);          bool closeSession(bool bForce);
151      void updateInstrumentNames();          bool loadSessionFile(const QString& sFilename);
152      void updateDisplayFont();          bool saveSessionFile(const QString& sFilename);
153      void updateDisplayEffect();          void updateSession();
154      void updateMaxVolume();          void updateRecentFiles(const QString& sFilename);
155      void updateMessagesFont();          void updateInstrumentNames();
156      void updateMessagesLimit();          void updateDisplayFont();
157      void updateMessagesCapture();          void updateDisplayEffect();
158      void startSchedule(int iStartDelay);          void updateMaxVolume();
159      void stopSchedule();          void updateMessagesFont();
160      void startServer();          void updateMessagesLimit();
161      void stopServer();          void updateMessagesCapture();
162      bool startClient();          void updateViewMidiDeviceStatusMenu();
163      void stopClient();          void updateAllChannelStrips(bool bRemoveDeadStrips);
164    
165            void startSchedule(int iStartDelay);
166            void stopSchedule();
167            void startServer();
168            void stopServer(bool bInteractive = false);
169            bool startClient(bool bReconnectOnly = false);
170            void stopClient();
171            void startAutoReconnectClient();
172    
173  private:  private:
     Ui::qsamplerMainForm ui;  
174    
175      qsamplerOptions *m_pOptions;          Ui::qsamplerMainForm m_ui;
176      qsamplerMessages *m_pMessages;  
177      QWorkspace *m_pWorkspace;          Options *m_pOptions;
178      QString m_sFilename;          Messages *m_pMessages;
179      int m_iUntitled;          Workspace *m_pWorkspace;
180      int m_iDirtyCount;          QSocketNotifier *m_pSigusr1Notifier;
181      lscp_client_t *m_pClient;          QSocketNotifier *m_pSigtermNotifier;
182      QProcess *m_pServer;          QString m_sFilename;
183      int m_iStartDelay;          int m_iUntitled;
184      int m_iTimerDelay;          int m_iDirtySetup;
185      int m_iTimerSlot;          int m_iDirtyCount;
186      QLabel *m_statusItem[5];          lscp_client_t *m_pClient;
187      QList<ChannelStrip *> m_changedStrips;          QProcess *m_pServer;
188      InstrumentListForm *m_pInstrumentListForm;          bool m_bForceServerStop;
189      DeviceForm *m_pDeviceForm;          int m_iStartDelay;
190      static MainForm *g_pMainForm;          int m_iTimerDelay;
191      QSlider *m_pVolumeSlider;          int m_iTimerSlot;
192      QSpinBox *m_pVolumeSpinBox;          QLabel *m_statusItem[5];
193      int m_iVolumeChanging;          QList<ChannelStrip *> m_changedStrips;
194            InstrumentListForm *m_pInstrumentListForm;
195  private slots:          DeviceForm *m_pDeviceForm;
196      void fileNew();          static MainForm *g_pMainForm;
197      void fileOpen();          QSlider *m_pVolumeSlider;
198      void fileOpenRecent();          QSpinBox *m_pVolumeSpinBox;
199      void fileSave();          int m_iVolumeChanging;
     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();  
200  };  };
201    
202  } // namespace QSampler  } // namespace QSampler

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

  ViewVC Help
Powered by ViewVC