--- qsampler/trunk/src/qsamplerMainForm.cpp 2008/02/17 13:53:00 1702
+++ qsampler/trunk/src/qsamplerMainForm.cpp 2009/04/28 09:06:43 1890
@@ -1,7 +1,7 @@
// qsamplerMainForm.cpp
//
/****************************************************************************
- Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
+ Copyright (C) 2004-2009, rncbc aka Rui Nuno Capela. All rights reserved.
Copyright (C) 2007, 2008 Christian Schoenebeck
This program is free software; you can redistribute it and/or
@@ -391,6 +391,10 @@
#else
viewInstrumentsAction->setEnabled(false);
#endif
+ // Setup messages logging appropriately...
+ m_pMessages->setLogging(
+ m_pOptions->bMessagesLog,
+ m_pOptions->sMessagesLogPath);
// Set message defaults...
updateMessagesFont();
updateMessagesLimit();
@@ -581,7 +585,7 @@
case LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO:
if (m_pDeviceForm) m_pDeviceForm->refreshDevices();
break;
-#if CONFIG_LSCP_CHANNEL_MIDI
+#if CONFIG_EVENT_CHANNEL_MIDI
case LSCP_EVENT_CHANNEL_MIDI: {
const int iChannelID = pEvent->data().section(' ', 0, 0).toInt();
ChannelStrip *pChannelStrip = channelStrip(iChannelID);
@@ -590,7 +594,7 @@
break;
}
#endif
-#if CONFIG_LSCP_DEVICE_MIDI
+#if CONFIG_EVENT_DEVICE_MIDI
case LSCP_EVENT_DEVICE_MIDI: {
const int iDeviceID = pEvent->data().section(' ', 0, 0).toInt();
const int iPortID = pEvent->data().section(' ', 1, 1).toInt();
@@ -755,7 +759,8 @@
"\"%1\"\n\n"
"Do you want to replace it?")
.arg(sFilename),
- tr("Replace"), tr("Cancel")) > 0)
+ QMessageBox::Yes | QMessageBox::No)
+ == QMessageBox::No)
return false;
}
}
@@ -778,11 +783,13 @@
"\"%1\"\n\n"
"Do you want to save the changes?")
.arg(sessionName(m_sFilename)),
- tr("Save"), tr("Discard"), tr("Cancel"))) {
- case 0: // Save...
+ QMessageBox::Save |
+ QMessageBox::Discard |
+ QMessageBox::Cancel)) {
+ case QMessageBox::Save:
bClose = saveSession(false);
// Fall thru....
- case 1: // Discard
+ case QMessageBox::Discard:
break;
default: // Cancel.
bClose = false;
@@ -1303,7 +1310,8 @@
"Please note that this operation may cause\n"
"temporary MIDI and Audio disruption.\n\n"
"Do you want to reset the sampler engine now?"),
- tr("Reset"), tr("Cancel")) > 0)
+ QMessageBox::Ok | QMessageBox::Cancel)
+ == QMessageBox::Cancel)
return;
// Trye closing the current session, first...
@@ -1344,7 +1352,7 @@
"Please note that this operation may cause\n"
"temporary MIDI and Audio disruption.\n\n"
"Do you want to restart the connection now?"),
- tr("Restart"), tr("Cancel")) == 0);
+ QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok);
}
// Are we still for it?
@@ -1425,7 +1433,8 @@
"%1\n\n"
"Are you sure?")
.arg(pChannelStrip->windowTitle()),
- tr("OK"), tr("Cancel")) > 0)
+ QMessageBox::Ok | QMessageBox::Cancel)
+ == QMessageBox::Cancel)
return;
}
@@ -1616,6 +1625,8 @@
int iOldServerTimeout = m_pOptions->iServerTimeout;
bool bOldServerStart = m_pOptions->bServerStart;
QString sOldServerCmdLine = m_pOptions->sServerCmdLine;
+ bool bOldMessagesLog = m_pOptions->bMessagesLog;
+ QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath;
QString sOldDisplayFont = m_pOptions->sDisplayFont;
bool bOldDisplayEffect = m_pOptions->bDisplayEffect;
int iOldMaxVolume = m_pOptions->iMaxVolume;
@@ -1627,6 +1638,7 @@
bool bOldCompletePath = m_pOptions->bCompletePath;
bool bOldInstrumentNames = m_pOptions->bInstrumentNames;
int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles;
+ int iOldBaseFontSize = m_pOptions->iBaseFontSize;
// Load the current setup settings.
pOptionsForm->setup(m_pOptions);
// Show the setup dialog...
@@ -1635,14 +1647,20 @@
if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) ||
(!bOldStdoutCapture && m_pOptions->bStdoutCapture) ||
( bOldKeepOnTop && !m_pOptions->bKeepOnTop) ||
- (!bOldKeepOnTop && m_pOptions->bKeepOnTop)) {
+ (!bOldKeepOnTop && m_pOptions->bKeepOnTop) ||
+ (iOldBaseFontSize != m_pOptions->iBaseFontSize)) {
QMessageBox::information(this,
QSAMPLER_TITLE ": " + tr("Information"),
tr("Some settings may be only effective\n"
- "next time you start this program."), tr("OK"));
+ "next time you start this program."));
updateMessagesCapture();
}
// Check wheather something immediate has changed.
+ if (( bOldMessagesLog && !m_pOptions->bMessagesLog) ||
+ (!bOldMessagesLog && m_pOptions->bMessagesLog) ||
+ (sOldMessagesLogPath != m_pOptions->sMessagesLogPath))
+ m_pMessages->setLogging(
+ m_pOptions->bMessagesLog, m_pOptions->sMessagesLogPath);
if (( bOldCompletePath && !m_pOptions->bCompletePath) ||
(!bOldCompletePath && m_pOptions->bCompletePath) ||
(iOldMaxRecentFiles != m_pOptions->iMaxRecentFiles))
@@ -1797,6 +1815,21 @@
sText += tr("Instrument editing support disabled.");
sText += "
";
#endif
+#ifndef CONFIG_EVENT_CHANNEL_MIDI
+ sText += "";
+ sText += tr("Channel MIDI event support disabled.");
+ sText += "
";
+#endif
+#ifndef CONFIG_EVENT_DEVICE_MIDI
+ sText += "";
+ sText += tr("Device MIDI event support disabled.");
+ sText += "
";
+#endif
+#ifndef CONFIG_MAX_VOICES
+ sText += "";
+ sText += tr("Runtime max. voices / disk streams support disabled.");
+ sText += "
";
+#endif
sText += "
\n";
sText += tr("Using") + ": ";
sText += ::lscp_client_package();
@@ -2200,7 +2233,7 @@
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
QMessageBox::critical(this,
- QSAMPLER_TITLE ": " + tr("Error"), s, tr("Cancel"));
+ QSAMPLER_TITLE ": " + tr("Error"), s, QMessageBox::Cancel);
}
@@ -2488,17 +2521,13 @@
// Is the server process instance still here?
if (m_pServer) {
- switch (QMessageBox::warning(this,
+ if (QMessageBox::warning(this,
QSAMPLER_TITLE ": " + tr("Warning"),
tr("Could not start the LinuxSampler server.\n\n"
"Maybe it is already started."),
- tr("Stop"), tr("Kill"), tr("Cancel"))) {
- case 0:
+ QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
m_pServer->terminate();
- break;
- case 1:
m_pServer->kill();
- break;
}
return;
}
@@ -2572,9 +2601,8 @@
"running in the background. The sampler would continue to work\n"
"according to your current sampler session and you could alter the\n"
"sampler session at any time by relaunching QSampler.\n\n"
- "Do you want LinuxSampler to stop or to keep running in\n"
- "the background?"),
- tr("Stop"), tr("Keep Running")) == 1)
+ "Do you want LinuxSampler to stop?"),
+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
{
bForceServerStop = false;
}
@@ -2721,13 +2749,13 @@
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO) != LSCP_OK)
appendMessagesClient("lscp_client_subscribe(AUDIO_OUTPUT_DEVICE_INFO)");
-#if CONFIG_LSCP_CHANNEL_MIDI
+#if CONFIG_EVENT_CHANNEL_MIDI
// Subscribe to channel MIDI data notifications...
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI) != LSCP_OK)
appendMessagesClient("lscp_client_subscribe(CHANNEL_MIDI)");
#endif
-#if CONFIG_LSCP_DEVICE_MIDI
+#if CONFIG_EVENT_DEVICE_MIDI
// Subscribe to channel MIDI data notifications...
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI) != LSCP_OK)
appendMessagesClient("lscp_client_subscribe(DEVICE_MIDI)");
@@ -2758,6 +2786,9 @@
}
}
+ // send the current / loaded fine tuning settings to the sampler
+ m_pOptions->sendFineTuningSettings();
+
// Make a new session
return newSession();
}
@@ -2785,10 +2816,10 @@
closeSession(false);
// Close us as a client...
-#if CONFIG_LSCP_DEVICE_MIDI
+#if CONFIG_EVENT_DEVICE_MIDI
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_DEVICE_MIDI);
#endif
-#if CONFIG_LSCP_CHANNEL_MIDI
+#if CONFIG_EVENT_CHANNEL_MIDI
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_CHANNEL_MIDI);
#endif
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_AUDIO_OUTPUT_DEVICE_INFO);