/[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 1465 by capela, Thu Nov 1 17:49:27 2007 UTC revision 2978 by capela, Mon Aug 15 19:10:16 2016 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-2016, 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 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);          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 contextMenuEvent(QContextMenuEvent *pEvent);
80    
81            static MainForm* getInstance();
82    
83  public slots:  public slots:
84      void sessionDirty(void);  
85      void stabilizeForm(void);          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:
123    
124            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(void);  
134      void closeEvent(QCloseEvent* pCloseEvent);          void addChannelStrip();
135      bool decodeDragFiles(const QMimeSource* pEvent, QStringList& files);          void removeChannelStrip();
136      void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);  
137      void dropEvent(QDropEvent *pDropEvent);          bool queryClose();
138      void customEvent(QEvent* pCustomEvent);          void closeEvent(QCloseEvent* pCloseEvent);
139      bool newSession(void);          void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
140      bool openSession(void);          void dropEvent(QDropEvent *pDropEvent);
141      bool saveSession(bool bPrompt);          void customEvent(QEvent *pCustomEvent);
142      bool closeSession(bool bForce);          void resizeEvent(QResizeEvent *);
143      bool loadSessionFile(const QString& sFilename);          bool newSession();
144      bool saveSessionFile(const QString& sFilename);          bool openSession();
145      void updateSession();          bool saveSession(bool bPrompt);
146      void updateRecentFiles(const QString& sFilename);          bool closeSession(bool bForce);
147      void updateRecentFilesMenu(void);          bool loadSessionFile(const QString& sFilename);
148      void updateInstrumentNames(void);          bool saveSessionFile(const QString& sFilename);
149      void updateDisplayFont(void);          void updateSession();
150      void updateDisplayEffect(void);          void updateRecentFiles(const QString& sFilename);
151      void updateMaxVolume(void);          void updateInstrumentNames();
152      void updateMessagesFont(void);          void updateDisplayFont();
153      void updateMessagesLimit(void);          void updateDisplayEffect();
154      void updateMessagesCapture(void);          void updateMaxVolume();
155      void startSchedule(int iStartDelay);          void updateMessagesFont();
156      void stopSchedule(void);          void updateMessagesLimit();
157      void startServer(void);          void updateMessagesCapture();
158      void stopServer(void);          void updateViewMidiDeviceStatusMenu();
159      bool startClient(void);          void updateAllChannelStrips(bool bRemoveDeadStrips);
160      void stopClient(void);          void startSchedule(int iStartDelay);
161            void stopSchedule();
162            void startServer();
163            void stopServer(bool bInteractive = false);
164            bool startClient();
165            void stopClient();
166    
167  private:  private:
     Ui::qsamplerMainForm ui;  
168    
169      qsamplerOptions *m_pOptions;          Ui::qsamplerMainForm m_ui;
170      qsamplerMessages *m_pMessages;  
171      QWorkspace *m_pWorkspace;          Options *m_pOptions;
172      QString m_sFilename;          Messages *m_pMessages;
173      int m_iUntitled;          QMdiArea *m_pWorkspace;
174      int m_iDirtyCount;          QSocketNotifier *m_pUsr1Notifier;
175      lscp_client_t *m_pClient;          QString m_sFilename;
176      QProcess *m_pServer;          int m_iUntitled;
177      int m_iStartDelay;          int m_iDirtySetup;
178      int m_iTimerDelay;          int m_iDirtyCount;
179      int m_iTimerSlot;          lscp_client_t *m_pClient;
180      QLabel *m_statusItem[5];          QProcess *m_pServer;
181      QMenu *m_pRecentFilesMenu;          bool bForceServerStop;
182      Q3PtrList<ChannelStrip> m_changedStrips;          int m_iStartDelay;
183      InstrumentListForm *m_pInstrumentListForm;          int m_iTimerDelay;
184      DeviceForm *m_pDeviceForm;          int m_iTimerSlot;
185      static MainForm *g_pMainForm;          QLabel *m_statusItem[5];
186      QSlider *m_pVolumeSlider;          QList<ChannelStrip *> m_changedStrips;
187      QSpinBox *m_pVolumeSpinBox;          InstrumentListForm *m_pInstrumentListForm;
188      int m_iVolumeChanging;          DeviceForm *m_pDeviceForm;
189      QToolBar* fileToolbar;          static MainForm *g_pMainForm;
190      QToolBar* editToolbar;          QSlider *m_pVolumeSlider;
191      QToolBar* channelsToolbar;          QSpinBox *m_pVolumeSpinBox;
192            int m_iVolumeChanging;
 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);  
193  };  };
194    
195  } // namespace QSampler  } // namespace QSampler

Legend:
Removed from v.1465  
changed lines
  Added in v.2978

  ViewVC Help
Powered by ViewVC