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

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

  ViewVC Help
Powered by ViewVC