/[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 2112 by capela, Wed Jul 21 18:33:25 2010 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-2010, 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 QWorkspace;
32    class QSocketNotifier;
33    class QSpinBox;
34    class QSlider;
35    class QLabel;
36    
37  namespace QSampler {  namespace QSampler {
38    
39    class Options;
40    class Messages;
41    class Channel;
42    class ChannelStrip;
43  class DeviceForm;  class DeviceForm;
44    class InstrumentListForm;
45    
46    //-------------------------------------------------------------------------
47    // QSampler::MainForm -- Main window form implementation.
48    //
49    
50    class MainForm : public QMainWindow
51    {
52            Q_OBJECT
53    
 class MainForm : public QMainWindow {  
 Q_OBJECT  
54  public:  public:
55      MainForm(QWidget* parent = 0);  
56     ~MainForm();          MainForm(QWidget *pParent = NULL);
57      void setup(qsamplerOptions* pOptions);          ~MainForm();
58      void contextMenuEvent(QContextMenuEvent *pEvent);  
59      qsamplerOptions* options();          void setup(Options* pOptions);
60      lscp_client_t* client();  
61      QString sessionName(const QString& sFilename);          Options* options() const;
62      void appendMessages(const QString& s);          lscp_client_t* client() const;
63      void appendMessagesColor(const QString& s, const QString& c);  
64      void appendMessagesText(const QString& s);          QString sessionName(const QString& sFilename);
65      void appendMessagesError(const QString& s);  
66      void appendMessagesClient(const QString& s);          void appendMessages(const QString& s);
67      ChannelStrip* createChannelStrip(qsamplerChannel *pChannel);          void appendMessagesColor(const QString& s, const QString& c);
68      ChannelStrip* activeChannelStrip();          void appendMessagesText(const QString& s);
69      ChannelStrip* channelStripAt(int iChannel);          void appendMessagesError(const QString& s);
70      ChannelStrip* channelStrip(int iChannelID);          void appendMessagesClient(const QString& s);
71      static MainForm* getInstance();  
72            ChannelStrip* createChannelStrip(Channel *pChannel);
73            void destroyChannelStrip(ChannelStrip* pChannelStrip);
74            ChannelStrip* activeChannelStrip();
75            ChannelStrip* channelStripAt(int iChannel);
76            ChannelStrip* channelStrip(int iChannelID);
77    
78            void contextMenuEvent(QContextMenuEvent *pEvent);
79    
80            static MainForm* getInstance();
81    
82  public slots:  public slots:
83      void sessionDirty();  
84      void stabilizeForm();          void fileNew();
85            void fileOpen();
86            void fileOpenRecent();
87            void fileSave();
88            void fileSaveAs();
89            void fileReset();
90            void fileRestart();
91            void fileExit();
92            void editAddChannel();
93            void editRemoveChannel();
94            void editSetupChannel();
95            void editEditChannel();
96            void editResetChannel();
97            void editResetAllChannels();
98            void viewMenubar(bool bOn);
99            void viewToolbar(bool bOn);
100            void viewStatusbar(bool bOn);
101            void viewMessages(bool bOn);
102            void viewInstruments();
103            void viewDevices();
104            void viewOptions();
105            void channelsArrange();
106            void channelsAutoArrange(bool bOn);
107            void helpAboutQt();
108            void helpAbout();
109            void volumeChanged(int iVolume);
110            void channelStripChanged(ChannelStrip *pChannelStrip);
111            void channelsMenuAboutToShow();
112            void channelsMenuActivated();
113            void timerSlot();
114            void readServerStdout();
115            void processServerExit();
116            void sessionDirty();
117            void stabilizeForm();
118    
119            void handle_sigusr1();
120    
121  protected slots:  protected slots:
122    
123      void updateRecentFilesMenu();          void updateRecentFilesMenu();
124    
125            // Channel strip activation/selection.
126            void activateStrip(QWidget *pWidget);
127    
128  protected:  protected:
129      bool queryClose();  
130      void closeEvent(QCloseEvent* pCloseEvent);          bool queryClose();
131      void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);          void closeEvent(QCloseEvent* pCloseEvent);
132      void dropEvent(QDropEvent *pDropEvent);          void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
133      void customEvent(QEvent* pCustomEvent);          void dropEvent(QDropEvent *pDropEvent);
134      bool newSession();          void customEvent(QEvent* pCustomEvent);
135      bool openSession();          bool newSession();
136      bool saveSession(bool bPrompt);          bool openSession();
137      bool closeSession(bool bForce);          bool saveSession(bool bPrompt);
138      bool loadSessionFile(const QString& sFilename);          bool closeSession(bool bForce);
139      bool saveSessionFile(const QString& sFilename);          bool loadSessionFile(const QString& sFilename);
140      void updateSession();          bool saveSessionFile(const QString& sFilename);
141      void updateRecentFiles(const QString& sFilename);          void updateSession();
142      void updateInstrumentNames();          void updateRecentFiles(const QString& sFilename);
143      void updateDisplayFont();          void updateInstrumentNames();
144      void updateDisplayEffect();          void updateDisplayFont();
145      void updateMaxVolume();          void updateDisplayEffect();
146      void updateMessagesFont();          void updateMaxVolume();
147      void updateMessagesLimit();          void updateMessagesFont();
148      void updateMessagesCapture();          void updateMessagesLimit();
149      void startSchedule(int iStartDelay);          void updateMessagesCapture();
150      void stopSchedule();          void updateViewMidiDeviceStatusMenu();
151      void startServer();          void updateAllChannelStrips(bool bRemoveDeadStrips);
152      void stopServer();          void startSchedule(int iStartDelay);
153      bool startClient();          void stopSchedule();
154      void stopClient();          void startServer();
155            void stopServer(bool bInteractive = false);
156            bool startClient();
157            void stopClient();
158    
159  private:  private:
     Ui::qsamplerMainForm ui;  
160    
161      qsamplerOptions *m_pOptions;          Ui::qsamplerMainForm m_ui;
162      qsamplerMessages *m_pMessages;  
163      QWorkspace *m_pWorkspace;          Options *m_pOptions;
164      QString m_sFilename;          Messages *m_pMessages;
165      int m_iUntitled;          QWorkspace *m_pWorkspace;
166      int m_iDirtyCount;          QSocketNotifier *m_pUsr1Notifier;
167      lscp_client_t *m_pClient;          QString m_sFilename;
168      QProcess *m_pServer;          int m_iUntitled;
169      int m_iStartDelay;          int m_iDirtyCount;
170      int m_iTimerDelay;          lscp_client_t *m_pClient;
171      int m_iTimerSlot;          QProcess *m_pServer;
172      QLabel *m_statusItem[5];          bool bForceServerStop;
173      QList<ChannelStrip *> m_changedStrips;          int m_iStartDelay;
174      InstrumentListForm *m_pInstrumentListForm;          int m_iTimerDelay;
175      DeviceForm *m_pDeviceForm;          int m_iTimerSlot;
176      static MainForm *g_pMainForm;          QLabel *m_statusItem[5];
177      QSlider *m_pVolumeSlider;          QList<ChannelStrip *> m_changedStrips;
178      QSpinBox *m_pVolumeSpinBox;          InstrumentListForm *m_pInstrumentListForm;
179      int m_iVolumeChanging;          DeviceForm *m_pDeviceForm;
180            static MainForm *g_pMainForm;
181  private slots:          QSlider *m_pVolumeSlider;
182      void fileNew();          QSpinBox *m_pVolumeSpinBox;
183      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();  
184  };  };
185    
186  } // namespace QSampler  } // namespace QSampler

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

  ViewVC Help
Powered by ViewVC