43 |
|
|
44 |
#include "config.h" |
#include "config.h" |
45 |
|
|
|
#if !defined(WIN32) |
|
|
#include <unistd.h> |
|
|
#endif |
|
46 |
|
|
47 |
// Timer constant stuff. |
// Timer constant stuff. |
48 |
#define QSAMPLER_TIMER_MSECS 200 |
#define QSAMPLER_TIMER_MSECS 200 |
544 |
int iChannelID = pChannel->channelID(); |
int iChannelID = pChannel->channelID(); |
545 |
ts << "# " << pChannel->caption() << endl; |
ts << "# " << pChannel->caption() << endl; |
546 |
ts << "ADD CHANNEL" << endl; |
ts << "ADD CHANNEL" << endl; |
547 |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl; |
ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannelID << " " << pChannel->audioDriver() << endl; |
548 |
ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl; |
ts << "SET CHANNEL MIDI_INPUT_TYPE " << iChannelID << " " << pChannel->midiDriver() << endl; |
549 |
ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl; |
// ts << "SET CHANNEL MIDI_INPUT_PORT " << iChannelID << " " << pChannel->midiPort() << endl; |
550 |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " " << pChannel->midiChannel() << endl; |
ts << "SET CHANNEL MIDI_INPUT_CHANNEL " << iChannelID << " " << pChannel->midiChannel() << endl; |
551 |
ts << "SET CHANNEL AUDIO_OUTPUT_TYPE " << iChannelID << " " << pChannel->audioDriver() << endl; |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannelID << endl; |
|
ts << "SET CHANNEL VOLUME " << iChannelID << " " << pChannel->volume() << endl; |
|
552 |
ts << "LOAD INSTRUMENT " << pChannel->instrumentFile() << " " << pChannel->instrumentNr() << " " << iChannelID << endl; |
ts << "LOAD INSTRUMENT " << pChannel->instrumentFile() << " " << pChannel->instrumentNr() << " " << iChannelID << endl; |
553 |
|
ts << "SET CHANNEL VOLUME " << iChannelID << " " << pChannel->volume() << endl; |
554 |
ts << endl; |
ts << endl; |
555 |
// Try to keep it snappy :) |
// Try to keep it snappy :) |
556 |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
843 |
bool bOldServerStart = m_pOptions->bServerStart; |
bool bOldServerStart = m_pOptions->bServerStart; |
844 |
QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
845 |
QString sOldDisplayFont = m_pOptions->sDisplayFont; |
QString sOldDisplayFont = m_pOptions->sDisplayFont; |
846 |
|
int iOldMaxVolume = m_pOptions->iMaxVolume; |
847 |
QString sOldMessagesFont = m_pOptions->sMessagesFont; |
QString sOldMessagesFont = m_pOptions->sMessagesFont; |
848 |
bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
849 |
int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
869 |
updateRecentFilesMenu(); |
updateRecentFilesMenu(); |
870 |
if (sOldDisplayFont != m_pOptions->sDisplayFont) |
if (sOldDisplayFont != m_pOptions->sDisplayFont) |
871 |
updateDisplayFont(); |
updateDisplayFont(); |
872 |
|
if (iOldMaxVolume != m_pOptions->iMaxVolume) |
873 |
|
updateMaxVolume(); |
874 |
if (sOldMessagesFont != m_pOptions->sMessagesFont) |
if (sOldMessagesFont != m_pOptions->sMessagesFont) |
875 |
updateMessagesFont(); |
updateMessagesFont(); |
876 |
if (( bOldMessagesLimit && !m_pOptions->bMessagesLimit) || |
if (( bOldMessagesLimit && !m_pOptions->bMessagesLimit) || |
1127 |
} |
} |
1128 |
|
|
1129 |
|
|
1130 |
|
// Force update of the channels maximum volume setting. |
1131 |
|
void qsamplerMainForm::updateMaxVolume (void) |
1132 |
|
{ |
1133 |
|
if (m_pOptions == NULL) |
1134 |
|
return; |
1135 |
|
|
1136 |
|
// Full channel list update... |
1137 |
|
QWidgetList wlist = m_pWorkspace->windowList(); |
1138 |
|
if (wlist.isEmpty()) |
1139 |
|
return; |
1140 |
|
|
1141 |
|
m_pWorkspace->setUpdatesEnabled(false); |
1142 |
|
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
1143 |
|
qsamplerChannelStrip *pChannel = (qsamplerChannelStrip *) wlist.at(iChannel); |
1144 |
|
pChannel->setMaxVolume(m_pOptions->iMaxVolume); |
1145 |
|
} |
1146 |
|
m_pWorkspace->setUpdatesEnabled(true); |
1147 |
|
} |
1148 |
|
|
1149 |
|
|
1150 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1151 |
// qsamplerMainForm -- Messages window form handlers. |
// qsamplerMainForm -- Messages window form handlers. |
1152 |
|
|
1260 |
// Add a new channel itema... |
// Add a new channel itema... |
1261 |
WFlags wflags = Qt::WStyle_Customize | Qt::WStyle_Tool | Qt::WStyle_Title | Qt::WStyle_NoBorder; |
WFlags wflags = Qt::WStyle_Customize | Qt::WStyle_Tool | Qt::WStyle_Title | Qt::WStyle_NoBorder; |
1262 |
pChannel = new qsamplerChannelStrip(m_pWorkspace, 0, wflags); |
pChannel = new qsamplerChannelStrip(m_pWorkspace, 0, wflags); |
1263 |
|
pChannel->setMaxVolume(m_pOptions->iMaxVolume); |
1264 |
pChannel->setup(this, iChannelID); |
pChannel->setup(this, iChannelID); |
1265 |
// We'll need a display font. |
// We'll need a display font. |
1266 |
QFont font; |
QFont font; |
1462 |
// And try to stop server. |
// And try to stop server. |
1463 |
if (m_pServer) { |
if (m_pServer) { |
1464 |
appendMessages(tr("Server is stopping...")); |
appendMessages(tr("Server is stopping...")); |
1465 |
if (m_pServer->isRunning()) { |
if (m_pServer->isRunning()) |
1466 |
m_pServer->tryTerminate(); |
m_pServer->tryTerminate(); |
|
return; |
|
|
} |
|
1467 |
} |
} |
1468 |
|
|
1469 |
|
// Give it some time to terminate gracefully and stabilize... |
1470 |
|
QTime t; |
1471 |
|
t.start(); |
1472 |
|
while (t.elapsed() < QSAMPLER_TIMER_MSECS) |
1473 |
|
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
1474 |
|
|
1475 |
// Do final processing anyway. |
// Do final processing anyway. |
1476 |
processServerExit(); |
processServerExit(); |
1477 |
} |
} |