/[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 1698 by schoenebeck, Sat Feb 16 19:41:05 2008 UTC
# Line 2  Line 2 
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2007, 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            ChannelStrip* activeChannelStrip();
73            ChannelStrip* channelStripAt(int iChannel);
74            ChannelStrip* channelStrip(int iChannelID);
75    
76            void contextMenuEvent(QContextMenuEvent *pEvent);
77    
78            static MainForm* getInstance();
79    
80  public slots:  public slots:
81      void sessionDirty();  
82      void stabilizeForm();          void fileNew();
83            void fileOpen();
84            void fileOpenRecent();
85            void fileSave();
86            void fileSaveAs();
87            void fileReset();
88            void fileRestart();
89            void fileExit();
90            void editAddChannel();
91            void editRemoveChannel();
92            void editSetupChannel();
93            void editEditChannel();
94            void editResetChannel();
95            void editResetAllChannels();
96            void viewMenubar(bool bOn);
97            void viewToolbar(bool bOn);
98            void viewStatusbar(bool bOn);
99            void viewMessages(bool bOn);
100            void viewInstruments();
101            void viewDevices();
102            void viewOptions();
103            void channelsArrange();
104            void channelsAutoArrange(bool bOn);
105            void helpAboutQt();
106            void helpAbout();
107            void volumeChanged(int iVolume);
108            void channelStripChanged(ChannelStrip *pChannelStrip);
109            void channelsMenuAboutToShow();
110            void channelsMenuActivated();
111            void timerSlot();
112            void readServerStdout();
113            void processServerExit();
114            void sessionDirty();
115            void stabilizeForm();
116    
117  protected slots:  protected slots:
118    
119      void updateRecentFilesMenu();          void updateRecentFilesMenu();
120    
121            // Channel strip activation/selection.
122            void activateStrip(QWidget *pWidget);
123    
124  protected:  protected:
125      bool queryClose();  
126      void closeEvent(QCloseEvent* pCloseEvent);          bool queryClose();
127      void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);          void closeEvent(QCloseEvent* pCloseEvent);
128      void dropEvent(QDropEvent *pDropEvent);          void dragEnterEvent(QDragEnterEvent *pDragEnterEvent);
129      void customEvent(QEvent* pCustomEvent);          void dropEvent(QDropEvent *pDropEvent);
130      bool newSession();          void customEvent(QEvent* pCustomEvent);
131      bool openSession();          bool newSession();
132      bool saveSession(bool bPrompt);          bool openSession();
133      bool closeSession(bool bForce);          bool saveSession(bool bPrompt);
134      bool loadSessionFile(const QString& sFilename);          bool closeSession(bool bForce);
135      bool saveSessionFile(const QString& sFilename);          bool loadSessionFile(const QString& sFilename);
136      void updateSession();          bool saveSessionFile(const QString& sFilename);
137      void updateRecentFiles(const QString& sFilename);          void updateSession();
138      void updateInstrumentNames();          void updateRecentFiles(const QString& sFilename);
139      void updateDisplayFont();          void updateInstrumentNames();
140      void updateDisplayEffect();          void updateDisplayFont();
141      void updateMaxVolume();          void updateDisplayEffect();
142      void updateMessagesFont();          void updateMaxVolume();
143      void updateMessagesLimit();          void updateMessagesFont();
144      void updateMessagesCapture();          void updateMessagesLimit();
145      void startSchedule(int iStartDelay);          void updateMessagesCapture();
146      void stopSchedule();          void updateViewMidiDeviceStatusMenu();
147      void startServer();          void startSchedule(int iStartDelay);
148      void stopServer();          void stopSchedule();
149      bool startClient();          void startServer();
150      void stopClient();          void stopServer(bool bInteractive = false);
151            bool startClient();
152            void stopClient();
153    
154  private:  private:
     Ui::qsamplerMainForm ui;  
155    
156      qsamplerOptions *m_pOptions;          Ui::qsamplerMainForm m_ui;
157      qsamplerMessages *m_pMessages;  
158      QWorkspace *m_pWorkspace;          Options *m_pOptions;
159      QString m_sFilename;          Messages *m_pMessages;
160      int m_iUntitled;          QWorkspace *m_pWorkspace;
161      int m_iDirtyCount;          QString m_sFilename;
162      lscp_client_t *m_pClient;          int m_iUntitled;
163      QProcess *m_pServer;          int m_iDirtyCount;
164      int m_iStartDelay;          lscp_client_t *m_pClient;
165      int m_iTimerDelay;          QProcess *m_pServer;
166      int m_iTimerSlot;          bool bForceServerStop;
167      QLabel *m_statusItem[5];          int m_iStartDelay;
168      QList<ChannelStrip *> m_changedStrips;          int m_iTimerDelay;
169      InstrumentListForm *m_pInstrumentListForm;          int m_iTimerSlot;
170      DeviceForm *m_pDeviceForm;          QLabel *m_statusItem[5];
171      static MainForm *g_pMainForm;          QList<ChannelStrip *> m_changedStrips;
172      QSlider *m_pVolumeSlider;          InstrumentListForm *m_pInstrumentListForm;
173      QSpinBox *m_pVolumeSpinBox;          DeviceForm *m_pDeviceForm;
174      int m_iVolumeChanging;          static MainForm *g_pMainForm;
175            QSlider *m_pVolumeSlider;
176  private slots:          QSpinBox *m_pVolumeSpinBox;
177      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();  
178  };  };
179    
180  } // namespace QSampler  } // namespace QSampler

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

  ViewVC Help
Powered by ViewVC