--- qsampler/trunk/src/qsamplerMainForm.h 2009/02/19 11:44:57 1840 +++ qsampler/trunk/src/qsamplerMainForm.h 2021/01/07 16:18:02 3849 @@ -1,8 +1,8 @@ // qsamplerMainForm.h // /**************************************************************************** - Copyright (C) 2004-2009, rncbc aka Rui Nuno Capela. All rights reserved. - Copyright (C) 2007, 2008 Christian Schoenebeck + Copyright (C) 2004-2021, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2007-2019 Christian Schoenebeck This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -28,13 +28,15 @@ #include class QProcess; -class QWorkspace; +class QMdiSubWindow; +class QSocketNotifier; class QSpinBox; class QSlider; class QLabel; namespace QSampler { +class Workspace; class Options; class Messages; class Channel; @@ -52,31 +54,33 @@ public: - MainForm(QWidget *pParent = NULL); + MainForm(QWidget *pParent = nullptr); ~MainForm(); - void setup(Options* pOptions); + void setup(Options *pOptions); - Options* options() const; - lscp_client_t* client() const; + Options *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 appendMessagesColor(const QString& s, const QColor& rgb); void appendMessagesText(const QString& s); void appendMessagesError(const QString& s); void appendMessagesClient(const QString& s); - ChannelStrip* createChannelStrip(Channel *pChannel); - void destroyChannelStrip(ChannelStrip* pChannelStrip); - ChannelStrip* activeChannelStrip(); - ChannelStrip* channelStripAt(int iChannel); - ChannelStrip* channelStrip(int iChannelID); + ChannelStrip *createChannelStrip(Channel *pChannel); + void destroyChannelStrip(ChannelStrip *pChannelStrip); + ChannelStrip *activeChannelStrip(); + ChannelStrip *channelStripAt(int iChannel); + ChannelStrip *channelStrip(int iChannelID); + void channelsArrangeAuto(); void contextMenuEvent(QContextMenuEvent *pEvent); + void sessionDirty(); - static MainForm* getInstance(); + static MainForm *getInstance(); public slots: @@ -105,6 +109,13 @@ void channelsAutoArrange(bool bOn); void helpAboutQt(); void helpAbout(); + + void stabilizeForm(); + +protected slots: + + void updateRecentFilesMenu(); + void volumeChanged(int iVolume); void channelStripChanged(ChannelStrip *pChannelStrip); void channelsMenuAboutToShow(); @@ -112,23 +123,27 @@ void timerSlot(); void readServerStdout(); void processServerExit(); - void sessionDirty(); - void stabilizeForm(); - -protected slots: + void autoReconnectClient(); - void updateRecentFilesMenu(); + void handle_sigusr1(); + void handle_sigterm(); // Channel strip activation/selection. - void activateStrip(QWidget *pWidget); + void activateStrip(QMdiSubWindow *pMdiSubWindow); + + // Channel toolbar orientation change. + void channelsToolbarOrientation(Qt::Orientation orientation); protected: + void addChannelStrip(); + void removeChannelStrip(); + bool queryClose(); void closeEvent(QCloseEvent* pCloseEvent); void dragEnterEvent(QDragEnterEvent *pDragEnterEvent); void dropEvent(QDropEvent *pDropEvent); - void customEvent(QEvent* pCustomEvent); + void customEvent(QEvent *pCustomEvent); bool newSession(); bool openSession(); bool saveSession(bool bPrompt); @@ -146,12 +161,14 @@ void updateMessagesCapture(); void updateViewMidiDeviceStatusMenu(); void updateAllChannelStrips(bool bRemoveDeadStrips); + void startSchedule(int iStartDelay); void stopSchedule(); void startServer(); void stopServer(bool bInteractive = false); - bool startClient(); + bool startClient(bool bReconnectOnly = false); void stopClient(); + void startAutoReconnectClient(); private: @@ -159,13 +176,16 @@ Options *m_pOptions; Messages *m_pMessages; - QWorkspace *m_pWorkspace; + Workspace *m_pWorkspace; + QSocketNotifier *m_pSigusr1Notifier; + QSocketNotifier *m_pSigtermNotifier; QString m_sFilename; int m_iUntitled; + int m_iDirtySetup; int m_iDirtyCount; lscp_client_t *m_pClient; QProcess *m_pServer; - bool bForceServerStop; + bool m_bForceServerStop; int m_iStartDelay; int m_iTimerDelay; int m_iTimerSlot;