252 |
} |
} |
253 |
|
|
254 |
|
|
255 |
|
// Window drag-n-drop event handlers. |
256 |
void qsamplerMainForm::dragEnterEvent ( QDragEnterEvent* pDragEnterEvent ) |
void qsamplerMainForm::dragEnterEvent ( QDragEnterEvent* pDragEnterEvent ) |
257 |
{ |
{ |
258 |
bool bAccept = false; |
bool bAccept = false; |
277 |
} |
} |
278 |
|
|
279 |
|
|
280 |
|
// Context menu event handler. |
281 |
|
void qsamplerMainForm::contextMenuEvent( QContextMenuEvent *pEvent ) |
282 |
|
{ |
283 |
|
stabilizeForm(); |
284 |
|
|
285 |
|
editMenu->exec(pEvent->globalPos()); |
286 |
|
} |
287 |
|
|
288 |
|
|
289 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
290 |
// qsamplerMainForm -- Brainless public property accessors. |
// qsamplerMainForm -- Brainless public property accessors. |
291 |
|
|
853 |
bool bOldServerStart = m_pOptions->bServerStart; |
bool bOldServerStart = m_pOptions->bServerStart; |
854 |
QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
855 |
QString sOldDisplayFont = m_pOptions->sDisplayFont; |
QString sOldDisplayFont = m_pOptions->sDisplayFont; |
856 |
|
int iOldMaxVolume = m_pOptions->iMaxVolume; |
857 |
QString sOldMessagesFont = m_pOptions->sMessagesFont; |
QString sOldMessagesFont = m_pOptions->sMessagesFont; |
858 |
bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
859 |
int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
879 |
updateRecentFilesMenu(); |
updateRecentFilesMenu(); |
880 |
if (sOldDisplayFont != m_pOptions->sDisplayFont) |
if (sOldDisplayFont != m_pOptions->sDisplayFont) |
881 |
updateDisplayFont(); |
updateDisplayFont(); |
882 |
|
if (iOldMaxVolume != m_pOptions->iMaxVolume) |
883 |
|
updateMaxVolume(); |
884 |
if (sOldMessagesFont != m_pOptions->sMessagesFont) |
if (sOldMessagesFont != m_pOptions->sMessagesFont) |
885 |
updateMessagesFont(); |
updateMessagesFont(); |
886 |
if (( bOldMessagesLimit && !m_pOptions->bMessagesLimit) || |
if (( bOldMessagesLimit && !m_pOptions->bMessagesLimit) || |
1137 |
} |
} |
1138 |
|
|
1139 |
|
|
1140 |
|
// Force update of the channels maximum volume setting. |
1141 |
|
void qsamplerMainForm::updateMaxVolume (void) |
1142 |
|
{ |
1143 |
|
if (m_pOptions == NULL) |
1144 |
|
return; |
1145 |
|
|
1146 |
|
// Full channel list update... |
1147 |
|
QWidgetList wlist = m_pWorkspace->windowList(); |
1148 |
|
if (wlist.isEmpty()) |
1149 |
|
return; |
1150 |
|
|
1151 |
|
m_pWorkspace->setUpdatesEnabled(false); |
1152 |
|
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
1153 |
|
qsamplerChannelStrip *pChannel = (qsamplerChannelStrip *) wlist.at(iChannel); |
1154 |
|
pChannel->setMaxVolume(m_pOptions->iMaxVolume); |
1155 |
|
} |
1156 |
|
m_pWorkspace->setUpdatesEnabled(true); |
1157 |
|
} |
1158 |
|
|
1159 |
|
|
1160 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1161 |
// qsamplerMainForm -- Messages window form handlers. |
// qsamplerMainForm -- Messages window form handlers. |
1162 |
|
|
1270 |
// Add a new channel itema... |
// Add a new channel itema... |
1271 |
WFlags wflags = Qt::WStyle_Customize | Qt::WStyle_Tool | Qt::WStyle_Title | Qt::WStyle_NoBorder; |
WFlags wflags = Qt::WStyle_Customize | Qt::WStyle_Tool | Qt::WStyle_Title | Qt::WStyle_NoBorder; |
1272 |
pChannel = new qsamplerChannelStrip(m_pWorkspace, 0, wflags); |
pChannel = new qsamplerChannelStrip(m_pWorkspace, 0, wflags); |
1273 |
|
pChannel->setMaxVolume(m_pOptions->iMaxVolume); |
1274 |
pChannel->setup(this, iChannelID); |
pChannel->setup(this, iChannelID); |
1275 |
// We'll need a display font. |
// We'll need a display font. |
1276 |
QFont font; |
QFont font; |
1472 |
// And try to stop server. |
// And try to stop server. |
1473 |
if (m_pServer) { |
if (m_pServer) { |
1474 |
appendMessages(tr("Server is stopping...")); |
appendMessages(tr("Server is stopping...")); |
1475 |
if (m_pServer->isRunning()) { |
if (m_pServer->isRunning()) |
1476 |
m_pServer->tryTerminate(); |
m_pServer->tryTerminate(); |
|
return; |
|
|
} |
|
1477 |
} |
} |
1478 |
|
|
1479 |
|
// Give it some time to terminate gracefully and stabilize... |
1480 |
|
QTime t; |
1481 |
|
t.start(); |
1482 |
|
while (t.elapsed() < QSAMPLER_TIMER_MSECS) |
1483 |
|
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
1484 |
|
|
1485 |
// Do final processing anyway. |
// Do final processing anyway. |
1486 |
processServerExit(); |
processServerExit(); |
1487 |
} |
} |