41 |
#include "qsamplerMessages.h" |
#include "qsamplerMessages.h" |
42 |
|
|
43 |
#include "qsamplerChannelStrip.h" |
#include "qsamplerChannelStrip.h" |
44 |
|
|
45 |
|
#include "qsamplerDeviceForm.h" |
46 |
#include "qsamplerOptionsForm.h" |
#include "qsamplerOptionsForm.h" |
47 |
|
|
48 |
#include "config.h" |
#include "config.h" |
107 |
m_pOptions = NULL; |
m_pOptions = NULL; |
108 |
|
|
109 |
// All child forms are to be created later, not earlier than setup. |
// All child forms are to be created later, not earlier than setup. |
110 |
m_pMessages = NULL; |
m_pMessages = NULL; |
111 |
|
m_pDeviceForm = NULL; |
112 |
|
|
113 |
// We'll start clean. |
// We'll start clean. |
114 |
m_iUntitled = 0; |
m_iUntitled = 0; |
141 |
pLabel = new QLabel(tr("Connected"), this); |
pLabel = new QLabel(tr("Connected"), this); |
142 |
pLabel->setAlignment(Qt::AlignLeft); |
pLabel->setAlignment(Qt::AlignLeft); |
143 |
pLabel->setMinimumSize(pLabel->sizeHint()); |
pLabel->setMinimumSize(pLabel->sizeHint()); |
144 |
m_status[QSAMPLER_STATUS_CLIENT] = pLabel; |
m_statusItem[QSAMPLER_STATUS_CLIENT] = pLabel; |
145 |
statusBar()->addWidget(pLabel); |
statusBar()->addWidget(pLabel); |
146 |
// Server address. |
// Server address. |
147 |
pLabel = new QLabel(this); |
pLabel = new QLabel(this); |
148 |
pLabel->setAlignment(Qt::AlignLeft); |
pLabel->setAlignment(Qt::AlignLeft); |
149 |
m_status[QSAMPLER_STATUS_SERVER] = pLabel; |
m_statusItem[QSAMPLER_STATUS_SERVER] = pLabel; |
150 |
statusBar()->addWidget(pLabel, 1); |
statusBar()->addWidget(pLabel, 1); |
151 |
// Channel title. |
// Channel title. |
152 |
pLabel = new QLabel(this); |
pLabel = new QLabel(this); |
153 |
pLabel->setAlignment(Qt::AlignLeft); |
pLabel->setAlignment(Qt::AlignLeft); |
154 |
m_status[QSAMPLER_STATUS_CHANNEL] = pLabel; |
m_statusItem[QSAMPLER_STATUS_CHANNEL] = pLabel; |
155 |
statusBar()->addWidget(pLabel, 2); |
statusBar()->addWidget(pLabel, 2); |
156 |
// Session modification status. |
// Session modification status. |
157 |
pLabel = new QLabel(tr("MOD"), this); |
pLabel = new QLabel(tr("MOD"), this); |
158 |
pLabel->setAlignment(Qt::AlignHCenter); |
pLabel->setAlignment(Qt::AlignHCenter); |
159 |
pLabel->setMinimumSize(pLabel->sizeHint()); |
pLabel->setMinimumSize(pLabel->sizeHint()); |
160 |
m_status[QSAMPLER_STATUS_SESSION] = pLabel; |
m_statusItem[QSAMPLER_STATUS_SESSION] = pLabel; |
161 |
statusBar()->addWidget(pLabel); |
statusBar()->addWidget(pLabel); |
162 |
|
|
163 |
// Create the recent files sub-menu. |
// Create the recent files sub-menu. |
176 |
{ |
{ |
177 |
// Do final processing anyway. |
// Do final processing anyway. |
178 |
processServerExit(); |
processServerExit(); |
179 |
|
|
180 |
// Delete recentfiles menu. |
#if defined(WIN32) |
181 |
if (m_pRecentFilesMenu) |
WSACleanup(); |
182 |
delete m_pRecentFilesMenu; |
#endif |
|
// Delete status item labels one by one. |
|
|
if (m_status[QSAMPLER_STATUS_CLIENT]) |
|
|
delete m_status[QSAMPLER_STATUS_CLIENT]; |
|
|
if (m_status[QSAMPLER_STATUS_SERVER]) |
|
|
delete m_status[QSAMPLER_STATUS_SERVER]; |
|
|
if (m_status[QSAMPLER_STATUS_CHANNEL]) |
|
|
delete m_status[QSAMPLER_STATUS_CHANNEL]; |
|
|
if (m_status[QSAMPLER_STATUS_SESSION]) |
|
|
delete m_status[QSAMPLER_STATUS_SESSION]; |
|
183 |
|
|
184 |
// Finally drop any widgets around... |
// Finally drop any widgets around... |
185 |
|
if (m_pDeviceForm) |
186 |
|
delete m_pDeviceForm; |
187 |
if (m_pMessages) |
if (m_pMessages) |
188 |
delete m_pMessages; |
delete m_pMessages; |
189 |
if (m_pWorkspace) |
if (m_pWorkspace) |
190 |
delete m_pWorkspace; |
delete m_pWorkspace; |
191 |
|
|
192 |
#if defined(WIN32) |
// Delete status item labels one by one. |
193 |
WSACleanup(); |
if (m_statusItem[QSAMPLER_STATUS_CLIENT]) |
194 |
#endif |
delete m_statusItem[QSAMPLER_STATUS_CLIENT]; |
195 |
|
if (m_statusItem[QSAMPLER_STATUS_SERVER]) |
196 |
|
delete m_statusItem[QSAMPLER_STATUS_SERVER]; |
197 |
|
if (m_statusItem[QSAMPLER_STATUS_CHANNEL]) |
198 |
|
delete m_statusItem[QSAMPLER_STATUS_CHANNEL]; |
199 |
|
if (m_statusItem[QSAMPLER_STATUS_SESSION]) |
200 |
|
delete m_statusItem[QSAMPLER_STATUS_SESSION]; |
201 |
|
|
202 |
|
// Delete recentfiles menu. |
203 |
|
if (m_pRecentFilesMenu) |
204 |
|
delete m_pRecentFilesMenu; |
205 |
} |
} |
206 |
|
|
207 |
|
|
211 |
// We got options? |
// We got options? |
212 |
m_pOptions = pOptions; |
m_pOptions = pOptions; |
213 |
|
|
214 |
|
// What style do we create these forms? |
215 |
|
WFlags wflags = Qt::WType_TopLevel; |
216 |
|
if (m_pOptions->bKeepOnTop) |
217 |
|
wflags |= Qt::WStyle_Tool; |
218 |
// Some child forms are to be created right now. |
// Some child forms are to be created right now. |
219 |
m_pMessages = new qsamplerMessages(this); |
m_pMessages = new qsamplerMessages(this); |
220 |
|
m_pDeviceForm = new qsamplerDeviceForm(this, 0, wflags); |
221 |
// Set message defaults... |
// Set message defaults... |
222 |
updateMessagesFont(); |
updateMessagesFont(); |
223 |
updateMessagesLimit(); |
updateMessagesLimit(); |
246 |
QTextIStream istr(&sDockables); |
QTextIStream istr(&sDockables); |
247 |
istr >> *this; |
istr >> *this; |
248 |
} |
} |
249 |
// Try to restore old window positioning. |
// Try to restore old window positioning and initial visibility. |
250 |
m_pOptions->loadWidgetGeometry(this); |
m_pOptions->loadWidgetGeometry(this); |
251 |
|
m_pOptions->loadWidgetGeometry(m_pDeviceForm); |
252 |
|
|
253 |
// Final startup stabilization... |
// Final startup stabilization... |
254 |
updateRecentFilesMenu(); |
updateRecentFilesMenu(); |
286 |
QTextOStream ostr(&sDockables); |
QTextOStream ostr(&sDockables); |
287 |
ostr << *this; |
ostr << *this; |
288 |
m_pOptions->settings().writeEntry("/Layout/DockWindows", sDockables); |
m_pOptions->settings().writeEntry("/Layout/DockWindows", sDockables); |
289 |
// And the main windows state. |
// And the children, and the main windows state,. |
290 |
|
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
291 |
m_pOptions->saveWidgetGeometry(this); |
m_pOptions->saveWidgetGeometry(this); |
292 |
|
// Close popup widgets. |
293 |
|
if (m_pDeviceForm) |
294 |
|
m_pDeviceForm->close(); |
295 |
// Stop client and/or server, gracefully. |
// Stop client and/or server, gracefully. |
296 |
stopServer(); |
stopServer(); |
297 |
} |
} |
321 |
if (bDecode) { |
if (bDecode) { |
322 |
files = QStringList::split('\n', sText); |
files = QStringList::split('\n', sText); |
323 |
for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) |
for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) |
324 |
*iter = (*iter).stripWhiteSpace().replace(QRegExp("^file:"), QString::null); |
*iter = QUrl((*iter).stripWhiteSpace().replace(QRegExp("^file:"), QString::null)).path(); |
325 |
} |
} |
326 |
} |
} |
327 |
|
|
345 |
return; |
return; |
346 |
|
|
347 |
for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) { |
for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) { |
348 |
const QString& sPath = QUrl(*iter).path(); |
const QString& sPath = *iter; |
349 |
if (qsamplerChannel::isInstrumentFile(sPath)) { |
if (qsamplerChannel::isInstrumentFile(sPath)) { |
350 |
// Try to create a new channel from instrument file... |
// Try to create a new channel from instrument file... |
351 |
qsamplerChannel *pChannel = new qsamplerChannel(this); |
qsamplerChannel *pChannel = new qsamplerChannel(this); |
642 |
} |
} |
643 |
|
|
644 |
// Write the file. |
// Write the file. |
645 |
int iErrors = 0; |
int iErrors = 0; |
646 |
QTextStream ts(&file); |
QTextStream ts(&file); |
647 |
ts << "# " << QSAMPLER_TITLE " - " << tr(QSAMPLER_SUBTITLE) << endl; |
ts << "# " << QSAMPLER_TITLE " - " << tr(QSAMPLER_SUBTITLE) << endl; |
648 |
ts << "# " << tr("Version") |
ts << "# " << tr("Version") |
653 |
ts << "# " << tr("File") |
ts << "# " << tr("File") |
654 |
<< ": " << QFileInfo(sFilename).fileName() << endl; |
<< ": " << QFileInfo(sFilename).fileName() << endl; |
655 |
ts << "# " << tr("Date") |
ts << "# " << tr("Date") |
656 |
<< ": " << QDate::currentDate().toString("MMMM dd yyyy") |
<< ": " << QDate::currentDate().toString("MMM dd yyyy") |
657 |
<< " " << QTime::currentTime().toString("hh:mm:ss") << endl; |
<< " " << QTime::currentTime().toString("hh:mm:ss") << endl; |
658 |
ts << "#" << endl; |
ts << "#" << endl; |
659 |
ts << endl; |
ts << endl; |
660 |
|
// It is assumed that this new kind of device+session file |
661 |
|
// will be loaded from a complete |
662 |
|
int *piDeviceIDs; |
663 |
|
int iDevice; |
664 |
|
ts << "RESET" << endl; |
665 |
|
// Audio device mapping. |
666 |
|
QMap<int, int> audioDeviceMap; |
667 |
|
piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio); |
668 |
|
for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) { |
669 |
|
qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]); |
670 |
|
ts << endl; |
671 |
|
ts << "# " << device.deviceTypeName() << " " << device.driverName() |
672 |
|
<< " " << tr("Device") << " " << iDevice << endl; |
673 |
|
ts << "CREATE AUDIO_OUTPUT_DEVICE " << device.driverName(); |
674 |
|
qsamplerDeviceParamMap& params = device.params(); |
675 |
|
qsamplerDeviceParamMap::ConstIterator iter; |
676 |
|
for (iter = params.begin(); iter != params.end(); ++iter) |
677 |
|
ts << " " << iter.key() << "='" << iter.data().value << "'"; |
678 |
|
ts << endl; |
679 |
|
audioDeviceMap[device.deviceID()] = iDevice; |
680 |
|
// Try to keep it snappy :) |
681 |
|
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
682 |
|
} |
683 |
|
// MIDI device mapping. |
684 |
|
QMap<int, int> midiDeviceMap; |
685 |
|
piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi); |
686 |
|
for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) { |
687 |
|
qsamplerDevice device(m_pClient, qsamplerDevice::Midi, piDeviceIDs[iDevice]); |
688 |
|
ts << endl; |
689 |
|
ts << "# " << device.deviceTypeName() << " " << device.driverName() |
690 |
|
<< " " << tr("Device") << " " << iDevice << endl; |
691 |
|
ts << "CREATE MIDI_INPUT_DEVICE " << device.driverName(); |
692 |
|
qsamplerDeviceParamMap& params = device.params(); |
693 |
|
qsamplerDeviceParamMap::ConstIterator iter; |
694 |
|
for (iter = params.begin(); iter != params.end(); ++iter) |
695 |
|
ts << " " << iter.key() << "='" << iter.data().value << "'"; |
696 |
|
ts << endl; |
697 |
|
midiDeviceMap[device.deviceID()] = iDevice; |
698 |
|
// Try to keep it snappy :) |
699 |
|
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
700 |
|
} |
701 |
|
ts << endl; |
702 |
|
// Sampler channel mapping. |
703 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QWidgetList wlist = m_pWorkspace->windowList(); |
704 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
705 |
qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); |
qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); |
706 |
if (pChannelStrip) { |
if (pChannelStrip) { |
707 |
qsamplerChannel *pChannel = pChannelStrip->channel(); |
qsamplerChannel *pChannel = pChannelStrip->channel(); |
708 |
if (pChannel) { |
if (pChannel) { |
709 |
int iChannelID = pChannel->channelID(); |
ts << "# " << tr("Channel") << " " << iChannel << endl; |
|
ts << "# " << pChannelStrip->caption() << endl; |
|
710 |
ts << "ADD CHANNEL" << endl; |
ts << "ADD CHANNEL" << endl; |
711 |
ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannelID << " " << pChannel->audioDriver() << endl; |
if (audioDeviceMap.isEmpty()) { |
712 |
ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl; |
ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannel |
713 |
ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl; |
<< " " << pChannel->audioDriver() << endl; |
714 |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " "; |
} else { |
715 |
|
ts << "SET CHANNEL AUDIO_OUTPUT_DEVICE " << iChannel |
716 |
|
<< " " << audioDeviceMap[pChannel->audioDevice()] << endl; |
717 |
|
} |
718 |
|
if (midiDeviceMap.isEmpty()) { |
719 |
|
ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannel |
720 |
|
<< " " << pChannel->midiDriver() << endl; |
721 |
|
} else { |
722 |
|
ts << "SET CHANNEL MIDI_INPUT_DEVICE " << iChannel |
723 |
|
<< " " << midiDeviceMap[pChannel->midiDevice()] << endl; |
724 |
|
} |
725 |
|
ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannel |
726 |
|
<< " " << pChannel->midiPort() << endl; |
727 |
|
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannel << " "; |
728 |
if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL) |
if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL) |
729 |
ts << "ALL"; |
ts << "ALL"; |
730 |
else |
else |
731 |
ts << pChannel->midiChannel(); |
ts << pChannel->midiChannel(); |
732 |
ts << endl; |
ts << endl; |
733 |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl; |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl; |
734 |
ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannelID << endl; |
ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl; |
735 |
ts << "SET CHANNEL VOLUME " << iChannelID << " " << pChannel->volume() << endl; |
ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl; |
736 |
ts << endl; |
ts << endl; |
737 |
} |
} |
738 |
} |
} |
761 |
} |
} |
762 |
|
|
763 |
|
|
764 |
|
// Session change receiver slot. |
765 |
|
void qsamplerMainForm::sessionDirty (void) |
766 |
|
{ |
767 |
|
// Just mark the dirty form. |
768 |
|
m_iDirtyCount++; |
769 |
|
// and update the form status... |
770 |
|
stabilizeForm(); |
771 |
|
} |
772 |
|
|
773 |
|
|
774 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
775 |
// qsamplerMainForm -- File Action slots. |
// qsamplerMainForm -- File Action slots. |
776 |
|
|
991 |
} |
} |
992 |
|
|
993 |
|
|
994 |
|
// Reset all sampler channels. |
995 |
|
void qsamplerMainForm::editResetAllChannels (void) |
996 |
|
{ |
997 |
|
if (m_pClient == NULL) |
998 |
|
return; |
999 |
|
|
1000 |
|
// Invoque the channel strip procedure, |
1001 |
|
// for all channels out there... |
1002 |
|
m_pWorkspace->setUpdatesEnabled(false); |
1003 |
|
QWidgetList wlist = m_pWorkspace->windowList(); |
1004 |
|
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
1005 |
|
qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); |
1006 |
|
if (pChannelStrip) |
1007 |
|
pChannelStrip->channelReset(); |
1008 |
|
} |
1009 |
|
m_pWorkspace->setUpdatesEnabled(true); |
1010 |
|
} |
1011 |
|
|
1012 |
|
|
1013 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1014 |
// qsamplerMainForm -- View Action slots. |
// qsamplerMainForm -- View Action slots. |
1015 |
|
|
1058 |
} |
} |
1059 |
|
|
1060 |
|
|
1061 |
|
// Show/hide the device configurator form. |
1062 |
|
void qsamplerMainForm::viewDevices (void) |
1063 |
|
{ |
1064 |
|
if (m_pOptions == NULL) |
1065 |
|
return; |
1066 |
|
|
1067 |
|
if (m_pDeviceForm) { |
1068 |
|
m_pOptions->saveWidgetGeometry(m_pDeviceForm); |
1069 |
|
m_pDeviceForm->setClient(m_pClient); |
1070 |
|
if (m_pDeviceForm->isVisible()) { |
1071 |
|
m_pDeviceForm->hide(); |
1072 |
|
} else { |
1073 |
|
m_pDeviceForm->show(); |
1074 |
|
m_pDeviceForm->raise(); |
1075 |
|
m_pDeviceForm->setActiveWindow(); |
1076 |
|
} |
1077 |
|
} |
1078 |
|
} |
1079 |
|
|
1080 |
|
|
1081 |
// Show options dialog. |
// Show options dialog. |
1082 |
void qsamplerMainForm::viewOptions (void) |
void qsamplerMainForm::viewOptions (void) |
1083 |
{ |
{ |
1102 |
bool bOldDisplayEffect = m_pOptions->bDisplayEffect; |
bool bOldDisplayEffect = m_pOptions->bDisplayEffect; |
1103 |
int iOldMaxVolume = m_pOptions->iMaxVolume; |
int iOldMaxVolume = m_pOptions->iMaxVolume; |
1104 |
QString sOldMessagesFont = m_pOptions->sMessagesFont; |
QString sOldMessagesFont = m_pOptions->sMessagesFont; |
1105 |
|
bool bOldKeepOnTop = m_pOptions->bKeepOnTop; |
1106 |
bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
1107 |
int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
1108 |
int iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines; |
int iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines; |
1115 |
if (pOptionsForm->exec()) { |
if (pOptionsForm->exec()) { |
1116 |
// Warn if something will be only effective on next run. |
// Warn if something will be only effective on next run. |
1117 |
if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) || |
if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) || |
1118 |
(!bOldStdoutCapture && m_pOptions->bStdoutCapture)) { |
(!bOldStdoutCapture && m_pOptions->bStdoutCapture) || |
1119 |
|
( bOldKeepOnTop && !m_pOptions->bKeepOnTop) || |
1120 |
|
(!bOldKeepOnTop && m_pOptions->bKeepOnTop)) { |
1121 |
QMessageBox::information(this, tr("Information"), |
QMessageBox::information(this, tr("Information"), |
1122 |
tr("Some settings may be only effective\n" |
tr("Some settings may be only effective\n" |
1123 |
"next time you start this program."), tr("OK")); |
"next time you start this program."), tr("OK")); |
1273 |
void qsamplerMainForm::stabilizeForm (void) |
void qsamplerMainForm::stabilizeForm (void) |
1274 |
{ |
{ |
1275 |
// Update the main application caption... |
// Update the main application caption... |
1276 |
QString sSessioName = sessionName(m_sFilename); |
QString sSessionName = sessionName(m_sFilename); |
1277 |
if (m_iDirtyCount > 0) |
if (m_iDirtyCount > 0) |
1278 |
sSessioName += '*'; |
sSessionName += '*'; |
1279 |
setCaption(tr(QSAMPLER_TITLE " - [%1]").arg(sSessioName)); |
setCaption(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName)); |
1280 |
|
|
1281 |
// Update the main menu state... |
// Update the main menu state... |
1282 |
qsamplerChannelStrip *pChannelStrip = activeChannelStrip(); |
qsamplerChannelStrip *pChannelStrip = activeChannelStrip(); |
1292 |
editRemoveChannelAction->setEnabled(bHasChannel); |
editRemoveChannelAction->setEnabled(bHasChannel); |
1293 |
editSetupChannelAction->setEnabled(bHasChannel); |
editSetupChannelAction->setEnabled(bHasChannel); |
1294 |
editResetChannelAction->setEnabled(bHasChannel); |
editResetChannelAction->setEnabled(bHasChannel); |
1295 |
channelsArrangeAction->setEnabled(bHasChannel); |
editResetAllChannelsAction->setEnabled(bHasChannel); |
1296 |
viewMessagesAction->setOn(m_pMessages && m_pMessages->isVisible()); |
viewMessagesAction->setOn(m_pMessages && m_pMessages->isVisible()); |
1297 |
|
viewDevicesAction->setOn(m_pDeviceForm && m_pDeviceForm->isVisible()); |
1298 |
|
viewDevicesAction->setEnabled(bHasClient); |
1299 |
|
channelsArrangeAction->setEnabled(bHasChannel); |
1300 |
|
|
1301 |
// Client/Server status... |
// Client/Server status... |
1302 |
if (bHasClient) { |
if (bHasClient) { |
1303 |
m_status[QSAMPLER_STATUS_CLIENT]->setText(tr("Connected")); |
m_statusItem[QSAMPLER_STATUS_CLIENT]->setText(tr("Connected")); |
1304 |
m_status[QSAMPLER_STATUS_SERVER]->setText(m_pOptions->sServerHost + ":" + QString::number(m_pOptions->iServerPort)); |
m_statusItem[QSAMPLER_STATUS_SERVER]->setText(m_pOptions->sServerHost + ":" + QString::number(m_pOptions->iServerPort)); |
1305 |
} else { |
} else { |
1306 |
m_status[QSAMPLER_STATUS_CLIENT]->clear(); |
m_statusItem[QSAMPLER_STATUS_CLIENT]->clear(); |
1307 |
m_status[QSAMPLER_STATUS_SERVER]->clear(); |
m_statusItem[QSAMPLER_STATUS_SERVER]->clear(); |
1308 |
} |
} |
1309 |
// Channel status... |
// Channel status... |
1310 |
if (bHasChannel) |
if (bHasChannel) |
1311 |
m_status[QSAMPLER_STATUS_CHANNEL]->setText(pChannelStrip->caption()); |
m_statusItem[QSAMPLER_STATUS_CHANNEL]->setText(pChannelStrip->caption()); |
1312 |
else |
else |
1313 |
m_status[QSAMPLER_STATUS_CHANNEL]->clear(); |
m_statusItem[QSAMPLER_STATUS_CHANNEL]->clear(); |
1314 |
// Session status... |
// Session status... |
1315 |
if (m_iDirtyCount > 0) |
if (m_iDirtyCount > 0) |
1316 |
m_status[QSAMPLER_STATUS_SESSION]->setText(tr("MOD")); |
m_statusItem[QSAMPLER_STATUS_SESSION]->setText(tr("MOD")); |
1317 |
else |
else |
1318 |
m_status[QSAMPLER_STATUS_SESSION]->clear(); |
m_statusItem[QSAMPLER_STATUS_SESSION]->clear(); |
1319 |
|
|
1320 |
// Recent files menu. |
// Recent files menu. |
1321 |
m_pRecentFilesMenu->setEnabled(bHasClient && m_pOptions->recentFiles.count() > 0); |
m_pRecentFilesMenu->setEnabled(bHasClient && m_pOptions->recentFiles.count() > 0); |
1968 |
// Log success here. |
// Log success here. |
1969 |
appendMessages(tr("Client connected.")); |
appendMessages(tr("Client connected.")); |
1970 |
|
|
1971 |
|
// Hard-notify device configuration form, |
1972 |
|
// if visible, that we're ready... |
1973 |
|
if (m_pDeviceForm && m_pDeviceForm->isVisible()) |
1974 |
|
m_pDeviceForm->setClient(m_pClient); |
1975 |
|
|
1976 |
// Is any session pending to be loaded? |
// Is any session pending to be loaded? |
1977 |
if (!m_pOptions->sSessionFile.isEmpty()) { |
if (!m_pOptions->sSessionFile.isEmpty()) { |
1978 |
// Just load the prabably startup session... |
// Just load the prabably startup session... |
1993 |
if (m_pClient == NULL) |
if (m_pClient == NULL) |
1994 |
return; |
return; |
1995 |
|
|
1996 |
|
// Hard-notify device configuration form, |
1997 |
|
// if visible, that we're running out... |
1998 |
|
if (m_pDeviceForm && m_pDeviceForm->isVisible()) |
1999 |
|
m_pDeviceForm->setClient(NULL); |
2000 |
|
|
2001 |
// Log prepare here. |
// Log prepare here. |
2002 |
appendMessages(tr("Client disconnecting...")); |
appendMessages(tr("Client disconnecting...")); |
2003 |
|
|