1 |
// qsamplerMainForm.cpp |
// qsamplerMainForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2015, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2016, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007,2008,2015 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 |
195 |
|
|
196 |
// We'll start clean. |
// We'll start clean. |
197 |
m_iUntitled = 0; |
m_iUntitled = 0; |
198 |
|
m_iDirtySetup = 0; |
199 |
m_iDirtyCount = 0; |
m_iDirtyCount = 0; |
200 |
|
|
201 |
m_pServer = NULL; |
m_pServer = NULL; |
479 |
updateMessagesFont(); |
updateMessagesFont(); |
480 |
updateMessagesLimit(); |
updateMessagesLimit(); |
481 |
updateMessagesCapture(); |
updateMessagesCapture(); |
482 |
|
|
483 |
// Set the visibility signal. |
// Set the visibility signal. |
484 |
QObject::connect(m_pMessages, |
QObject::connect(m_pMessages, |
485 |
SIGNAL(visibilityChanged(bool)), |
SIGNAL(visibilityChanged(bool)), |
545 |
|| m_ui.channelsToolbar->isVisible()); |
|| m_ui.channelsToolbar->isVisible()); |
546 |
m_pOptions->bStatusbar = statusBar()->isVisible(); |
m_pOptions->bStatusbar = statusBar()->isVisible(); |
547 |
// Save the dock windows state. |
// Save the dock windows state. |
|
const QString sDockables = saveState().toBase64().data(); |
|
548 |
m_pOptions->settings().setValue("/Layout/DockWindows", saveState()); |
m_pOptions->settings().setValue("/Layout/DockWindows", saveState()); |
549 |
// And the children, and the main windows state,. |
// And the children, and the main windows state,. |
550 |
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
587 |
} |
} |
588 |
|
|
589 |
|
|
590 |
void MainForm::dropEvent ( QDropEvent* pDropEvent ) |
void MainForm::dropEvent ( QDropEvent *pDropEvent ) |
591 |
{ |
{ |
592 |
// Accept externally originated drops only... |
// Accept externally originated drops only... |
593 |
if (pDropEvent->source()) |
if (pDropEvent->source()) |
643 |
updateAllChannelStrips(true); |
updateAllChannelStrips(true); |
644 |
break; |
break; |
645 |
case LSCP_EVENT_CHANNEL_INFO: { |
case LSCP_EVENT_CHANNEL_INFO: { |
646 |
int iChannelID = pLscpEvent->data().toInt(); |
const int iChannelID = pLscpEvent->data().toInt(); |
647 |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
ChannelStrip *pChannelStrip = channelStrip(iChannelID); |
648 |
if (pChannelStrip) |
if (pChannelStrip) |
649 |
channelStripChanged(pChannelStrip); |
channelStripChanged(pChannelStrip); |
695 |
} |
} |
696 |
|
|
697 |
|
|
698 |
|
// Window resize event handler. |
699 |
|
void MainForm::resizeEvent ( QResizeEvent * ) |
700 |
|
{ |
701 |
|
if (m_pOptions->bAutoArrange) |
702 |
|
channelsArrange(); |
703 |
|
} |
704 |
|
|
705 |
|
|
706 |
// LADISH Level 1 -- SIGUSR1 signal handler. |
// LADISH Level 1 -- SIGUSR1 signal handler. |
707 |
void MainForm::handle_sigusr1 (void) |
void MainForm::handle_sigusr1 (void) |
708 |
{ |
{ |
771 |
// Format the displayable session filename. |
// Format the displayable session filename. |
772 |
QString MainForm::sessionName ( const QString& sFilename ) |
QString MainForm::sessionName ( const QString& sFilename ) |
773 |
{ |
{ |
774 |
bool bCompletePath = (m_pOptions && m_pOptions->bCompletePath); |
const bool bCompletePath = (m_pOptions && m_pOptions->bCompletePath); |
775 |
QString sSessionName = sFilename; |
QString sSessionName = sFilename; |
776 |
if (sSessionName.isEmpty()) |
if (sSessionName.isEmpty()) |
777 |
sSessionName = tr("Untitled") + QString::number(m_iUntitled); |
sSessionName = tr("Untitled") + QString::number(m_iUntitled); |
905 |
if (bClose) { |
if (bClose) { |
906 |
// Remove all channel strips from sight... |
// Remove all channel strips from sight... |
907 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
908 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
909 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
= m_pWorkspace->subWindowList(); |
910 |
|
const int iStripCount = wlist.count(); |
911 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
912 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
913 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
914 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
915 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
916 |
if (pChannelStrip) { |
if (pChannelStrip) { |
1032 |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
1033 |
|
|
1034 |
// Write the file. |
// Write the file. |
1035 |
int iErrors = 0; |
int iErrors = 0; |
1036 |
QTextStream ts(&file); |
QTextStream ts(&file); |
1037 |
ts << "# " << QSAMPLER_TITLE " - " << tr(QSAMPLER_SUBTITLE) << endl; |
ts << "# " << QSAMPLER_TITLE " - " << tr(QSAMPLER_SUBTITLE) << endl; |
1038 |
ts << "# " << tr("Version") |
ts << "# " << tr("Version") |
1144 |
QMap<int, int> midiInstrumentMap; |
QMap<int, int> midiInstrumentMap; |
1145 |
int *piMaps = ::lscp_list_midi_instrument_maps(m_pClient); |
int *piMaps = ::lscp_list_midi_instrument_maps(m_pClient); |
1146 |
for (int iMap = 0; piMaps && piMaps[iMap] >= 0; iMap++) { |
for (int iMap = 0; piMaps && piMaps[iMap] >= 0; iMap++) { |
1147 |
int iMidiMap = piMaps[iMap]; |
const int iMidiMap = piMaps[iMap]; |
1148 |
const char *pszMapName |
const char *pszMapName |
1149 |
= ::lscp_get_midi_instrument_map_name(m_pClient, iMidiMap); |
= ::lscp_get_midi_instrument_map_name(m_pClient, iMidiMap); |
1150 |
ts << "# " << tr("MIDI instrument map") << " " << iMap; |
ts << "# " << tr("MIDI instrument map") << " " << iMap; |
1211 |
#endif // CONFIG_MIDI_INSTRUMENT |
#endif // CONFIG_MIDI_INSTRUMENT |
1212 |
|
|
1213 |
// Sampler channel mapping. |
// Sampler channel mapping. |
1214 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
1215 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
= m_pWorkspace->subWindowList(); |
1216 |
|
const int iStripCount = wlist.count(); |
1217 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
1218 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
1219 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
1220 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
1221 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
1222 |
if (pChannelStrip) { |
if (pChannelStrip) { |
1223 |
Channel *pChannel = pChannelStrip->channel(); |
Channel *pChannel = pChannelStrip->channel(); |
1224 |
if (pChannel) { |
if (pChannel) { |
1225 |
ts << "# " << tr("Channel") << " " << iChannel << endl; |
const int iChannelID = pChannel->channelID(); |
1226 |
|
ts << "# " << tr("Channel") << " " << iChannelID << endl; |
1227 |
ts << "ADD CHANNEL" << endl; |
ts << "ADD CHANNEL" << endl; |
1228 |
if (audioDeviceMap.isEmpty()) { |
if (audioDeviceMap.isEmpty()) { |
1229 |
ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannel |
ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannelID |
1230 |
<< " " << pChannel->audioDriver() << endl; |
<< " " << pChannel->audioDriver() << endl; |
1231 |
} else { |
} else { |
1232 |
ts << "SET CHANNEL AUDIO_OUTPUT_DEVICE " << iChannel |
ts << "SET CHANNEL AUDIO_OUTPUT_DEVICE " << iChannelID |
1233 |
<< " " << audioDeviceMap[pChannel->audioDevice()] << endl; |
<< " " << audioDeviceMap[pChannel->audioDevice()] << endl; |
1234 |
} |
} |
1235 |
if (midiDeviceMap.isEmpty()) { |
if (midiDeviceMap.isEmpty()) { |
1236 |
ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannel |
ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID |
1237 |
<< " " << pChannel->midiDriver() << endl; |
<< " " << pChannel->midiDriver() << endl; |
1238 |
} else { |
} else { |
1239 |
ts << "SET CHANNEL MIDI_INPUT_DEVICE " << iChannel |
ts << "SET CHANNEL MIDI_INPUT_DEVICE " << iChannelID |
1240 |
<< " " << midiDeviceMap[pChannel->midiDevice()] << endl; |
<< " " << midiDeviceMap[pChannel->midiDevice()] << endl; |
1241 |
} |
} |
1242 |
ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannel |
ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID |
1243 |
<< " " << pChannel->midiPort() << endl; |
<< " " << pChannel->midiPort() << endl; |
1244 |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannel << " "; |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " "; |
1245 |
if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL) |
if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL) |
1246 |
ts << "ALL"; |
ts << "ALL"; |
1247 |
else |
else |
1248 |
ts << pChannel->midiChannel(); |
ts << pChannel->midiChannel(); |
1249 |
ts << endl; |
ts << endl; |
1250 |
ts << "LOAD ENGINE " << pChannel->engineName() |
ts << "LOAD ENGINE " << pChannel->engineName() |
1251 |
<< " " << iChannel << endl; |
<< " " << iChannelID << endl; |
1252 |
if (pChannel->instrumentStatus() < 100) ts << "# "; |
if (pChannel->instrumentStatus() < 100) ts << "# "; |
1253 |
ts << "LOAD INSTRUMENT NON_MODAL '" |
ts << "LOAD INSTRUMENT NON_MODAL '" |
1254 |
<< pChannel->instrumentFile() << "' " |
<< pChannel->instrumentFile() << "' " |
1255 |
<< pChannel->instrumentNr() << " " << iChannel << endl; |
<< pChannel->instrumentNr() << " " << iChannelID << endl; |
1256 |
ChannelRoutingMap::ConstIterator audioRoute; |
ChannelRoutingMap::ConstIterator audioRoute; |
1257 |
for (audioRoute = pChannel->audioRouting().begin(); |
for (audioRoute = pChannel->audioRouting().begin(); |
1258 |
audioRoute != pChannel->audioRouting().end(); |
audioRoute != pChannel->audioRouting().end(); |
1259 |
++audioRoute) { |
++audioRoute) { |
1260 |
ts << "SET CHANNEL AUDIO_OUTPUT_CHANNEL " << iChannel |
ts << "SET CHANNEL AUDIO_OUTPUT_CHANNEL " << iChannelID |
1261 |
<< " " << audioRoute.key() |
<< " " << audioRoute.key() |
1262 |
<< " " << audioRoute.value() << endl; |
<< " " << audioRoute.value() << endl; |
1263 |
} |
} |
1264 |
ts << "SET CHANNEL VOLUME " << iChannel |
ts << "SET CHANNEL VOLUME " << iChannelID |
1265 |
<< " " << pChannel->volume() << endl; |
<< " " << pChannel->volume() << endl; |
1266 |
if (pChannel->channelMute()) |
if (pChannel->channelMute()) |
1267 |
ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl; |
ts << "SET CHANNEL MUTE " << iChannelID << " 1" << endl; |
1268 |
if (pChannel->channelSolo()) |
if (pChannel->channelSolo()) |
1269 |
ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl; |
ts << "SET CHANNEL SOLO " << iChannelID << " 1" << endl; |
1270 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
1271 |
if (pChannel->midiMap() >= 0) { |
if (pChannel->midiMap() >= 0) { |
1272 |
ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel |
ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannelID |
1273 |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
1274 |
} |
} |
1275 |
#endif |
#endif |
1276 |
#ifdef CONFIG_FXSEND |
#ifdef CONFIG_FXSEND |
|
int iChannelID = pChannel->channelID(); |
|
1277 |
int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID); |
int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID); |
1278 |
for (int iFxSend = 0; |
for (int iFxSend = 0; |
1279 |
piFxSends && piFxSends[iFxSend] >= 0; |
piFxSends && piFxSends[iFxSend] >= 0; |
1281 |
lscp_fxsend_info_t *pFxSendInfo = ::lscp_get_fxsend_info( |
lscp_fxsend_info_t *pFxSendInfo = ::lscp_get_fxsend_info( |
1282 |
m_pClient, iChannelID, piFxSends[iFxSend]); |
m_pClient, iChannelID, piFxSends[iFxSend]); |
1283 |
if (pFxSendInfo) { |
if (pFxSendInfo) { |
1284 |
ts << "CREATE FX_SEND " << iChannel |
ts << "CREATE FX_SEND " << iChannelID |
1285 |
<< " " << pFxSendInfo->midi_controller; |
<< " " << pFxSendInfo->midi_controller; |
1286 |
if (pFxSendInfo->name) |
if (pFxSendInfo->name) |
1287 |
ts << " '" << pFxSendInfo->name << "'"; |
ts << " '" << pFxSendInfo->name << "'"; |
1291 |
piRouting && piRouting[iAudioSrc] >= 0; |
piRouting && piRouting[iAudioSrc] >= 0; |
1292 |
iAudioSrc++) { |
iAudioSrc++) { |
1293 |
ts << "SET FX_SEND AUDIO_OUTPUT_CHANNEL " |
ts << "SET FX_SEND AUDIO_OUTPUT_CHANNEL " |
1294 |
<< iChannel |
<< iChannelID |
1295 |
<< " " << iFxSend |
<< " " << iFxSend |
1296 |
<< " " << iAudioSrc |
<< " " << iAudioSrc |
1297 |
<< " " << piRouting[iAudioSrc] << endl; |
<< " " << piRouting[iAudioSrc] << endl; |
1298 |
} |
} |
1299 |
#ifdef CONFIG_FXSEND_LEVEL |
#ifdef CONFIG_FXSEND_LEVEL |
1300 |
ts << "SET FX_SEND LEVEL " << iChannel |
ts << "SET FX_SEND LEVEL " << iChannelID |
1301 |
<< " " << iFxSend |
<< " " << iFxSend |
1302 |
<< " " << pFxSendInfo->level << endl; |
<< " " << pFxSendInfo->level << endl; |
1303 |
#endif |
#endif |
1384 |
// Retrive filename index from action data... |
// Retrive filename index from action data... |
1385 |
QAction *pAction = qobject_cast<QAction *> (sender()); |
QAction *pAction = qobject_cast<QAction *> (sender()); |
1386 |
if (pAction && m_pOptions) { |
if (pAction && m_pOptions) { |
1387 |
int iIndex = pAction->data().toInt(); |
const int iIndex = pAction->data().toInt(); |
1388 |
if (iIndex >= 0 && iIndex < m_pOptions->recentFiles.count()) { |
if (iIndex >= 0 && iIndex < m_pOptions->recentFiles.count()) { |
1389 |
QString sFilename = m_pOptions->recentFiles[iIndex]; |
QString sFilename = m_pOptions->recentFiles[iIndex]; |
1390 |
// Check if we can safely close the current session... |
// Check if we can safely close the current session... |
1531 |
// Add a new sampler channel. |
// Add a new sampler channel. |
1532 |
void MainForm::editAddChannel (void) |
void MainForm::editAddChannel (void) |
1533 |
{ |
{ |
1534 |
|
++m_iDirtySetup; |
1535 |
|
addChannelStrip(); |
1536 |
|
--m_iDirtySetup; |
1537 |
|
} |
1538 |
|
|
1539 |
|
void MainForm::addChannelStrip (void) |
1540 |
|
{ |
1541 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1542 |
return; |
return; |
1543 |
|
|
1573 |
// Remove current sampler channel. |
// Remove current sampler channel. |
1574 |
void MainForm::editRemoveChannel (void) |
void MainForm::editRemoveChannel (void) |
1575 |
{ |
{ |
1576 |
|
++m_iDirtySetup; |
1577 |
|
removeChannelStrip(); |
1578 |
|
--m_iDirtySetup; |
1579 |
|
} |
1580 |
|
|
1581 |
|
void MainForm::removeChannelStrip (void) |
1582 |
|
{ |
1583 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1584 |
return; |
return; |
1585 |
|
|
1624 |
if (!pChannel->removeChannel()) |
if (!pChannel->removeChannel()) |
1625 |
return; |
return; |
1626 |
|
|
|
// We'll be dirty, for sure... |
|
|
m_iDirtyCount++; |
|
|
|
|
1627 |
// Just delete the channel strip. |
// Just delete the channel strip. |
1628 |
destroyChannelStrip(pChannelStrip); |
destroyChannelStrip(pChannelStrip); |
1629 |
|
|
1630 |
|
// We'll be dirty, for sure... |
1631 |
|
m_iDirtyCount++; |
1632 |
|
stabilizeForm(); |
1633 |
} |
} |
1634 |
|
|
1635 |
|
|
1687 |
// Invoque the channel strip procedure, |
// Invoque the channel strip procedure, |
1688 |
// for all channels out there... |
// for all channels out there... |
1689 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
1690 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
1691 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
= m_pWorkspace->subWindowList(); |
1692 |
|
const int iStripCount = wlist.count(); |
1693 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
1694 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
1695 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
1696 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
1697 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
1698 |
if (pChannelStrip) |
if (pChannelStrip) |
1803 |
if (m_pOptions->sMessagesFont.isEmpty() && m_pMessages) |
if (m_pOptions->sMessagesFont.isEmpty() && m_pMessages) |
1804 |
m_pOptions->sMessagesFont = m_pMessages->messagesFont().toString(); |
m_pOptions->sMessagesFont = m_pMessages->messagesFont().toString(); |
1805 |
// To track down deferred or immediate changes. |
// To track down deferred or immediate changes. |
1806 |
QString sOldServerHost = m_pOptions->sServerHost; |
const QString sOldServerHost = m_pOptions->sServerHost; |
1807 |
int iOldServerPort = m_pOptions->iServerPort; |
const int iOldServerPort = m_pOptions->iServerPort; |
1808 |
int iOldServerTimeout = m_pOptions->iServerTimeout; |
const int iOldServerTimeout = m_pOptions->iServerTimeout; |
1809 |
bool bOldServerStart = m_pOptions->bServerStart; |
const bool bOldServerStart = m_pOptions->bServerStart; |
1810 |
QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
const QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
1811 |
bool bOldMessagesLog = m_pOptions->bMessagesLog; |
const bool bOldMessagesLog = m_pOptions->bMessagesLog; |
1812 |
QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath; |
const QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath; |
1813 |
QString sOldDisplayFont = m_pOptions->sDisplayFont; |
const QString sOldDisplayFont = m_pOptions->sDisplayFont; |
1814 |
bool bOldDisplayEffect = m_pOptions->bDisplayEffect; |
const bool bOldDisplayEffect = m_pOptions->bDisplayEffect; |
1815 |
int iOldMaxVolume = m_pOptions->iMaxVolume; |
const int iOldMaxVolume = m_pOptions->iMaxVolume; |
1816 |
QString sOldMessagesFont = m_pOptions->sMessagesFont; |
const QString sOldMessagesFont = m_pOptions->sMessagesFont; |
1817 |
bool bOldKeepOnTop = m_pOptions->bKeepOnTop; |
const bool bOldKeepOnTop = m_pOptions->bKeepOnTop; |
1818 |
bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
const bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
1819 |
int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
const int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
1820 |
int iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines; |
const int iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines; |
1821 |
bool bOldCompletePath = m_pOptions->bCompletePath; |
const bool bOldCompletePath = m_pOptions->bCompletePath; |
1822 |
bool bOldInstrumentNames = m_pOptions->bInstrumentNames; |
const bool bOldInstrumentNames = m_pOptions->bInstrumentNames; |
1823 |
int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles; |
const int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles; |
1824 |
int iOldBaseFontSize = m_pOptions->iBaseFontSize; |
const int iOldBaseFontSize = m_pOptions->iBaseFontSize; |
1825 |
// Load the current setup settings. |
// Load the current setup settings. |
1826 |
pOptionsForm->setup(m_pOptions); |
pOptionsForm->setup(m_pOptions); |
1827 |
// Show the setup dialog... |
// Show the setup dialog... |
1890 |
void MainForm::channelsArrange (void) |
void MainForm::channelsArrange (void) |
1891 |
{ |
{ |
1892 |
// Full width vertical tiling |
// Full width vertical tiling |
1893 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
1894 |
|
= m_pWorkspace->subWindowList(); |
1895 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
1896 |
return; |
return; |
1897 |
|
|
1898 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
1899 |
int y = 0; |
int y = 0; |
1900 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
const int iStripCount = wlist.count(); |
1901 |
ChannelStrip *pChannelStrip = NULL; |
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
1902 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
1903 |
if (pMdiSubWindow) |
if (pMdiSubWindow) { |
1904 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pMdiSubWindow->adjustSize(); |
1905 |
if (pChannelStrip) { |
int iWidth = m_pWorkspace->width(); |
1906 |
/* if (pChannelStrip->testWState(WState_Maximized | WState_Minimized)) { |
if (iWidth < pMdiSubWindow->width()) |
1907 |
// Prevent flicker... |
iWidth = pMdiSubWindow->width(); |
1908 |
pChannelStrip->hide(); |
const int iHeight = pMdiSubWindow->frameGeometry().height(); |
1909 |
pChannelStrip->showNormal(); |
pMdiSubWindow->setGeometry(0, y, iWidth, iHeight); |
|
} */ |
|
|
pChannelStrip->adjustSize(); |
|
|
int iWidth = m_pWorkspace->width(); |
|
|
if (iWidth < pChannelStrip->width()) |
|
|
iWidth = pChannelStrip->width(); |
|
|
// int iHeight = pChannelStrip->height() |
|
|
// + pChannelStrip->parentWidget()->baseSize().height(); |
|
|
int iHeight = pChannelStrip->parentWidget()->frameGeometry().height(); |
|
|
pChannelStrip->parentWidget()->setGeometry(0, y, iWidth, iHeight); |
|
1910 |
y += iHeight; |
y += iHeight; |
1911 |
} |
} |
1912 |
} |
} |
2051 |
|
|
2052 |
// Update the main menu state... |
// Update the main menu state... |
2053 |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
ChannelStrip *pChannelStrip = activeChannelStrip(); |
2054 |
bool bHasClient = (m_pOptions != NULL && m_pClient != NULL); |
const QList<QMdiSubWindow *>& wlist = m_pWorkspace->subWindowList(); |
2055 |
bool bHasChannel = (bHasClient && pChannelStrip != NULL); |
const bool bHasClient = (m_pOptions != NULL && m_pClient != NULL); |
2056 |
bool bHasChannels = (bHasClient && m_pWorkspace->subWindowList().count() > 0); |
const bool bHasChannel = (bHasClient && pChannelStrip != NULL); |
2057 |
|
const bool bHasChannels = (bHasClient && wlist.count() > 0); |
2058 |
m_ui.fileNewAction->setEnabled(bHasClient); |
m_ui.fileNewAction->setEnabled(bHasClient); |
2059 |
m_ui.fileOpenAction->setEnabled(bHasClient); |
m_ui.fileOpenAction->setEnabled(bHasClient); |
2060 |
m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0); |
m_ui.fileSaveAction->setEnabled(bHasClient && m_iDirtyCount > 0); |
2134 |
m_pVolumeSpinBox->setValue(iVolume); |
m_pVolumeSpinBox->setValue(iVolume); |
2135 |
|
|
2136 |
// Do it as commanded... |
// Do it as commanded... |
2137 |
float fVolume = 0.01f * float(iVolume); |
const float fVolume = 0.01f * float(iVolume); |
2138 |
if (::lscp_set_volume(m_pClient, fVolume) == LSCP_OK) |
if (::lscp_set_volume(m_pClient, fVolume) == LSCP_OK) |
2139 |
appendMessages(QObject::tr("Volume: %1.").arg(fVolume)); |
appendMessages(QObject::tr("Volume: %1.").arg(fVolume)); |
2140 |
else |
else |
2169 |
void MainForm::updateSession (void) |
void MainForm::updateSession (void) |
2170 |
{ |
{ |
2171 |
#ifdef CONFIG_VOLUME |
#ifdef CONFIG_VOLUME |
2172 |
int iVolume = ::lroundf(100.0f * ::lscp_get_volume(m_pClient)); |
const int iVolume = ::lroundf(100.0f * ::lscp_get_volume(m_pClient)); |
2173 |
m_iVolumeChanging++; |
m_iVolumeChanging++; |
2174 |
m_pVolumeSlider->setValue(iVolume); |
m_pVolumeSlider->setValue(iVolume); |
2175 |
m_pVolumeSpinBox->setValue(iVolume); |
m_pVolumeSpinBox->setValue(iVolume); |
2177 |
#endif |
#endif |
2178 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
2179 |
// FIXME: Make some room for default instrument maps... |
// FIXME: Make some room for default instrument maps... |
2180 |
int iMaps = ::lscp_get_midi_instrument_maps(m_pClient); |
const int iMaps = ::lscp_get_midi_instrument_maps(m_pClient); |
2181 |
if (iMaps < 0) |
if (iMaps < 0) |
2182 |
appendMessagesClient("lscp_get_midi_instrument_maps"); |
appendMessagesClient("lscp_get_midi_instrument_maps"); |
2183 |
else if (iMaps < 1) { |
else if (iMaps < 1) { |
2204 |
|
|
2205 |
void MainForm::updateAllChannelStrips ( bool bRemoveDeadStrips ) |
void MainForm::updateAllChannelStrips ( bool bRemoveDeadStrips ) |
2206 |
{ |
{ |
2207 |
|
// Skip if setting up a new channel strip... |
2208 |
|
if (m_iDirtySetup > 0) |
2209 |
|
return; |
2210 |
|
|
2211 |
// Retrieve the current channel list. |
// Retrieve the current channel list. |
2212 |
int *piChannelIDs = ::lscp_list_channels(m_pClient); |
int *piChannelIDs = ::lscp_list_channels(m_pClient); |
2213 |
if (piChannelIDs == NULL) { |
if (piChannelIDs == NULL) { |
2229 |
channelsArrange(); |
channelsArrange(); |
2230 |
// remove dead channel strips |
// remove dead channel strips |
2231 |
if (bRemoveDeadStrips) { |
if (bRemoveDeadStrips) { |
2232 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2233 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
= m_pWorkspace->subWindowList(); |
2234 |
|
const int iStripCount = wlist.count(); |
2235 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
2236 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
2237 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2238 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
2239 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2240 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2241 |
bool bExists = false; |
bool bExists = false; |
2242 |
for (int j = 0; piChannelIDs[j] >= 0; ++j) { |
for (int iChannel = 0; piChannelIDs[iChannel] >= 0; ++iChannel) { |
2243 |
if (!pChannelStrip->channel()) |
Channel *pChannel = pChannelStrip->channel(); |
2244 |
|
if (pChannel == NULL) |
2245 |
break; |
break; |
2246 |
if (piChannelIDs[j] == pChannelStrip->channel()->channelID()) { |
if (piChannelIDs[iChannel] == pChannel->channelID()) { |
2247 |
// strip exists, don't touch it |
// strip exists, don't touch it |
2248 |
bExists = true; |
bExists = true; |
2249 |
break; |
break; |
2268 |
return; |
return; |
2269 |
|
|
2270 |
// Remove from list if already there (avoid duplicates) |
// Remove from list if already there (avoid duplicates) |
2271 |
int iIndex = m_pOptions->recentFiles.indexOf(sFilename); |
const int iIndex = m_pOptions->recentFiles.indexOf(sFilename); |
2272 |
if (iIndex >= 0) |
if (iIndex >= 0) |
2273 |
m_pOptions->recentFiles.removeAt(iIndex); |
m_pOptions->recentFiles.removeAt(iIndex); |
2274 |
// Put it to front... |
// Put it to front... |
2307 |
void MainForm::updateInstrumentNames (void) |
void MainForm::updateInstrumentNames (void) |
2308 |
{ |
{ |
2309 |
// Full channel list update... |
// Full channel list update... |
2310 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2311 |
|
= m_pWorkspace->subWindowList(); |
2312 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2313 |
return; |
return; |
2314 |
|
|
2315 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2316 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
const int iStripCount = wlist.count(); |
2317 |
ChannelStrip *pChannelStrip = (ChannelStrip *) wlist.at(iChannel); |
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
2318 |
|
ChannelStrip *pChannelStrip = NULL; |
2319 |
|
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2320 |
|
if (pMdiSubWindow) |
2321 |
|
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2322 |
if (pChannelStrip) |
if (pChannelStrip) |
2323 |
pChannelStrip->updateInstrumentName(true); |
pChannelStrip->updateInstrumentName(true); |
2324 |
} |
} |
2335 |
// Check if display font is legal. |
// Check if display font is legal. |
2336 |
if (m_pOptions->sDisplayFont.isEmpty()) |
if (m_pOptions->sDisplayFont.isEmpty()) |
2337 |
return; |
return; |
2338 |
|
|
2339 |
// Realize it. |
// Realize it. |
2340 |
QFont font; |
QFont font; |
2341 |
if (!font.fromString(m_pOptions->sDisplayFont)) |
if (!font.fromString(m_pOptions->sDisplayFont)) |
2342 |
return; |
return; |
2343 |
|
|
2344 |
// Full channel list update... |
// Full channel list update... |
2345 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2346 |
|
= m_pWorkspace->subWindowList(); |
2347 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2348 |
return; |
return; |
2349 |
|
|
2350 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2351 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
const int iStripCount = wlist.count(); |
2352 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
2353 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
2354 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2355 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
2356 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2357 |
if (pChannelStrip) |
if (pChannelStrip) |
2365 |
void MainForm::updateDisplayEffect (void) |
void MainForm::updateDisplayEffect (void) |
2366 |
{ |
{ |
2367 |
// Full channel list update... |
// Full channel list update... |
2368 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2369 |
|
= m_pWorkspace->subWindowList(); |
2370 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2371 |
return; |
return; |
2372 |
|
|
2373 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2374 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
const int iStripCount = wlist.count(); |
2375 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
2376 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
2377 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2378 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
2379 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2380 |
if (pChannelStrip) |
if (pChannelStrip) |
2398 |
#endif |
#endif |
2399 |
|
|
2400 |
// Full channel list update... |
// Full channel list update... |
2401 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2402 |
|
= m_pWorkspace->subWindowList(); |
2403 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2404 |
return; |
return; |
2405 |
|
|
2406 |
m_pWorkspace->setUpdatesEnabled(false); |
m_pWorkspace->setUpdatesEnabled(false); |
2407 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
const int iStripCount = wlist.count(); |
2408 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
2409 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
2410 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2411 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
2412 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2413 |
if (pChannelStrip) |
if (pChannelStrip) |
2549 |
pChannelStrip->setDisplayEffect(m_pOptions->bDisplayEffect); |
pChannelStrip->setDisplayEffect(m_pOptions->bDisplayEffect); |
2550 |
// We'll need a display font. |
// We'll need a display font. |
2551 |
QFont font; |
QFont font; |
2552 |
if (font.fromString(m_pOptions->sDisplayFont)) |
if (!m_pOptions->sDisplayFont.isEmpty() && |
2553 |
|
font.fromString(m_pOptions->sDisplayFont)) |
2554 |
pChannelStrip->setDisplayFont(font); |
pChannelStrip->setDisplayFont(font); |
2555 |
// Maximum allowed volume setting. |
// Maximum allowed volume setting. |
2556 |
pChannelStrip->setMaxVolume(m_pOptions->iMaxVolume); |
pChannelStrip->setMaxVolume(m_pOptions->iMaxVolume); |
2592 |
// Do we auto-arrange? |
// Do we auto-arrange? |
2593 |
if (m_pOptions && m_pOptions->bAutoArrange) |
if (m_pOptions && m_pOptions->bAutoArrange) |
2594 |
channelsArrange(); |
channelsArrange(); |
|
|
|
|
stabilizeForm(); |
|
2595 |
} |
} |
2596 |
|
|
2597 |
|
|
2607 |
|
|
2608 |
|
|
2609 |
// Retrieve a channel strip by index. |
// Retrieve a channel strip by index. |
2610 |
ChannelStrip *MainForm::channelStripAt ( int iChannel ) |
ChannelStrip *MainForm::channelStripAt ( int iStrip ) |
2611 |
{ |
{ |
2612 |
if (!m_pWorkspace) return NULL; |
if (!m_pWorkspace) return NULL; |
2613 |
|
|
2614 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2615 |
|
= m_pWorkspace->subWindowList(); |
2616 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2617 |
return NULL; |
return NULL; |
2618 |
|
|
2619 |
if (iChannel < 0 || iChannel >= wlist.size()) |
if (iStrip < 0 || iStrip >= wlist.count()) |
2620 |
return NULL; |
return NULL; |
2621 |
|
|
2622 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2623 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
2624 |
return static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
return static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2625 |
else |
else |
2630 |
// Retrieve a channel strip by sampler channel id. |
// Retrieve a channel strip by sampler channel id. |
2631 |
ChannelStrip *MainForm::channelStrip ( int iChannelID ) |
ChannelStrip *MainForm::channelStrip ( int iChannelID ) |
2632 |
{ |
{ |
2633 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2634 |
|
= m_pWorkspace->subWindowList(); |
2635 |
if (wlist.isEmpty()) |
if (wlist.isEmpty()) |
2636 |
return NULL; |
return NULL; |
2637 |
|
|
2638 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
const int iStripCount = wlist.count(); |
2639 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
2640 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
2641 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2642 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
2643 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2644 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2660 |
m_ui.channelsMenu->addAction(m_ui.channelsArrangeAction); |
m_ui.channelsMenu->addAction(m_ui.channelsArrangeAction); |
2661 |
m_ui.channelsMenu->addAction(m_ui.channelsAutoArrangeAction); |
m_ui.channelsMenu->addAction(m_ui.channelsAutoArrangeAction); |
2662 |
|
|
2663 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2664 |
|
= m_pWorkspace->subWindowList(); |
2665 |
if (!wlist.isEmpty()) { |
if (!wlist.isEmpty()) { |
2666 |
m_ui.channelsMenu->addSeparator(); |
m_ui.channelsMenu->addSeparator(); |
2667 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
const int iStripCount = wlist.count(); |
2668 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
2669 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
2670 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2671 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
2672 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2673 |
if (pChannelStrip) { |
if (pChannelStrip) { |
2676 |
this, SLOT(channelsMenuActivated())); |
this, SLOT(channelsMenuActivated())); |
2677 |
pAction->setCheckable(true); |
pAction->setCheckable(true); |
2678 |
pAction->setChecked(activeChannelStrip() == pChannelStrip); |
pAction->setChecked(activeChannelStrip() == pChannelStrip); |
2679 |
pAction->setData(iChannel); |
pAction->setData(iStrip); |
2680 |
} |
} |
2681 |
} |
} |
2682 |
} |
} |
2741 |
ChannelStrip *pChannelStrip = iter.next(); |
ChannelStrip *pChannelStrip = iter.next(); |
2742 |
// If successfull, remove from pending list... |
// If successfull, remove from pending list... |
2743 |
if (pChannelStrip->updateChannelInfo()) { |
if (pChannelStrip->updateChannelInfo()) { |
2744 |
int iChannelStrip = m_changedStrips.indexOf(pChannelStrip); |
const int iChannelStrip = m_changedStrips.indexOf(pChannelStrip); |
2745 |
if (iChannelStrip >= 0) |
if (iChannelStrip >= 0) |
2746 |
m_changedStrips.removeAt(iChannelStrip); |
m_changedStrips.removeAt(iChannelStrip); |
2747 |
} |
} |
2752 |
if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime) { |
if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime) { |
2753 |
m_iTimerSlot = 0; |
m_iTimerSlot = 0; |
2754 |
// Update the channel stream usage for each strip... |
// Update the channel stream usage for each strip... |
2755 |
QList<QMdiSubWindow *> wlist = m_pWorkspace->subWindowList(); |
const QList<QMdiSubWindow *>& wlist |
2756 |
for (int iChannel = 0; iChannel < (int) wlist.count(); ++iChannel) { |
= m_pWorkspace->subWindowList(); |
2757 |
|
const int iStripCount = wlist.count(); |
2758 |
|
for (int iStrip = 0; iStrip < iStripCount; ++iStrip) { |
2759 |
ChannelStrip *pChannelStrip = NULL; |
ChannelStrip *pChannelStrip = NULL; |
2760 |
QMdiSubWindow *pMdiSubWindow = wlist.at(iChannel); |
QMdiSubWindow *pMdiSubWindow = wlist.at(iStrip); |
2761 |
if (pMdiSubWindow) |
if (pMdiSubWindow) |
2762 |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
pChannelStrip = static_cast<ChannelStrip *> (pMdiSubWindow->widget()); |
2763 |
if (pChannelStrip && pChannelStrip->isVisible()) |
if (pChannelStrip && pChannelStrip->isVisible()) |
2810 |
bForceServerStop = true; |
bForceServerStop = true; |
2811 |
|
|
2812 |
// Setup stdout/stderr capture... |
// Setup stdout/stderr capture... |
2813 |
// if (m_pOptions->bStdoutCapture) { |
m_pServer->setProcessChannelMode(QProcess::ForwardedChannels); |
2814 |
m_pServer->setProcessChannelMode(QProcess::ForwardedChannels); |
QObject::connect(m_pServer, |
2815 |
QObject::connect(m_pServer, |
SIGNAL(readyReadStandardOutput()), |
2816 |
SIGNAL(readyReadStandardOutput()), |
SLOT(readServerStdout())); |
2817 |
SLOT(readServerStdout())); |
QObject::connect(m_pServer, |
2818 |
QObject::connect(m_pServer, |
SIGNAL(readyReadStandardError()), |
2819 |
SIGNAL(readyReadStandardError()), |
SLOT(readServerStdout())); |
|
SLOT(readServerStdout())); |
|
|
// } |
|
2820 |
|
|
2821 |
// The unforgiveable signal communication... |
// The unforgiveable signal communication... |
2822 |
QObject::connect(m_pServer, |
QObject::connect(m_pServer, |