--- qsampler/trunk/src/qsamplerMainForm.ui.h 2005/06/18 22:44:56 664 +++ qsampler/trunk/src/qsamplerMainForm.ui.h 2006/11/29 11:48:26 957 @@ -2,7 +2,7 @@ // // ui.h extension file, included from the uic-generated form implementation. /**************************************************************************** - Copyright (C) 2004-2005, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2004-2006, 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 @@ -14,9 +14,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *****************************************************************************/ @@ -45,8 +45,6 @@ #include "qsamplerDeviceForm.h" #include "qsamplerOptionsForm.h" -#include "config.h" - #ifdef HAVE_SIGNAL_H #include #endif @@ -387,14 +385,15 @@ // 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"); } } } @@ -472,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? @@ -506,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()) @@ -519,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?") @@ -541,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?") @@ -599,7 +600,7 @@ QTextStream ts(&file); while (!ts.atEnd()) { // Read the line. - QString sCommand = ts.readLine().simplifyWhiteSpace(); + QString sCommand = ts.readLine().stripWhiteSpace(); // If not empty, nor a comment, call the server... if (!sCommand.isEmpty() && sCommand[0] != '#') { appendMessagesColor(sCommand, "#996633"); @@ -786,7 +787,19 @@ ts << endl; ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl; ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl; + qsamplerChannelRoutingMap::ConstIterator audioRoute; + for (audioRoute = pChannel->audioRouting().begin(); + audioRoute != pChannel->audioRouting().end(); + ++audioRoute) { + ts << "SET CHANNEL AUDIO_OUTPUT_CHANNEL " << iChannel + << " " << audioRoute.key() + << " " << audioRoute.data() << 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; } } @@ -794,6 +807,46 @@ QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); } +#ifdef CONFIG_MIDI_INSTRUMENT + // MIDI instrument mapping... + lscp_midi_instrument_t *pInstrs = ::lscp_list_midi_instruments(m_pClient); + if (pInstrs) + ts << "# " << tr("MIDI instrument mapping") << endl; + for (int iInstr = 0; pInstrs && pInstrs[iInstr].program >= 0; iInstr++) { + lscp_midi_instrument_info_t *pInstrInfo + = ::lscp_get_midi_instrument_info(m_pClient, &pInstrs[iInstr]); + if (pInstrInfo) { + ts << "MAP MIDI_INSTRUMENT " + << pInstrs[iInstr].bank_msb << " " + << pInstrs[iInstr].bank_lsb << " " + << pInstrs[iInstr].program << " " + << pInstrInfo->engine_name << " '" + << pInstrInfo->instrument_file << "' " + << pInstrInfo->instrument_nr << " " + << pInstrInfo->volume << " "; + switch (pInstrInfo->load_mode) { + case LSCP_LOAD_PERSISTENT: + ts << "PERSISTENT"; + break; + case LSCP_LOAD_ON_DEMAND_HOLD: + ts << "ON_DEMAND_HOLD"; + break; + case LSCP_LOAD_ON_DEMAND: + case LSCP_LOAD_DEFAULT: + default: + ts << "ON_DEMAND"; + break; + } + if (pInstrInfo->name) + ts << " '" << pInstrInfo->name << "'"; + ts << endl; + } + ts << endl; + // Try to keep it snappy :) + QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); + } +#endif // CONFIG_MIDI_INSTRUMENT + // Ok. we've wrote it. file.close(); @@ -878,7 +931,8 @@ 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" @@ -913,7 +967,8 @@ // 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" @@ -989,7 +1044,8 @@ // 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?") @@ -1172,7 +1228,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(); @@ -1300,6 +1357,11 @@ 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(); @@ -1307,9 +1369,9 @@ sText += ::lscp_client_version(); #ifdef CONFIG_LIBGIG sText += ", "; - sText += gig::libraryName(); + sText += gig::libraryName().c_str(); sText += " "; - sText += gig::libraryVersion(); + sText += gig::libraryVersion().c_str(); #endif sText += "
\n"; sText += "
\n"; @@ -1335,7 +1397,7 @@ // Update the main application caption... QString sSessionName = sessionName(m_sFilename); if (m_iDirtyCount > 0) - sSessionName += '*'; + sSessionName += " *"; setCaption(tr(QSAMPLER_TITLE " - [%1]").arg(sSessionName)); // Update the main menu state... @@ -1599,7 +1661,8 @@ appendMessagesColor(s.simplifyWhiteSpace(), "#ff0000"); - QMessageBox::critical(this, tr("Error"), s, tr("Cancel")); + QMessageBox::critical(this, + QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel")); } @@ -1871,7 +1934,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"))) {