1 |
schoenebeck |
1461 |
#ifndef QSAMPLER_MAIN_FORM_H |
2 |
|
|
#define QSAMPLER_MAIN_FORM_H |
3 |
|
|
|
4 |
|
|
#include <Qt3Support> |
5 |
|
|
|
6 |
|
|
#include <QWorkspace> |
7 |
|
|
#include <QList> |
8 |
|
|
#include <Q3PtrList> |
9 |
|
|
#include <QProcess> |
10 |
|
|
#include <QMenu> |
11 |
|
|
|
12 |
|
|
#include "ui_qsamplerMainForm.h" |
13 |
|
|
|
14 |
|
|
#include "qsamplerChannelStrip.h" |
15 |
|
|
#include "qsamplerMessages.h" |
16 |
|
|
#include "qsamplerInstrumentListForm.h" |
17 |
|
|
#include "qsamplerDeviceForm.h" |
18 |
|
|
|
19 |
|
|
namespace QSampler { |
20 |
|
|
|
21 |
|
|
class DeviceForm; |
22 |
|
|
|
23 |
|
|
class MainForm : public QMainWindow { |
24 |
|
|
Q_OBJECT |
25 |
|
|
public: |
26 |
|
|
MainForm(QWidget* parent = 0); |
27 |
|
|
~MainForm(); |
28 |
|
|
void setup(qsamplerOptions* pOptions); |
29 |
|
|
void contextMenuEvent(QContextMenuEvent *pEvent); |
30 |
|
|
qsamplerOptions* options(void); |
31 |
|
|
lscp_client_t* client(void); |
32 |
|
|
QString sessionName(const QString& sFilename); |
33 |
|
|
void appendMessages(const QString& s); |
34 |
|
|
void appendMessagesColor(const QString& s, const QString& c); |
35 |
|
|
void appendMessagesText(const QString& s); |
36 |
|
|
void appendMessagesError(const QString& s); |
37 |
|
|
void appendMessagesClient(const QString& s); |
38 |
|
|
ChannelStrip* createChannelStrip(qsamplerChannel *pChannel); |
39 |
|
|
ChannelStrip* activeChannelStrip(void); |
40 |
|
|
ChannelStrip* channelStripAt(int iChannel); |
41 |
|
|
ChannelStrip* channelStrip(int iChannelID); |
42 |
|
|
static MainForm* getInstance(void); |
43 |
|
|
|
44 |
|
|
public slots: |
45 |
|
|
void sessionDirty(void); |
46 |
|
|
void stabilizeForm(void); |
47 |
|
|
|
48 |
|
|
protected: |
49 |
|
|
bool queryClose(void); |
50 |
|
|
void closeEvent(QCloseEvent* pCloseEvent); |
51 |
|
|
bool decodeDragFiles(const QMimeSource* pEvent, QStringList& files); |
52 |
|
|
void dragEnterEvent(QDragEnterEvent *pDragEnterEvent); |
53 |
|
|
void dropEvent(QDropEvent *pDropEvent); |
54 |
|
|
void customEvent(QEvent* pCustomEvent); |
55 |
|
|
bool newSession(void); |
56 |
|
|
bool openSession(void); |
57 |
|
|
bool saveSession(bool bPrompt); |
58 |
|
|
bool closeSession(bool bForce); |
59 |
|
|
bool loadSessionFile(const QString& sFilename); |
60 |
|
|
bool saveSessionFile(const QString& sFilename); |
61 |
|
|
void updateSession(); |
62 |
|
|
void updateRecentFiles(const QString& sFilename); |
63 |
|
|
void updateRecentFilesMenu(void); |
64 |
|
|
void updateInstrumentNames(void); |
65 |
|
|
void updateDisplayFont(void); |
66 |
|
|
void updateDisplayEffect(void); |
67 |
|
|
void updateMaxVolume(void); |
68 |
|
|
void updateMessagesFont(void); |
69 |
|
|
void updateMessagesLimit(void); |
70 |
|
|
void updateMessagesCapture(void); |
71 |
|
|
void startSchedule(int iStartDelay); |
72 |
|
|
void stopSchedule(void); |
73 |
|
|
void startServer(void); |
74 |
|
|
void stopServer(void); |
75 |
|
|
bool startClient(void); |
76 |
|
|
void stopClient(void); |
77 |
|
|
|
78 |
|
|
private: |
79 |
|
|
Ui::qsamplerMainForm ui; |
80 |
|
|
|
81 |
|
|
qsamplerOptions *m_pOptions; |
82 |
|
|
qsamplerMessages *m_pMessages; |
83 |
|
|
QWorkspace *m_pWorkspace; |
84 |
|
|
QString m_sFilename; |
85 |
|
|
int m_iUntitled; |
86 |
|
|
int m_iDirtyCount; |
87 |
|
|
lscp_client_t *m_pClient; |
88 |
|
|
QProcess *m_pServer; |
89 |
|
|
int m_iStartDelay; |
90 |
|
|
int m_iTimerDelay; |
91 |
|
|
int m_iTimerSlot; |
92 |
|
|
QLabel *m_statusItem[5]; |
93 |
|
|
QMenu *m_pRecentFilesMenu; |
94 |
|
|
Q3PtrList<ChannelStrip> m_changedStrips; |
95 |
|
|
InstrumentListForm *m_pInstrumentListForm; |
96 |
|
|
DeviceForm *m_pDeviceForm; |
97 |
|
|
static MainForm *g_pMainForm; |
98 |
|
|
QSlider *m_pVolumeSlider; |
99 |
|
|
QSpinBox *m_pVolumeSpinBox; |
100 |
|
|
int m_iVolumeChanging; |
101 |
|
|
QToolBar* fileToolbar; |
102 |
|
|
QToolBar* editToolbar; |
103 |
|
|
QToolBar* channelsToolbar; |
104 |
|
|
|
105 |
|
|
private slots: |
106 |
|
|
void fileNew(void); |
107 |
|
|
void fileOpen(void); |
108 |
|
|
void fileOpenRecent(int iIndex); |
109 |
|
|
void fileSave(void); |
110 |
|
|
void fileSaveAs(void); |
111 |
|
|
void fileReset(void); |
112 |
|
|
void fileRestart(void); |
113 |
|
|
void fileExit(void); |
114 |
|
|
void editAddChannel(void); |
115 |
|
|
void editRemoveChannel(void); |
116 |
|
|
void editSetupChannel(void); |
117 |
|
|
void editEditChannel(void); |
118 |
|
|
void editResetChannel(void); |
119 |
|
|
void editResetAllChannels(void); |
120 |
|
|
void viewMenubar(bool bOn); |
121 |
|
|
void viewToolbar(bool bOn); |
122 |
|
|
void viewStatusbar(bool bOn); |
123 |
|
|
void viewMessages(bool bOn); |
124 |
|
|
void viewInstruments(void); |
125 |
|
|
void viewDevices(void); |
126 |
|
|
void viewOptions(void); |
127 |
|
|
void channelsArrange(void); |
128 |
|
|
void channelsAutoArrange(bool bOn); |
129 |
|
|
void helpAboutQt(void); |
130 |
|
|
void helpAbout(void); |
131 |
|
|
void volumeChanged(int iVolume); |
132 |
|
|
void channelStripChanged(ChannelStrip *pChannelStrip); |
133 |
|
|
void channelsMenuAboutToShow(); |
134 |
|
|
void channelsMenuActivated(int iChannel); |
135 |
|
|
void timerSlot(void); |
136 |
|
|
void readServerStdout(void); |
137 |
|
|
void processServerExit(void); |
138 |
|
|
}; |
139 |
|
|
|
140 |
|
|
} // namespace QSampler |
141 |
|
|
|
142 |
|
|
#endif // QSAMPLER_MAIN_FORM_H |