--- qsampler/trunk/src/qsamplerMainForm.ui.h 2006/12/19 11:19:55 987 +++ qsampler/trunk/src/qsamplerMainForm.ui.h 2007/01/15 11:27:22 1033 @@ -2,7 +2,7 @@ // // ui.h extension file, included from the uic-generated form implementation. /**************************************************************************** - Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -142,8 +142,10 @@ // Make it an MDI workspace. m_pWorkspace = new QWorkspace(this); m_pWorkspace->setScrollBarsEnabled(true); - // Set the activation connection. - QObject::connect(m_pWorkspace, SIGNAL(windowActivated(QWidget *)), this, SLOT(stabilizeForm())); + // Set the activation connection. + QObject::connect(m_pWorkspace, + SIGNAL(windowActivated(QWidget *)), + SLOT(stabilizeForm())); // Make it shine :-) setCentralWidget(m_pWorkspace); @@ -253,7 +255,7 @@ updateMessagesLimit(); updateMessagesCapture(); // Set the visibility signal. - QObject::connect(m_pMessages, + QObject::connect(m_pMessages, SIGNAL(visibilityChanged(bool)), SLOT(stabilizeForm())); @@ -651,16 +653,16 @@ iLine++; // If not empty, nor a comment, call the server... if (!sCommand.isEmpty() && sCommand[0] != '#') { - // Remember that, no matter what, - // all LSCP commands are CR/LF terminated. - sCommand += "\r\n"; - if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) { + // Remember that, no matter what, + // all LSCP commands are CR/LF terminated. + sCommand += "\r\n"; + if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) { appendMessagesColor(QString("%1(%2): %3") .arg(QFileInfo(sFilename).fileName()).arg(iLine) .arg(sCommand.simplifyWhiteSpace()), "#996633"); - appendMessagesClient("lscp_client_query"); - iErrors++; - } + appendMessagesClient("lscp_client_query"); + iErrors++; + } } // Try to make it snappy :) QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); @@ -875,30 +877,30 @@ appendMessagesClient("lscp_get_midi_instrument_info"); iErrors++; } - // MIDI device index/id mapping. - midiInstrumentMap[iMidiMap] = iMap; // Try to keep it snappy :) QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); } + ts << endl; // Check for errors... - if (pInstrs) - ts << endl; - else if (::lscp_client_get_errno(m_pClient)) { + if (pInstrs == NULL && ::lscp_client_get_errno(m_pClient)) { appendMessagesClient("lscp_list_midi_instruments"); iErrors++; } + // MIDI strument index/id mapping. + midiInstrumentMap[iMidiMap] = iMap; } // Check for errors... if (piMaps == NULL && ::lscp_client_get_errno(m_pClient)) { appendMessagesClient("lscp_list_midi_instrument_maps"); iErrors++; } -#endif // CONFIG_MIDI_INSTRUMENT +#endif // CONFIG_MIDI_INSTRUMENT // Sampler channel mapping. QWidgetList wlist = m_pWorkspace->windowList(); for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { - qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); + qsamplerChannelStrip *pChannelStrip + = static_cast (wlist.at(iChannel)); if (pChannelStrip) { qsamplerChannel *pChannel = pChannelStrip->channel(); if (pChannel) { @@ -950,6 +952,42 @@ << " " << midiInstrumentMap[pChannel->midiMap()] << endl; } #endif +#ifdef CONFIG_FXSEND + int iChannelID = pChannel->channelID(); + int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID); + for (int iFxSend = 0; + piFxSends && piFxSends[iFxSend] >= 0; + iFxSend++) { + lscp_fxsend_info_t *pFxSendInfo = ::lscp_get_fxsend_info( + m_pClient, iChannelID, piFxSends[iFxSend]); + if (pFxSendInfo) { + ts << "CREATE FX_SEND " << iChannel + << " " << pFxSendInfo->midi_controller; + if (pFxSendInfo->name) + ts << " '" << pFxSendInfo->name << "'"; + ts << endl; + int *piRouting = pFxSendInfo->audio_routing; + for (int iAudioSrc = 0; + piRouting && piRouting[iAudioSrc] >= 0; + iAudioSrc++) { + ts << "SET FX_SEND AUDIO_OUTPUT_CHANNEL " + << iChannel + << " " << iFxSend + << " " << iAudioSrc + << " " << piRouting[iAudioSrc] << endl; + } +#ifdef CONFIG_FXSEND_LEVEL + ts << "SET FX_SEND LEVEL " << iChannel + << " " << iFxSend + << " " << pFxSendInfo->level << endl; +#endif + } // Check for errors... + else if (::lscp_client_get_errno(m_pClient)) { + appendMessagesClient("lscp_get_fxsend_info"); + iErrors++; + } + } +#endif ts << endl; } } @@ -1054,12 +1092,17 @@ tr("Reset"), tr("Cancel")) > 0) return; + // Trye closing the current session, first... + if (!closeSession(true)) + return; + // Just do the reset, after closing down current session... - if (closeSession(true) && ::lscp_reset_sampler(m_pClient) != LSCP_OK) { - appendMessagesClient("lscp_reset_sampler"); - appendMessagesError(tr("Could not reset sampler instance.\n\nSorry.")); - return; - } + // Do the actual sampler reset... + if (::lscp_reset_sampler(m_pClient) != LSCP_OK) { + appendMessagesClient("lscp_reset_sampler"); + appendMessagesError(tr("Could not reset sampler instance.\n\nSorry.")); + return; + } // Log this. appendMessages(tr("Sampler reset.")); @@ -1493,6 +1536,16 @@ sText += tr("Sampler channel Mute/Solo support disabled."); sText += "
"; #endif +#ifndef CONFIG_AUDIO_ROUTING + sText += ""; + sText += tr("LSCP (liblscp) audio_routing support disabled."); + sText += "
"; +#endif +#ifndef CONFIG_FXSEND + sText += ""; + sText += tr("Sampler channel Effect Sends support disabled."); + sText += "
"; +#endif #ifndef CONFIG_MIDI_INSTRUMENT sText += ""; sText += tr("MIDI instrument mapping support disabled."); @@ -1610,7 +1663,7 @@ void qsamplerMainForm::updateSession (void) { #ifdef CONFIG_MIDI_INSTRUMENT - // FIXME Make some room for default instrument maps... + // FIXME: Make some room for default instrument maps... int iMaps = ::lscp_get_midi_instrument_maps(m_pClient); if (iMaps < 0) appendMessagesClient("lscp_get_midi_instrument_maps"); @@ -1911,7 +1964,9 @@ // Actual channel strip setup... pChannelStrip->setup(pChannel); - QObject::connect(pChannelStrip, SIGNAL(channelChanged(qsamplerChannelStrip *)), this, SLOT(channelStripChanged(qsamplerChannelStrip *))); + QObject::connect(pChannelStrip, + SIGNAL(channelChanged(qsamplerChannelStrip *)), + SLOT(channelStripChanged(qsamplerChannelStrip *))); // Set some initial aesthetic options... if (m_pOptions) { // Background display effect... @@ -2118,13 +2173,20 @@ m_pServer = new QProcess(this); // Setup stdout/stderr capture... - //if (m_pOptions->bStdoutCapture) { - m_pServer->setCommunication(QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr); - QObject::connect(m_pServer, SIGNAL(readyReadStdout()), this, SLOT(readServerStdout())); - QObject::connect(m_pServer, SIGNAL(readyReadStderr()), this, SLOT(readServerStdout())); - //} - // The unforgiveable signal communication... - QObject::connect(m_pServer, SIGNAL(processExited()), this, SLOT(processServerExit())); + // if (m_pOptions->bStdoutCapture) { + m_pServer->setCommunication( + QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr); + QObject::connect(m_pServer, + SIGNAL(readyReadStdout()), + SLOT(readServerStdout())); + QObject::connect(m_pServer, + SIGNAL(readyReadStderr()), + SLOT(readServerStdout())); + // } + // The unforgiveable signal communication... + QObject::connect(m_pServer, + SIGNAL(processExited()), + SLOT(processServerExit())); // Build process arguments... m_pServer->setArguments(QStringList::split(' ', m_pOptions->sServerCmdLine));