--- qsampler/trunk/src/qsamplerMainForm.h 2007/11/20 16:48:04 1499 +++ qsampler/trunk/src/qsamplerMainForm.h 2007/11/22 11:10:44 1509 @@ -38,119 +38,130 @@ class DeviceForm; -class MainForm : public QMainWindow { -Q_OBJECT +class MainForm : public QMainWindow +{ + Q_OBJECT + public: - MainForm(QWidget* parent = 0); - ~MainForm(); - void setup(qsamplerOptions* pOptions); - void contextMenuEvent(QContextMenuEvent *pEvent); - qsamplerOptions* options(); - lscp_client_t* client(); - QString sessionName(const QString& sFilename); - void appendMessages(const QString& s); - void appendMessagesColor(const QString& s, const QString& c); - void appendMessagesText(const QString& s); - void appendMessagesError(const QString& s); - void appendMessagesClient(const QString& s); - ChannelStrip* createChannelStrip(qsamplerChannel *pChannel); - ChannelStrip* activeChannelStrip(); - ChannelStrip* channelStripAt(int iChannel); - ChannelStrip* channelStrip(int iChannelID); - static MainForm* getInstance(); + + MainForm(QWidget *pParent = NULL); + ~MainForm(); + + void setup(qsamplerOptions* pOptions); + + qsamplerOptions* options() const; + lscp_client_t* client() const; + + QString sessionName(const QString& sFilename); + + void appendMessages(const QString& s); + void appendMessagesColor(const QString& s, const QString& c); + void appendMessagesText(const QString& s); + void appendMessagesError(const QString& s); + void appendMessagesClient(const QString& s); + + ChannelStrip* createChannelStrip(qsamplerChannel *pChannel); + ChannelStrip* activeChannelStrip(); + ChannelStrip* channelStripAt(int iChannel); + ChannelStrip* channelStrip(int iChannelID); + + void contextMenuEvent(QContextMenuEvent *pEvent); + + static MainForm* getInstance(); public slots: - void sessionDirty(); - void stabilizeForm(); + + void fileNew(); + 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(); + void sessionDirty(); + void stabilizeForm(); protected slots: - void updateRecentFilesMenu(); + void updateRecentFilesMenu(); protected: - bool queryClose(); - void closeEvent(QCloseEvent* pCloseEvent); - void dragEnterEvent(QDragEnterEvent *pDragEnterEvent); - void dropEvent(QDropEvent *pDropEvent); - void customEvent(QEvent* pCustomEvent); - bool newSession(); - bool openSession(); - bool saveSession(bool bPrompt); - bool closeSession(bool bForce); - bool loadSessionFile(const QString& sFilename); - bool saveSessionFile(const QString& sFilename); - void updateSession(); - void updateRecentFiles(const QString& sFilename); - void updateInstrumentNames(); - void updateDisplayFont(); - void updateDisplayEffect(); - void updateMaxVolume(); - void updateMessagesFont(); - void updateMessagesLimit(); - void updateMessagesCapture(); - void startSchedule(int iStartDelay); - void stopSchedule(); - void startServer(); - void stopServer(); - bool startClient(); - void stopClient(); + + bool queryClose(); + void closeEvent(QCloseEvent* pCloseEvent); + void dragEnterEvent(QDragEnterEvent *pDragEnterEvent); + void dropEvent(QDropEvent *pDropEvent); + void customEvent(QEvent* pCustomEvent); + bool newSession(); + bool openSession(); + bool saveSession(bool bPrompt); + bool closeSession(bool bForce); + bool loadSessionFile(const QString& sFilename); + bool saveSessionFile(const QString& sFilename); + void updateSession(); + void updateRecentFiles(const QString& sFilename); + void updateInstrumentNames(); + void updateDisplayFont(); + void updateDisplayEffect(); + void updateMaxVolume(); + void updateMessagesFont(); + void updateMessagesLimit(); + void updateMessagesCapture(); + void startSchedule(int iStartDelay); + void stopSchedule(); + void startServer(); + void stopServer(); + bool startClient(); + void stopClient(); private: - Ui::qsamplerMainForm ui; - qsamplerOptions *m_pOptions; - qsamplerMessages *m_pMessages; - QWorkspace *m_pWorkspace; - QString m_sFilename; - int m_iUntitled; - int m_iDirtyCount; - lscp_client_t *m_pClient; - QProcess *m_pServer; - int m_iStartDelay; - int m_iTimerDelay; - int m_iTimerSlot; - QLabel *m_statusItem[5]; - QList m_changedStrips; - InstrumentListForm *m_pInstrumentListForm; - DeviceForm *m_pDeviceForm; - static MainForm *g_pMainForm; - QSlider *m_pVolumeSlider; - QSpinBox *m_pVolumeSpinBox; - int m_iVolumeChanging; - -private slots: - void fileNew(); - 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(); + Ui::qsamplerMainForm m_ui; + + qsamplerOptions *m_pOptions; + qsamplerMessages *m_pMessages; + QWorkspace *m_pWorkspace; + QString m_sFilename; + int m_iUntitled; + int m_iDirtyCount; + lscp_client_t *m_pClient; + QProcess *m_pServer; + int m_iStartDelay; + int m_iTimerDelay; + int m_iTimerSlot; + QLabel *m_statusItem[5]; + QList m_changedStrips; + InstrumentListForm *m_pInstrumentListForm; + DeviceForm *m_pDeviceForm; + static MainForm *g_pMainForm; + QSlider *m_pVolumeSlider; + QSpinBox *m_pVolumeSpinBox; + int m_iVolumeChanging; }; } // namespace QSampler