123 |
|
|
124 |
|
|
125 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
126 |
// qsampler -- namespace |
// QSampler -- namespace |
127 |
|
|
128 |
|
|
129 |
namespace QSampler { |
namespace QSampler { |
143 |
|
|
144 |
|
|
145 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
146 |
// LscpEvent -- specialty for LSCP callback comunication. |
// QSampler::LscpEvent -- specialty for LSCP callback comunication. |
|
|
|
147 |
|
|
148 |
class LscpEvent : public QEvent |
class LscpEvent : public QEvent |
149 |
{ |
{ |
158 |
} |
} |
159 |
|
|
160 |
// Accessors. |
// Accessors. |
161 |
lscp_event_t event() { return m_event; } |
lscp_event_t event() { return m_event; } |
162 |
QString& data() { return m_data; } |
const QString& data() { return m_data; } |
163 |
|
|
164 |
private: |
private: |
165 |
|
|
171 |
|
|
172 |
|
|
173 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
174 |
// qsamplerMainForm -- Main window form implementation. |
// QSampler::Workspace -- Main window workspace (MDI Area) decl. |
175 |
|
|
176 |
|
class Workspace : public QMdiArea |
177 |
|
{ |
178 |
|
public: |
179 |
|
|
180 |
|
Workspace(MainForm *pMainForm) : QMdiArea(pMainForm) {} |
181 |
|
|
182 |
|
protected: |
183 |
|
|
184 |
|
void resizeEvent(QResizeEvent *) |
185 |
|
{ |
186 |
|
MainForm *pMainForm = static_cast<MainForm *> (parentWidget()); |
187 |
|
if (pMainForm) |
188 |
|
pMainForm->channelsArrangeAuto(); |
189 |
|
} |
190 |
|
}; |
191 |
|
|
192 |
|
|
193 |
|
//------------------------------------------------------------------------- |
194 |
|
// QSampler::MainForm -- Main window form implementation. |
195 |
|
|
196 |
// Kind of singleton reference. |
// Kind of singleton reference. |
197 |
MainForm* MainForm::g_pMainForm = NULL; |
MainForm *MainForm::g_pMainForm = NULL; |
198 |
|
|
199 |
MainForm::MainForm ( QWidget *pParent ) |
MainForm::MainForm ( QWidget *pParent ) |
200 |
: QMainWindow(pParent) |
: QMainWindow(pParent) |
289 |
#endif |
#endif |
290 |
|
|
291 |
// Make it an MDI workspace. |
// Make it an MDI workspace. |
292 |
m_pWorkspace = new QMdiArea(this); |
m_pWorkspace = new Workspace(this); |
293 |
m_pWorkspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
m_pWorkspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
294 |
m_pWorkspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
m_pWorkspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
295 |
// Set the activation connection. |
// Set the activation connection. |
714 |
} |
} |
715 |
|
|
716 |
|
|
|
// Window resize event handler. |
|
|
void MainForm::resizeEvent ( QResizeEvent * ) |
|
|
{ |
|
|
if (m_pOptions->bAutoArrange) |
|
|
channelsArrange(); |
|
|
} |
|
|
|
|
|
|
|
717 |
// LADISH Level 1 -- SIGUSR1 signal handler. |
// LADISH Level 1 -- SIGUSR1 signal handler. |
718 |
void MainForm::handle_sigusr1 (void) |
void MainForm::handle_sigusr1 (void) |
719 |
{ |
{ |
753 |
|
|
754 |
|
|
755 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
756 |
// qsamplerMainForm -- Brainless public property accessors. |
// QSampler::MainForm -- Brainless public property accessors. |
757 |
|
|
758 |
// The global options settings property. |
// The global options settings property. |
759 |
Options *MainForm::options (void) const |
Options *MainForm::options (void) const |
777 |
|
|
778 |
|
|
779 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
780 |
// qsamplerMainForm -- Session file stuff. |
// QSampler::MainForm -- Session file stuff. |
781 |
|
|
782 |
// Format the displayable session filename. |
// Format the displayable session filename. |
783 |
QString MainForm::sessionName ( const QString& sFilename ) |
QString MainForm::sessionName ( const QString& sFilename ) |
1371 |
|
|
1372 |
|
|
1373 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1374 |
// qsamplerMainForm -- File Action slots. |
// QSampler::MainForm -- File Action slots. |
1375 |
|
|
1376 |
// Create a new sampler session. |
// Create a new sampler session. |
1377 |
void MainForm::fileNew (void) |
void MainForm::fileNew (void) |
1537 |
|
|
1538 |
|
|
1539 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1540 |
// qsamplerMainForm -- Edit Action slots. |
// QSampler::MainForm -- Edit Action slots. |
1541 |
|
|
1542 |
// Add a new sampler channel. |
// Add a new sampler channel. |
1543 |
void MainForm::editAddChannel (void) |
void MainForm::editAddChannel (void) |
1572 |
} |
} |
1573 |
|
|
1574 |
// Do we auto-arrange? |
// Do we auto-arrange? |
1575 |
if (m_pOptions && m_pOptions->bAutoArrange) |
channelsArrangeAuto(); |
|
channelsArrange(); |
|
1576 |
|
|
1577 |
// Make that an overall update. |
// Make that an overall update. |
1578 |
m_iDirtyCount++; |
m_iDirtyCount++; |
1713 |
|
|
1714 |
|
|
1715 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1716 |
// qsamplerMainForm -- View Action slots. |
// QSampler::MainForm -- View Action slots. |
1717 |
|
|
1718 |
// Show/hide the main program window menubar. |
// Show/hide the main program window menubar. |
1719 |
void MainForm::viewMenubar ( bool bOn ) |
void MainForm::viewMenubar ( bool bOn ) |
1894 |
|
|
1895 |
|
|
1896 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1897 |
// qsamplerMainForm -- Channels action slots. |
// QSampler::MainForm -- Channels action slots. |
1898 |
|
|
1899 |
// Arrange channel strips. |
// Arrange channel strips. |
1900 |
void MainForm::channelsArrange (void) |
void MainForm::channelsArrange (void) |
1936 |
m_pOptions->bAutoArrange = bOn; |
m_pOptions->bAutoArrange = bOn; |
1937 |
|
|
1938 |
// If on, update whole workspace... |
// If on, update whole workspace... |
1939 |
if (m_pOptions->bAutoArrange) |
channelsArrangeAuto(); |
1940 |
|
} |
1941 |
|
|
1942 |
|
|
1943 |
|
void MainForm::channelsArrangeAuto (void) |
1944 |
|
{ |
1945 |
|
if (m_pOptions && m_pOptions->bAutoArrange) |
1946 |
channelsArrange(); |
channelsArrange(); |
1947 |
} |
} |
1948 |
|
|
1949 |
|
|
1950 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1951 |
// qsamplerMainForm -- Help Action slots. |
// QSampler::MainForm -- Help Action slots. |
1952 |
|
|
1953 |
// Show information about the Qt toolkit. |
// Show information about the Qt toolkit. |
1954 |
void MainForm::helpAboutQt (void) |
void MainForm::helpAboutQt (void) |
2055 |
|
|
2056 |
|
|
2057 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
2058 |
// qsamplerMainForm -- Main window stabilization. |
// QSampler::MainForm -- Main window stabilization. |
2059 |
|
|
2060 |
void MainForm::stabilizeForm (void) |
void MainForm::stabilizeForm (void) |
2061 |
{ |
{ |
2207 |
updateAllChannelStrips(false); |
updateAllChannelStrips(false); |
2208 |
|
|
2209 |
// Do we auto-arrange? |
// Do we auto-arrange? |
2210 |
if (m_pOptions && m_pOptions->bAutoArrange) |
channelsArrangeAuto(); |
|
channelsArrange(); |
|
2211 |
|
|
2212 |
// Remember to refresh devices and instruments... |
// Remember to refresh devices and instruments... |
2213 |
if (m_pInstrumentListForm) |
if (m_pInstrumentListForm) |
2240 |
createChannelStrip(new Channel(piChannelIDs[iChannel])); |
createChannelStrip(new Channel(piChannelIDs[iChannel])); |
2241 |
} |
} |
2242 |
// Do we auto-arrange? |
// Do we auto-arrange? |
2243 |
if (m_pOptions && m_pOptions->bAutoArrange) |
channelsArrangeAuto(); |
|
channelsArrange(); |
|
2244 |
// remove dead channel strips |
// remove dead channel strips |
2245 |
if (bRemoveDeadStrips) { |
if (bRemoveDeadStrips) { |
2246 |
const QList<QMdiSubWindow *>& wlist |
const QList<QMdiSubWindow *>& wlist |
2432 |
|
|
2433 |
|
|
2434 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
2435 |
// qsamplerMainForm -- Messages window form handlers. |
// QSampler::MainForm -- Messages window form handlers. |
2436 |
|
|
2437 |
// Messages output methods. |
// Messages output methods. |
2438 |
void MainForm::appendMessages( const QString& s ) |
void MainForm::appendMessages( const QString& s ) |
2544 |
|
|
2545 |
|
|
2546 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
2547 |
// qsamplerMainForm -- MDI channel strip management. |
// QSampler::MainForm -- MDI channel strip management. |
2548 |
|
|
2549 |
// The channel strip creation executive. |
// The channel strip creation executive. |
2550 |
ChannelStrip *MainForm::createChannelStrip ( Channel *pChannel ) |
ChannelStrip *MainForm::createChannelStrip ( Channel *pChannel ) |
2604 |
delete pMdiSubWindow; |
delete pMdiSubWindow; |
2605 |
|
|
2606 |
// Do we auto-arrange? |
// Do we auto-arrange? |
2607 |
if (m_pOptions && m_pOptions->bAutoArrange) |
channelsArrangeAuto(); |
|
channelsArrange(); |
|
2608 |
} |
} |
2609 |
|
|
2610 |
|
|
2713 |
|
|
2714 |
|
|
2715 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
2716 |
// qsamplerMainForm -- Timer stuff. |
// QSampler::MainForm -- Timer stuff. |
2717 |
|
|
2718 |
// Set the pseudo-timer delay schedule. |
// Set the pseudo-timer delay schedule. |
2719 |
void MainForm::startSchedule ( int iStartDelay ) |
void MainForm::startSchedule ( int iStartDelay ) |
2786 |
|
|
2787 |
|
|
2788 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
2789 |
// qsamplerMainForm -- Server stuff. |
// QSampler::MainForm -- Server stuff. |
2790 |
|
|
2791 |
// Start linuxsampler server... |
// Start linuxsampler server... |
2792 |
void MainForm::startServer (void) |
void MainForm::startServer (void) |
2950 |
|
|
2951 |
|
|
2952 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
2953 |
// qsamplerMainForm -- Client stuff. |
// QSampler::MainForm -- Client stuff. |
2954 |
|
|
2955 |
// The LSCP client callback procedure. |
// The LSCP client callback procedure. |
2956 |
lscp_status_t qsampler_client_callback ( lscp_client_t */*pClient*/, |
lscp_status_t qsampler_client_callback ( lscp_client_t */*pClient*/, |