--- qsampler/trunk/src/qsamplerMainForm.ui.h 2005/03/14 12:59:27 455 +++ qsampler/trunk/src/qsamplerMainForm.ui.h 2005/08/26 23:04:32 757 @@ -45,12 +45,14 @@ #include "qsamplerDeviceForm.h" #include "qsamplerOptionsForm.h" -#include "config.h" - #ifdef HAVE_SIGNAL_H #include #endif +#ifdef CONFIG_LIBGIG +#include +#endif + // Timer constant stuff. #define QSAMPLER_TIMER_MSECS 200 @@ -218,6 +220,7 @@ // Some child forms are to be created right now. m_pMessages = new qsamplerMessages(this); m_pDeviceForm = new qsamplerDeviceForm(this, 0, wflags); + m_pDeviceForm->setMainForm(this); // An important life immutable! // Set message defaults... updateMessagesFont(); updateMessagesLimit(); @@ -287,11 +290,11 @@ ostr << *this; m_pOptions->settings().writeEntry("/Layout/DockWindows", sDockables); // And the children, and the main windows state,. - m_pOptions->saveWidgetGeometry(m_pDeviceForm); - m_pOptions->saveWidgetGeometry(this); - // Close popup widgets. - if (m_pDeviceForm) - m_pDeviceForm->close(); + m_pOptions->saveWidgetGeometry(m_pDeviceForm); + m_pOptions->saveWidgetGeometry(this); + // Close popup widgets. + if (m_pDeviceForm) + m_pDeviceForm->close(); // Stop client and/or server, gracefully. stopServer(); } @@ -344,29 +347,29 @@ if (!decodeDragFiles(pDropEvent, files)) return; - for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) { + for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) { const QString& sPath = *iter; if (qsamplerChannel::isInstrumentFile(sPath)) { // Try to create a new channel from instrument file... - qsamplerChannel *pChannel = new qsamplerChannel(this); - if (pChannel == NULL) - return; + qsamplerChannel *pChannel = new qsamplerChannel(this); + if (pChannel == NULL) + return; // Start setting the instrument filename... pChannel->setInstrument(sPath, 0); - // Before we show it up, may be we'll - // better ask for some initial values? - if (!pChannel->channelSetup(this)) { - delete pChannel; - return; - } - // Finally, give it to a new channel strip... + // Before we show it up, may be we'll + // better ask for some initial values? + if (!pChannel->channelSetup(this)) { + delete pChannel; + return; + } + // Finally, give it to a new channel strip... if (!createChannelStrip(pChannel)) { - delete pChannel; - return; + delete pChannel; + return; } - // Make that an overall update. - m_iDirtyCount++; - stabilizeForm(); + // Make that an overall update. + m_iDirtyCount++; + stabilizeForm(); } // Otherwise, load an usual session file (LSCP script)... else if (closeSession(true)) loadSessionFile(sPath); @@ -382,9 +385,16 @@ // For the time being, just pump it to messages. if (pCustomEvent->type() == QSAMPLER_CUSTOM_EVENT) { qsamplerCustomEvent *pEvent = (qsamplerCustomEvent *) pCustomEvent; - appendMessagesColor(tr("Notify event: %1 data: %2") - .arg(::lscp_event_to_text(pEvent->event())) - .arg(pEvent->data()), "#996699"); + if (pEvent->event() == LSCP_EVENT_CHANNEL_INFO) { + int iChannelID = pEvent->data().toInt(); + qsamplerChannelStrip *pChannelStrip = channelStrip(iChannelID); + if (pChannelStrip) + channelStripChanged(pChannelStrip); + } else { + appendMessagesColor(tr("Notify event: %1 data: %2") + .arg(::lscp_event_to_text(pEvent->event())) + .arg(pEvent->data()), "#996699"); + } } } @@ -393,7 +403,7 @@ void qsamplerMainForm::contextMenuEvent( QContextMenuEvent *pEvent ) { stabilizeForm(); - + editMenu->exec(pEvent->globalPos()); } @@ -461,10 +471,10 @@ // Ask for the filename to open... QString sFilename = QFileDialog::getOpenFileName( - m_pOptions->sSessionDir, // Start here. - tr("LSCP Session files") + " (*.lscp)", // Filter (LSCP files) - this, 0, // Parent and name (none) - tr("Open Session") // Caption. + m_pOptions->sSessionDir, // Start here. + tr("LSCP Session files") + " (*.lscp)", // Filter (LSCP files) + this, 0, // Parent and name (none) + QSAMPLER_TITLE ": " + tr("Open Session") // Caption. ); // Have we cancelled? @@ -495,10 +505,10 @@ sFilename = m_pOptions->sSessionDir; // Prompt the guy... sFilename = QFileDialog::getSaveFileName( - sFilename, // Start here. - tr("LSCP Session files") + " (*.lscp)", // Filter (LSCP files) - this, 0, // Parent and name (none) - tr("Save Session") // Caption. + sFilename, // Start here. + tr("LSCP Session files") + " (*.lscp)", // Filter (LSCP files) + this, 0, // Parent and name (none) + QSAMPLER_TITLE ": " + tr("Save Session") // Caption. ); // Have we cancelled it? if (sFilename.isEmpty()) @@ -508,7 +518,8 @@ sFilename += ".lscp"; // Check if already exists... if (sFilename != m_sFilename && QFileInfo(sFilename).exists()) { - if (QMessageBox::warning(this, tr("Warning"), + if (QMessageBox::warning(this, + QSAMPLER_TITLE ": " + tr("Warning"), tr("The file already exists:\n\n" "\"%1\"\n\n" "Do you want to replace it?") @@ -530,7 +541,8 @@ // Are we dirty enough to prompt it? if (m_iDirtyCount > 0) { - switch (QMessageBox::warning(this, tr("Warning"), + switch (QMessageBox::warning(this, + QSAMPLER_TITLE ": " + tr("Warning"), tr("The current session has been changed:\n\n" "\"%1\"\n\n" "Do you want to save the changes?") @@ -598,7 +610,6 @@ if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) { appendMessagesClient("lscp_client_query"); iErrors++; - break; } } // Try to make it snappy :) @@ -608,23 +619,23 @@ // Ok. we've read it. file.close(); - // Have we any errors? - if (iErrors > 0) - appendMessagesError(tr("Session could not be loaded\nfrom \"%1\".\n\nSorry.").arg(sFilename)); - // Now we'll try to create (update) the whole GUI session. updateSession(); + // Have we any errors? + if (iErrors > 0) + appendMessagesError(tr("Session loaded with errors\nfrom \"%1\".\n\nSorry.").arg(sFilename)); + // Save as default session directory. if (m_pOptions) m_pOptions->sSessionDir = QFileInfo(sFilename).dirPath(true); - // We're not dirty anymore. - m_iDirtyCount = 0; + // We're not dirty anymore, if loaded without errors, + m_iDirtyCount = iErrors; // Stabilize form... m_sFilename = sFilename; updateRecentFiles(sFilename); appendMessages(tr("Open session: \"%1\".").arg(sessionName(m_sFilename))); - + // Make that an overall update. stabilizeForm(); return true; @@ -666,16 +677,38 @@ QMap audioDeviceMap; piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio); for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) { - qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]); ts << endl; - ts << "# " << device.deviceTypeName() << " " << device.driverName() - << " " << tr("Device") << " " << iDevice << endl; + qsamplerDevice device(this, qsamplerDevice::Audio, piDeviceIDs[iDevice]); + // Audio device specification... + ts << "# " << device.deviceTypeName() << " " << device.driverName() + << " " << tr("Device") << " " << iDevice << endl; ts << "CREATE AUDIO_OUTPUT_DEVICE " << device.driverName(); - qsamplerDeviceParamMap& params = device.params(); - qsamplerDeviceParamMap::ConstIterator iter; - for (iter = params.begin(); iter != params.end(); ++iter) - ts << " " << iter.key() << "='" << iter.data().value << "'"; + qsamplerDeviceParamMap::ConstIterator deviceParam; + for (deviceParam = device.params().begin(); + deviceParam != device.params().end(); + ++deviceParam) { + const qsamplerDeviceParam& param = deviceParam.data(); + if (param.value.isEmpty()) ts << "# "; + ts << " " << deviceParam.key() << "='" << param.value << "'"; + } ts << endl; + // Audio channel parameters... + int iPort = 0; + for (qsamplerDevicePort *pPort = device.ports().first(); + pPort; + pPort = device.ports().next(), ++iPort) { + qsamplerDeviceParamMap::ConstIterator portParam; + for (portParam = pPort->params().begin(); + portParam != pPort->params().end(); + ++portParam) { + const qsamplerDeviceParam& param = portParam.data(); + if (param.fix || param.value.isEmpty()) ts << "# "; + ts << "SET AUDIO_OUTPUT_CHANNEL_PARAMETER " << iDevice + << " " << iPort << " " << portParam.key() + << "='" << param.value << "'" << endl; + } + } + // Audio device index/id mapping. audioDeviceMap[device.deviceID()] = iDevice; // Try to keep it snappy :) QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); @@ -684,15 +717,38 @@ QMap midiDeviceMap; piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi); for (iDevice = 0; piDeviceIDs && piDeviceIDs[iDevice] >= 0; iDevice++) { - qsamplerDevice device(m_pClient, qsamplerDevice::Midi, piDeviceIDs[iDevice]); - ts << "# " << device.deviceTypeName() << " " << device.driverName() - << " " << tr("Device") << " " << iDevice << endl; + ts << endl; + qsamplerDevice device(this, qsamplerDevice::Midi, piDeviceIDs[iDevice]); + // MIDI device specification... + ts << "# " << device.deviceTypeName() << " " << device.driverName() + << " " << tr("Device") << " " << iDevice << endl; ts << "CREATE MIDI_INPUT_DEVICE " << device.driverName(); - qsamplerDeviceParamMap& params = device.params(); - qsamplerDeviceParamMap::ConstIterator iter; - for (iter = params.begin(); iter != params.end(); ++iter) - ts << " " << iter.key() << "='" << iter.data().value << "'"; + qsamplerDeviceParamMap::ConstIterator deviceParam; + for (deviceParam = device.params().begin(); + deviceParam != device.params().end(); + ++deviceParam) { + const qsamplerDeviceParam& param = deviceParam.data(); + if (param.value.isEmpty()) ts << "# "; + ts << " " << deviceParam.key() << "='" << param.value << "'"; + } ts << endl; + // MIDI port parameters... + int iPort = 0; + for (qsamplerDevicePort *pPort = device.ports().first(); + pPort; + pPort = device.ports().next(), ++iPort) { + qsamplerDeviceParamMap::ConstIterator portParam; + for (portParam = pPort->params().begin(); + portParam != pPort->params().end(); + ++portParam) { + const qsamplerDeviceParam& param = portParam.data(); + if (param.fix || param.value.isEmpty()) ts << "# "; + ts << "SET MIDI_INPUT_PORT_PARAMETER " << iDevice + << " " << iPort << " " << portParam.key() + << "='" << param.value << "'" << endl; + } + } + // MIDI device index/id mapping. midiDeviceMap[device.deviceID()] = iDevice; // Try to keep it snappy :) QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); @@ -707,22 +763,22 @@ if (pChannel) { ts << "# " << tr("Channel") << " " << iChannel << endl; ts << "ADD CHANNEL" << endl; - if (audioDeviceMap.isEmpty()) { - ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannel - << " " << pChannel->audioDriver() << endl; - } else { - ts << "SET CHANNEL AUDIO_OUTPUT_DEVICE " << iChannel - << " " << audioDeviceMap[pChannel->audioDevice()] << endl; + if (audioDeviceMap.isEmpty()) { + ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannel + << " " << pChannel->audioDriver() << endl; + } else { + ts << "SET CHANNEL AUDIO_OUTPUT_DEVICE " << iChannel + << " " << audioDeviceMap[pChannel->audioDevice()] << endl; + } + if (midiDeviceMap.isEmpty()) { + ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannel + << " " << pChannel->midiDriver() << endl; + } else { + ts << "SET CHANNEL MIDI_INPUT_DEVICE " << iChannel + << " " << midiDeviceMap[pChannel->midiDevice()] << endl; } - if (midiDeviceMap.isEmpty()) { - ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannel - << " " << pChannel->midiDriver() << endl; - } else { - ts << "SET CHANNEL MIDI_INPUT_DEVICE " << iChannel - << " " << midiDeviceMap[pChannel->midiDevice()] << endl; - } - ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannel - << " " << pChannel->midiPort() << endl; + ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannel + << " " << pChannel->midiPort() << endl; ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannel << " "; if (pChannel->midiChannel() == LSCP_MIDI_CHANNEL_ALL) ts << "ALL"; @@ -732,6 +788,10 @@ ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl; ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl; ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl; + if (pChannel->channelMute()) + ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl; + if (pChannel->channelSolo()) + ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl; ts << endl; } } @@ -823,11 +883,12 @@ return; // Ask user whether he/she want's an internal sampler reset... - if (QMessageBox::warning(this, tr("Warning"), + if (QMessageBox::warning(this, + QSAMPLER_TITLE ": " + tr("Warning"), tr("Resetting the sampler instance will close\n" "all device and channel configurations.\n\n" "Please note that this operation may cause\n" - "temporary MIDI and Audio disruption\n\n" + "temporary MIDI and Audio disruption.\n\n" "Do you want to reset the sampler engine now?"), tr("Reset"), tr("Cancel")) > 0) return; @@ -852,17 +913,18 @@ { if (m_pOptions == NULL) return; - + bool bRestart = true; - + // Ask user whether he/she want's a complete restart... // (if we're currently up and running) if (bRestart && m_pClient) { - bRestart = (QMessageBox::warning(this, tr("Warning"), + bRestart = (QMessageBox::warning(this, + QSAMPLER_TITLE ": " + tr("Warning"), tr("New settings will be effective after\n" "restarting the client/server connection.\n\n" "Please note that this operation may cause\n" - "temporary MIDI and Audio disruption\n\n" + "temporary MIDI and Audio disruption.\n\n" "Do you want to restart the connection now?"), tr("Restart"), tr("Cancel")) == 0); } @@ -905,7 +967,7 @@ delete pChannel; return; } - + // And give it to the strip (will own the channel instance, if successful). if (!createChannelStrip(pChannel)) { delete pChannel; @@ -927,14 +989,15 @@ qsamplerChannelStrip *pChannelStrip = activeChannelStrip(); if (pChannelStrip == NULL) return; - + qsamplerChannel *pChannel = pChannelStrip->channel(); if (pChannel == NULL) return; // Prompt user if he/she's sure about this... if (m_pOptions && m_pOptions->bConfirmRemove) { - if (QMessageBox::warning(this, tr("Warning"), + if (QMessageBox::warning(this, + QSAMPLER_TITLE ": " + tr("Warning"), tr("About to remove channel:\n\n" "%1\n\n" "Are you sure?") @@ -949,7 +1012,7 @@ // Just delete the channel strip. delete pChannelStrip; - + // Do we auto-arrange? if (m_pOptions && m_pOptions->bAutoArrange) channelsArrange(); @@ -993,19 +1056,19 @@ // Reset all sampler channels. void qsamplerMainForm::editResetAllChannels (void) { - if (m_pClient == NULL) - return; + if (m_pClient == NULL) + return; - // Invoque the channel strip procedure, + // Invoque the channel strip procedure, // for all channels out there... - m_pWorkspace->setUpdatesEnabled(false); - QWidgetList wlist = m_pWorkspace->windowList(); - for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { - qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); - if (pChannelStrip) - pChannelStrip->channelReset(); - } - m_pWorkspace->setUpdatesEnabled(true); + m_pWorkspace->setUpdatesEnabled(false); + QWidgetList wlist = m_pWorkspace->windowList(); + for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { + qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); + if (pChannelStrip) + pChannelStrip->channelReset(); + } + m_pWorkspace->setUpdatesEnabled(true); } @@ -1060,20 +1123,20 @@ // Show/hide the device configurator form. void qsamplerMainForm::viewDevices (void) { - if (m_pOptions == NULL) - return; + if (m_pOptions == NULL) + return; - if (m_pDeviceForm) { - m_pOptions->saveWidgetGeometry(m_pDeviceForm); + if (m_pDeviceForm) { + m_pOptions->saveWidgetGeometry(m_pDeviceForm); m_pDeviceForm->setClient(m_pClient); - if (m_pDeviceForm->isVisible()) { - m_pDeviceForm->hide(); - } else { - m_pDeviceForm->show(); - m_pDeviceForm->raise(); - m_pDeviceForm->setActiveWindow(); - } - } + if (m_pDeviceForm->isVisible()) { + m_pDeviceForm->hide(); + } else { + m_pDeviceForm->show(); + m_pDeviceForm->raise(); + m_pDeviceForm->setActiveWindow(); + } + } } @@ -1117,7 +1180,8 @@ (!bOldStdoutCapture && m_pOptions->bStdoutCapture) || ( bOldKeepOnTop && !m_pOptions->bKeepOnTop) || (!bOldKeepOnTop && m_pOptions->bKeepOnTop)) { - QMessageBox::information(this, tr("Information"), + QMessageBox::information(this, + QSAMPLER_TITLE ": " + tr("Information"), tr("Some settings may be only effective\n" "next time you start this program."), tr("OK")); updateMessagesCapture(); @@ -1191,7 +1255,7 @@ y += iHeight; } m_pWorkspace->setUpdatesEnabled(true); - + stabilizeForm(); } @@ -1245,11 +1309,22 @@ sText += tr("LSCP (liblscp) instrument_name support disabled."); sText += "
"; #endif +#ifndef CONFIG_MUTE_SOLO + sText += ""; + sText += tr("Sampler channel Mute/Solo support disabled."); + sText += "
"; +#endif sText += "
\n"; sText += tr("Using") + ": "; sText += ::lscp_client_package(); sText += " "; sText += ::lscp_client_version(); +#ifdef CONFIG_LIBGIG + sText += ", "; + sText += gig::libraryName().c_str(); + sText += " "; + sText += gig::libraryVersion().c_str(); +#endif sText += "
\n"; sText += "
\n"; sText += tr("Website") + ": " QSAMPLER_WEBSITE "
\n"; @@ -1329,8 +1404,10 @@ void qsamplerMainForm::channelStripChanged( qsamplerChannelStrip *pChannelStrip ) { // Add this strip to the changed list... - if (m_changedStrips.containsRef(pChannelStrip) == 0) + if (m_changedStrips.containsRef(pChannelStrip) == 0) { m_changedStrips.append(pChannelStrip); + pChannelStrip->resetErrorCount(); + } // Just mark the dirty form. m_iDirtyCount++; @@ -1362,6 +1439,10 @@ QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); } m_pWorkspace->setUpdatesEnabled(true); + + // Remember to refresh devices + if (m_pDeviceForm) + m_pDeviceForm->refreshDevices(); } @@ -1532,7 +1613,8 @@ appendMessagesColor(s.simplifyWhiteSpace(), "#ff0000"); - QMessageBox::critical(this, tr("Error"), s, tr("Cancel")); + QMessageBox::critical(this, + QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel")); } @@ -1572,7 +1654,7 @@ if (m_pOptions->bMessagesLimit) m_pMessages->setMessagesLimit(m_pOptions->iMessagesLimitLines); else - m_pMessages->setMessagesLimit(0); + m_pMessages->setMessagesLimit(-1); } } @@ -1616,7 +1698,7 @@ pChannelStrip = new qsamplerChannelStrip(m_pWorkspace, 0, wflags); if (pChannelStrip == NULL) return NULL; - + // Actual channel strip setup... pChannelStrip->setup(pChannel); QObject::connect(pChannelStrip, SIGNAL(channelChanged(qsamplerChannelStrip *)), this, SLOT(channelStripChanged(qsamplerChannelStrip *))); @@ -1674,7 +1756,7 @@ QWidgetList wlist = m_pWorkspace->windowList(); if (wlist.isEmpty()) return NULL; - + for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); if (pChannelStrip) { @@ -1755,29 +1837,34 @@ } } } - - // Refresh each channel usage, on each period... - if (m_pClient && (m_changedStrips.count() > 0 || m_pOptions->bAutoRefresh)) { - m_iTimerSlot += QSAMPLER_TIMER_MSECS; - if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime && m_pWorkspace->isUpdatesEnabled()) { - m_iTimerSlot = 0; - // Update the channel information for each pending strip... - for (qsamplerChannelStrip *pChannelStrip = m_changedStrips.first(); - pChannelStrip; - pChannelStrip = m_changedStrips.next()) { + + if (m_pClient) { + // Update the channel information for each pending strip... + if (m_changedStrips.count() > 0) { + for (qsamplerChannelStrip *pChannelStrip = m_changedStrips.first(); + pChannelStrip; pChannelStrip = m_changedStrips.next()) { // If successfull, remove from pending list... if (pChannelStrip->updateChannelInfo()) - m_changedStrips.remove(pChannelStrip); + m_changedStrips.remove(pChannelStrip); } - // Update the channel stream usage for each strip... - QWidgetList wlist = m_pWorkspace->windowList(); - for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { - qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); - if (pChannelStrip && pChannelStrip->isVisible()) - pChannelStrip->updateChannelUsage(); - } - } - } + } + // Refresh each channel usage, on each period... + if (m_pOptions->bAutoRefresh) { + m_iTimerSlot += QSAMPLER_TIMER_MSECS; + if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime) { + m_iTimerSlot = 0; + // Update the channel stream usage for each strip... + QWidgetList wlist = m_pWorkspace->windowList(); + for (int iChannel = 0; + iChannel < (int) wlist.count(); iChannel++) { + qsamplerChannelStrip *pChannelStrip + = (qsamplerChannelStrip *) wlist.at(iChannel); + if (pChannelStrip && pChannelStrip->isVisible()) + pChannelStrip->updateChannelUsage(); + } + } + } + } // Register the next timer slot. QTimer::singleShot(QSAMPLER_TIMER_MSECS, this, SLOT(timerSlot())); @@ -1799,7 +1886,8 @@ // Is the server process instance still here? if (m_pServer) { - switch (QMessageBox::warning(this, tr("Warning"), + switch (QMessageBox::warning(this, + QSAMPLER_TITLE ": " + tr("Warning"), tr("Could not start the LinuxSampler server.\n\n" "Maybe it ss already started."), tr("Stop"), tr("Kill"), tr("Cancel"))) { @@ -1958,6 +2046,10 @@ ::lscp_client_set_timeout(m_pClient, m_pOptions->iServerTimeout); appendMessages(tr("Client receive timeout is set to %1 msec.").arg(::lscp_client_get_timeout(m_pClient))); + // Subscribe to channel info change notifications... + if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_CHANNEL_INFO) != LSCP_OK) + appendMessagesClient("lscp_client_subscribe"); + // We may stop scheduling around. stopSchedule(); @@ -1971,7 +2063,7 @@ // if visible, that we're ready... if (m_pDeviceForm && m_pDeviceForm->isVisible()) m_pDeviceForm->setClient(m_pClient); - + // Is any session pending to be loaded? if (!m_pOptions->sSessionFile.isEmpty()) { // Just load the prabably startup session... @@ -2011,9 +2103,10 @@ // channels from the back-end server. m_iDirtyCount = 0; closeSession(false); - + // Close us as a client... - lscp_client_destroy(m_pClient); + ::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_CHANNEL_INFO); + ::lscp_client_destroy(m_pClient); m_pClient = NULL; // Log final here.