1 |
// qsamplerMainForm.h |
// qsamplerMainForm.h |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2018, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, Christian Schoenebeck |
Copyright (C) 2007,2008,2015 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 |
23 |
#ifndef __qsamplerMainForm_h |
#ifndef __qsamplerMainForm_h |
24 |
#define __qsamplerMainForm_h |
#define __qsamplerMainForm_h |
25 |
|
|
|
#include <Qt3Support> |
|
|
|
|
|
#include <QWorkspace> |
|
|
#include <QList> |
|
|
#include <Q3PtrList> |
|
|
#include <QProcess> |
|
|
#include <QMenu> |
|
|
|
|
26 |
#include "ui_qsamplerMainForm.h" |
#include "ui_qsamplerMainForm.h" |
27 |
|
|
28 |
#include "qsamplerChannelStrip.h" |
#include <lscp/client.h> |
29 |
#include "qsamplerMessages.h" |
|
30 |
#include "qsamplerInstrumentListForm.h" |
class QProcess; |
31 |
#include "qsamplerDeviceForm.h" |
class QMdiSubWindow; |
32 |
|
class QSocketNotifier; |
33 |
|
class QSpinBox; |
34 |
|
class QSlider; |
35 |
|
class QLabel; |
36 |
|
|
37 |
namespace QSampler { |
namespace QSampler { |
38 |
|
|
39 |
|
class Workspace; |
40 |
|
class Options; |
41 |
|
class Messages; |
42 |
|
class Channel; |
43 |
|
class ChannelStrip; |
44 |
class DeviceForm; |
class DeviceForm; |
45 |
|
class InstrumentListForm; |
46 |
|
|
47 |
|
//------------------------------------------------------------------------- |
48 |
|
// QSampler::MainForm -- Main window form implementation. |
49 |
|
// |
50 |
|
|
51 |
|
class MainForm : public QMainWindow |
52 |
|
{ |
53 |
|
Q_OBJECT |
54 |
|
|
|
class MainForm : public QMainWindow { |
|
|
Q_OBJECT |
|
55 |
public: |
public: |
56 |
MainForm(QWidget* parent = 0); |
|
57 |
~MainForm(); |
MainForm(QWidget *pParent = NULL); |
58 |
void setup(qsamplerOptions* pOptions); |
~MainForm(); |
59 |
void contextMenuEvent(QContextMenuEvent *pEvent); |
|
60 |
qsamplerOptions* options(void); |
void setup(Options *pOptions); |
61 |
lscp_client_t* client(void); |
|
62 |
QString sessionName(const QString& sFilename); |
Options *options() const; |
63 |
void appendMessages(const QString& s); |
lscp_client_t *client() const; |
64 |
void appendMessagesColor(const QString& s, const QString& c); |
|
65 |
void appendMessagesText(const QString& s); |
QString sessionName(const QString& sFilename); |
66 |
void appendMessagesError(const QString& s); |
|
67 |
void appendMessagesClient(const QString& s); |
void appendMessages(const QString& sText); |
68 |
ChannelStrip* createChannelStrip(qsamplerChannel *pChannel); |
void appendMessagesColor(const QString& sText, const QString& sColor); |
69 |
ChannelStrip* activeChannelStrip(void); |
void appendMessagesText(const QString& sText); |
70 |
ChannelStrip* channelStripAt(int iChannel); |
void appendMessagesError(const QString& sText); |
71 |
ChannelStrip* channelStrip(int iChannelID); |
void appendMessagesClient(const QString& sText); |
72 |
static MainForm* getInstance(void); |
|
73 |
|
ChannelStrip *createChannelStrip(Channel *pChannel); |
74 |
|
void destroyChannelStrip(ChannelStrip *pChannelStrip); |
75 |
|
ChannelStrip *activeChannelStrip(); |
76 |
|
ChannelStrip *channelStripAt(int iChannel); |
77 |
|
ChannelStrip *channelStrip(int iChannelID); |
78 |
|
|
79 |
|
void channelsArrangeAuto(); |
80 |
|
void contextMenuEvent(QContextMenuEvent *pEvent); |
81 |
|
void sessionDirty(); |
82 |
|
|
83 |
|
static MainForm *getInstance(); |
84 |
|
|
85 |
public slots: |
public slots: |
86 |
void sessionDirty(void); |
|
87 |
void stabilizeForm(void); |
void fileNew(); |
88 |
|
void fileOpen(); |
89 |
|
void fileOpenRecent(); |
90 |
|
void fileSave(); |
91 |
|
void fileSaveAs(); |
92 |
|
void fileReset(); |
93 |
|
void fileRestart(); |
94 |
|
void fileExit(); |
95 |
|
void editAddChannel(); |
96 |
|
void editRemoveChannel(); |
97 |
|
void editSetupChannel(); |
98 |
|
void editEditChannel(); |
99 |
|
void editResetChannel(); |
100 |
|
void editResetAllChannels(); |
101 |
|
void viewMenubar(bool bOn); |
102 |
|
void viewToolbar(bool bOn); |
103 |
|
void viewStatusbar(bool bOn); |
104 |
|
void viewMessages(bool bOn); |
105 |
|
void viewInstruments(); |
106 |
|
void viewDevices(); |
107 |
|
void viewOptions(); |
108 |
|
void channelsArrange(); |
109 |
|
void channelsAutoArrange(bool bOn); |
110 |
|
void helpAboutQt(); |
111 |
|
void helpAbout(); |
112 |
|
|
113 |
|
void stabilizeForm(); |
114 |
|
|
115 |
|
protected slots: |
116 |
|
|
117 |
|
void updateRecentFilesMenu(); |
118 |
|
|
119 |
|
void volumeChanged(int iVolume); |
120 |
|
void channelStripChanged(ChannelStrip *pChannelStrip); |
121 |
|
void channelsMenuAboutToShow(); |
122 |
|
void channelsMenuActivated(); |
123 |
|
void timerSlot(); |
124 |
|
void readServerStdout(); |
125 |
|
void processServerExit(); |
126 |
|
|
127 |
|
void handle_sigusr1(); |
128 |
|
|
129 |
|
// Channel strip activation/selection. |
130 |
|
void activateStrip(QMdiSubWindow *pMdiSubWindow); |
131 |
|
|
132 |
|
// Channel toolbar orientation change. |
133 |
|
void channelsToolbarOrientation(Qt::Orientation orientation); |
134 |
|
|
135 |
protected: |
protected: |
136 |
bool queryClose(void); |
|
137 |
void closeEvent(QCloseEvent* pCloseEvent); |
void addChannelStrip(); |
138 |
bool decodeDragFiles(const QMimeSource* pEvent, QStringList& files); |
void removeChannelStrip(); |
139 |
void dragEnterEvent(QDragEnterEvent *pDragEnterEvent); |
|
140 |
void dropEvent(QDropEvent *pDropEvent); |
bool queryClose(); |
141 |
void customEvent(QEvent* pCustomEvent); |
void closeEvent(QCloseEvent* pCloseEvent); |
142 |
bool newSession(void); |
void dragEnterEvent(QDragEnterEvent *pDragEnterEvent); |
143 |
bool openSession(void); |
void dropEvent(QDropEvent *pDropEvent); |
144 |
bool saveSession(bool bPrompt); |
void customEvent(QEvent *pCustomEvent); |
145 |
bool closeSession(bool bForce); |
bool newSession(); |
146 |
bool loadSessionFile(const QString& sFilename); |
bool openSession(); |
147 |
bool saveSessionFile(const QString& sFilename); |
bool saveSession(bool bPrompt); |
148 |
void updateSession(); |
bool closeSession(bool bForce); |
149 |
void updateRecentFiles(const QString& sFilename); |
bool loadSessionFile(const QString& sFilename); |
150 |
void updateRecentFilesMenu(void); |
bool saveSessionFile(const QString& sFilename); |
151 |
void updateInstrumentNames(void); |
void updateSession(); |
152 |
void updateDisplayFont(void); |
void updateRecentFiles(const QString& sFilename); |
153 |
void updateDisplayEffect(void); |
void updateInstrumentNames(); |
154 |
void updateMaxVolume(void); |
void updateDisplayFont(); |
155 |
void updateMessagesFont(void); |
void updateDisplayEffect(); |
156 |
void updateMessagesLimit(void); |
void updateMaxVolume(); |
157 |
void updateMessagesCapture(void); |
void updateMessagesFont(); |
158 |
void startSchedule(int iStartDelay); |
void updateMessagesLimit(); |
159 |
void stopSchedule(void); |
void updateMessagesCapture(); |
160 |
void startServer(void); |
void updateViewMidiDeviceStatusMenu(); |
161 |
void stopServer(void); |
void updateAllChannelStrips(bool bRemoveDeadStrips); |
162 |
bool startClient(void); |
|
163 |
void stopClient(void); |
void startSchedule(int iStartDelay); |
164 |
|
void stopSchedule(); |
165 |
|
void startServer(); |
166 |
|
void stopServer(bool bInteractive = false); |
167 |
|
bool startClient(); |
168 |
|
void stopClient(); |
169 |
|
|
170 |
private: |
private: |
|
Ui::qsamplerMainForm ui; |
|
171 |
|
|
172 |
qsamplerOptions *m_pOptions; |
Ui::qsamplerMainForm m_ui; |
173 |
qsamplerMessages *m_pMessages; |
|
174 |
QWorkspace *m_pWorkspace; |
Options *m_pOptions; |
175 |
QString m_sFilename; |
Messages *m_pMessages; |
176 |
int m_iUntitled; |
Workspace *m_pWorkspace; |
177 |
int m_iDirtyCount; |
QSocketNotifier *m_pUsr1Notifier; |
178 |
lscp_client_t *m_pClient; |
QString m_sFilename; |
179 |
QProcess *m_pServer; |
int m_iUntitled; |
180 |
int m_iStartDelay; |
int m_iDirtySetup; |
181 |
int m_iTimerDelay; |
int m_iDirtyCount; |
182 |
int m_iTimerSlot; |
lscp_client_t *m_pClient; |
183 |
QLabel *m_statusItem[5]; |
QProcess *m_pServer; |
184 |
QMenu *m_pRecentFilesMenu; |
bool m_bForceServerStop; |
185 |
Q3PtrList<ChannelStrip> m_changedStrips; |
int m_iStartDelay; |
186 |
InstrumentListForm *m_pInstrumentListForm; |
int m_iTimerDelay; |
187 |
DeviceForm *m_pDeviceForm; |
int m_iTimerSlot; |
188 |
static MainForm *g_pMainForm; |
QLabel *m_statusItem[5]; |
189 |
QSlider *m_pVolumeSlider; |
QList<ChannelStrip *> m_changedStrips; |
190 |
QSpinBox *m_pVolumeSpinBox; |
InstrumentListForm *m_pInstrumentListForm; |
191 |
int m_iVolumeChanging; |
DeviceForm *m_pDeviceForm; |
192 |
QToolBar* fileToolbar; |
static MainForm *g_pMainForm; |
193 |
QToolBar* editToolbar; |
QSlider *m_pVolumeSlider; |
194 |
QToolBar* channelsToolbar; |
QSpinBox *m_pVolumeSpinBox; |
195 |
|
int m_iVolumeChanging; |
|
private slots: |
|
|
void fileNew(void); |
|
|
void fileOpen(void); |
|
|
void fileOpenRecent(int iIndex); |
|
|
void fileSave(void); |
|
|
void fileSaveAs(void); |
|
|
void fileReset(void); |
|
|
void fileRestart(void); |
|
|
void fileExit(void); |
|
|
void editAddChannel(void); |
|
|
void editRemoveChannel(void); |
|
|
void editSetupChannel(void); |
|
|
void editEditChannel(void); |
|
|
void editResetChannel(void); |
|
|
void editResetAllChannels(void); |
|
|
void viewMenubar(bool bOn); |
|
|
void viewToolbar(bool bOn); |
|
|
void viewStatusbar(bool bOn); |
|
|
void viewMessages(bool bOn); |
|
|
void viewInstruments(void); |
|
|
void viewDevices(void); |
|
|
void viewOptions(void); |
|
|
void channelsArrange(void); |
|
|
void channelsAutoArrange(bool bOn); |
|
|
void helpAboutQt(void); |
|
|
void helpAbout(void); |
|
|
void volumeChanged(int iVolume); |
|
|
void channelStripChanged(ChannelStrip *pChannelStrip); |
|
|
void channelsMenuAboutToShow(); |
|
|
void channelsMenuActivated(int iChannel); |
|
|
void timerSlot(void); |
|
|
void readServerStdout(void); |
|
|
void processServerExit(void); |
|
196 |
}; |
}; |
197 |
|
|
198 |
} // namespace QSampler |
} // namespace QSampler |