--- qsampler/trunk/src/qsamplerMainForm.h 2007/11/22 11:10:44 1509 +++ qsampler/trunk/src/qsamplerMainForm.h 2019/04/01 22:36:26 3508 @@ -1,8 +1,8 @@ // qsamplerMainForm.h // /**************************************************************************** - Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. - Copyright (C) 2007, Christian Schoenebeck + Copyright (C) 2004-2019, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2007,2008,2015 Christian Schoenebeck This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -25,18 +25,28 @@ #include "ui_qsamplerMainForm.h" -#include "qsamplerMessages.h" -#include "qsamplerChannelStrip.h" -#include "qsamplerInstrumentListForm.h" -#include "qsamplerDeviceForm.h" +#include -class QWorkspace; class QProcess; - +class QMdiSubWindow; +class QSocketNotifier; +class QSpinBox; +class QSlider; +class QLabel; namespace QSampler { +class Workspace; +class Options; +class Messages; +class Channel; +class ChannelStrip; class DeviceForm; +class InstrumentListForm; + +//------------------------------------------------------------------------- +// QSampler::MainForm -- Main window form implementation. +// class MainForm : public QMainWindow { @@ -47,27 +57,30 @@ MainForm(QWidget *pParent = NULL); ~MainForm(); - void setup(qsamplerOptions* pOptions); + void setup(Options *pOptions); - qsamplerOptions* 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 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 appendMessages(const QString& sText); + void appendMessagesColor(const QString& sText, const QString& sColor); + void appendMessagesText(const QString& sText); + void appendMessagesError(const QString& sText); + void appendMessagesClient(const QString& sText); + + 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: @@ -96,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(); @@ -103,20 +123,26 @@ void timerSlot(); void readServerStdout(); void processServerExit(); - void sessionDirty(); - void stabilizeForm(); -protected slots: + void handle_sigusr1(); + void handle_sigterm(); - void updateRecentFilesMenu(); + // Channel strip activation/selection. + 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); @@ -132,10 +158,13 @@ void updateMessagesFont(); void updateMessagesLimit(); void updateMessagesCapture(); + void updateViewMidiDeviceStatusMenu(); + void updateAllChannelStrips(bool bRemoveDeadStrips); + void startSchedule(int iStartDelay); void stopSchedule(); void startServer(); - void stopServer(); + void stopServer(bool bInteractive = false); bool startClient(); void stopClient(); @@ -143,14 +172,18 @@ Ui::qsamplerMainForm m_ui; - qsamplerOptions *m_pOptions; - qsamplerMessages *m_pMessages; - QWorkspace *m_pWorkspace; + Options *m_pOptions; + Messages *m_pMessages; + 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 m_bForceServerStop; int m_iStartDelay; int m_iTimerDelay; int m_iTimerSlot;