/[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 1466 by capela, Thu Nov 1 19:25:10 2007 UTC revision 3508 by capela, Mon Apr 1 22:36:26 2019 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-2019, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, Christian Schoenebeck     Copyright (C) 2007,2008,2015 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 23  Line 23 
23  #ifndef __qsamplerMainForm_h  #ifndef __qsamplerMainForm_h
24  #define __qsamplerMainForm_h  #define __qsamplerMainForm_h
25    
 #include <Qt3Support>  
   
 #include <QWorkspace>  
 #include <QList>  
 #include <Q3PtrList>  
 #include <QProcess>  
 #include <QMenu>  
   
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 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 = 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& sText);
68      ChannelStrip* createChannelStrip(qsamplerChannel *pChannel);          void appendMessagesColor(const QString& sText, const QString& sColor);
69      ChannelStrip* activeChannelStrip(void);          void appendMessagesText(const QString& sText);
70      ChannelStrip* channelStripAt(int iChannel);          void appendMessagesError(const QString& sText);
71      ChannelStrip* channelStrip(int iChannelID);          void appendMessagesClient(const QString& sText);
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 channelsArrangeAuto();
80            void contextMenuEvent(QContextMenuEvent *pEvent);
81            void sessionDirty();
82    
83            static MainForm *getInstance();
84    
85  public slots:  public slots:
86      void sessionDirty(void);  
87      void stabilizeForm(void);          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:
116    
117            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    
127            void handle_sigusr1();
128            void handle_sigterm();
129    
130            // Channel strip activation/selection.
131            void activateStrip(QMdiSubWindow *pMdiSubWindow);
132    
133            // Channel toolbar orientation change.
134            void channelsToolbarOrientation(Qt::Orientation orientation);
135    
136  protected:  protected:
137      bool queryClose(void);  
138      void closeEvent(QCloseEvent* pCloseEvent);          void addChannelStrip();
139      bool decodeDragFiles(const QMimeSource* pEvent, QStringList& files);          void removeChannelStrip();
140      void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);  
141      void dropEvent(QDropEvent *pDropEvent);          bool queryClose();
142      void customEvent(QEvent* pCustomEvent);          void closeEvent(QCloseEvent* pCloseEvent);
143      bool newSession(void);          void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
144      bool openSession(void);          void dropEvent(QDropEvent *pDropEvent);
145      bool saveSession(bool bPrompt);          void customEvent(QEvent *pCustomEvent);
146      bool closeSession(bool bForce);          bool newSession();
147      bool loadSessionFile(const QString& sFilename);          bool openSession();
148      bool saveSessionFile(const QString& sFilename);          bool saveSession(bool bPrompt);
149      void updateSession();          bool closeSession(bool bForce);
150      void updateRecentFiles(const QString& sFilename);          bool loadSessionFile(const QString& sFilename);
151      void updateRecentFilesMenu(void);          bool saveSessionFile(const QString& sFilename);
152      void updateInstrumentNames(void);          void updateSession();
153      void updateDisplayFont(void);          void updateRecentFiles(const QString& sFilename);
154      void updateDisplayEffect(void);          void updateInstrumentNames();
155      void updateMaxVolume(void);          void updateDisplayFont();
156      void updateMessagesFont(void);          void updateDisplayEffect();
157      void updateMessagesLimit(void);          void updateMaxVolume();
158      void updateMessagesCapture(void);          void updateMessagesFont();
159      void startSchedule(int iStartDelay);          void updateMessagesLimit();
160      void stopSchedule(void);          void updateMessagesCapture();
161      void startServer(void);          void updateViewMidiDeviceStatusMenu();
162      void stopServer(void);          void updateAllChannelStrips(bool bRemoveDeadStrips);
163      bool startClient(void);  
164      void stopClient(void);          void startSchedule(int iStartDelay);
165            void stopSchedule();
166            void startServer();
167            void stopServer(bool bInteractive = false);
168            bool startClient();
169            void stopClient();
170    
171  private:  private:
     Ui::qsamplerMainForm ui;  
172    
173      qsamplerOptions *m_pOptions;          Ui::qsamplerMainForm m_ui;
174      qsamplerMessages *m_pMessages;  
175      QWorkspace *m_pWorkspace;          Options *m_pOptions;
176      QString m_sFilename;          Messages *m_pMessages;
177      int m_iUntitled;          Workspace *m_pWorkspace;
178      int m_iDirtyCount;          QSocketNotifier *m_pSigusr1Notifier;
179      lscp_client_t *m_pClient;          QSocketNotifier *m_pSigtermNotifier;
180      QProcess *m_pServer;          QString m_sFilename;
181      int m_iStartDelay;          int m_iUntitled;
182      int m_iTimerDelay;          int m_iDirtySetup;
183      int m_iTimerSlot;          int m_iDirtyCount;
184      QLabel *m_statusItem[5];          lscp_client_t *m_pClient;
185      QMenu *m_pRecentFilesMenu;          QProcess *m_pServer;
186      Q3PtrList<ChannelStrip> m_changedStrips;          bool m_bForceServerStop;
187      InstrumentListForm *m_pInstrumentListForm;          int m_iStartDelay;
188      DeviceForm *m_pDeviceForm;          int m_iTimerDelay;
189      static MainForm *g_pMainForm;          int m_iTimerSlot;
190      QSlider *m_pVolumeSlider;          QLabel *m_statusItem[5];
191      QSpinBox *m_pVolumeSpinBox;          QList<ChannelStrip *> m_changedStrips;
192      int m_iVolumeChanging;          InstrumentListForm *m_pInstrumentListForm;
193            DeviceForm *m_pDeviceForm;
194  private slots:          static MainForm *g_pMainForm;
195      void fileNew(void);          QSlider *m_pVolumeSlider;
196      void fileOpen(void);          QSpinBox *m_pVolumeSpinBox;
197      void fileOpenRecent(int iIndex);          int m_iVolumeChanging;
     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);  
198  };  };
199    
200  } // namespace QSampler  } // namespace QSampler

Legend:
Removed from v.1466  
changed lines
  Added in v.3508

  ViewVC Help
Powered by ViewVC