598 |
if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) { |
if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) { |
599 |
appendMessagesClient("lscp_client_query"); |
appendMessagesClient("lscp_client_query"); |
600 |
iErrors++; |
iErrors++; |
|
break; |
|
601 |
} |
} |
602 |
} |
} |
603 |
// Try to make it snappy :) |
// Try to make it snappy :) |
607 |
// Ok. we've read it. |
// Ok. we've read it. |
608 |
file.close(); |
file.close(); |
609 |
|
|
|
// Have we any errors? |
|
|
if (iErrors > 0) |
|
|
appendMessagesError(tr("Session could not be loaded\nfrom \"%1\".\n\nSorry.").arg(sFilename)); |
|
|
|
|
610 |
// Now we'll try to create (update) the whole GUI session. |
// Now we'll try to create (update) the whole GUI session. |
611 |
updateSession(); |
updateSession(); |
612 |
|
|
613 |
|
// Have we any errors? |
614 |
|
if (iErrors > 0) |
615 |
|
appendMessagesError(tr("Session loaded with errors\nfrom \"%1\".\n\nSorry.").arg(sFilename)); |
616 |
|
|
617 |
// Save as default session directory. |
// Save as default session directory. |
618 |
if (m_pOptions) |
if (m_pOptions) |
619 |
m_pOptions->sSessionDir = QFileInfo(sFilename).dirPath(true); |
m_pOptions->sSessionDir = QFileInfo(sFilename).dirPath(true); |
620 |
// We're not dirty anymore. |
// We're not dirty anymore, if loaded without errors, |
621 |
m_iDirtyCount = 0; |
m_iDirtyCount = iErrors; |
622 |
// Stabilize form... |
// Stabilize form... |
623 |
m_sFilename = sFilename; |
m_sFilename = sFilename; |
624 |
updateRecentFiles(sFilename); |
updateRecentFiles(sFilename); |
668 |
ts << endl; |
ts << endl; |
669 |
qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]); |
qsamplerDevice device(m_pClient, qsamplerDevice::Audio, piDeviceIDs[iDevice]); |
670 |
// Audio device specification... |
// Audio device specification... |
671 |
ts << "# " << device.deviceTypeName() << " " << device.driverName() |
ts << "# " << device.deviceTypeName() << " " << device.driverName() |
672 |
<< " " << tr("Device") << " " << iDevice << endl; |
<< " " << tr("Device") << " " << iDevice << endl; |
673 |
ts << "CREATE AUDIO_OUTPUT_DEVICE " << device.driverName(); |
ts << "CREATE AUDIO_OUTPUT_DEVICE " << device.driverName(); |
674 |
qsamplerDeviceParamMap::ConstIterator deviceParam; |
qsamplerDeviceParamMap::ConstIterator deviceParam; |
675 |
for (deviceParam = device.params().begin(); |
for (deviceParam = device.params().begin(); |
676 |
deviceParam != device.params().end(); |
deviceParam != device.params().end(); |
677 |
++deviceParam) { |
++deviceParam) { |
678 |
ts << " " << deviceParam.key() |
const qsamplerDeviceParam& param = deviceParam.data(); |
679 |
<< "='" << deviceParam.data().value << "'"; |
if (!param.fix && !param.value.isEmpty()) |
680 |
|
ts << " " << deviceParam.key() << "='" << param.value << "'"; |
681 |
} |
} |
682 |
ts << endl; |
ts << endl; |
683 |
// Audio channel parameters... |
// Audio channel parameters... |
689 |
for (portParam = pPort->params().begin(); |
for (portParam = pPort->params().begin(); |
690 |
portParam != pPort->params().end(); |
portParam != pPort->params().end(); |
691 |
++portParam) { |
++portParam) { |
692 |
ts << "SET AUDIO_OUTPUT_CHANNEL_PARAMETER " << iDevice |
const qsamplerDeviceParam& param = portParam.data(); |
693 |
<< " " << iPort << " " << portParam.key() |
if (!param.fix && !param.value.isEmpty()) { |
694 |
<< "='" << portParam.data().value << "'" << endl; |
ts << "SET AUDIO_OUTPUT_CHANNEL_PARAMETER " << iDevice |
695 |
|
<< " " << iPort << " " << portParam.key() |
696 |
|
<< "='" << param.value << "'" << endl; |
697 |
|
} |
698 |
} |
} |
699 |
} |
} |
700 |
// Audio device index/id mapping. |
// Audio device index/id mapping. |
716 |
for (deviceParam = device.params().begin(); |
for (deviceParam = device.params().begin(); |
717 |
deviceParam != device.params().end(); |
deviceParam != device.params().end(); |
718 |
++deviceParam) { |
++deviceParam) { |
719 |
ts << " " << deviceParam.key() |
const qsamplerDeviceParam& param = deviceParam.data(); |
720 |
<< "='" << deviceParam.data().value << "'"; |
if (!param.fix && !param.value.isEmpty()) |
721 |
|
ts << " " << deviceParam.key() << "='" << param.value << "'"; |
722 |
} |
} |
723 |
ts << endl; |
ts << endl; |
724 |
// MIDI port parameters... |
// MIDI port parameters... |
730 |
for (portParam = pPort->params().begin(); |
for (portParam = pPort->params().begin(); |
731 |
portParam != pPort->params().end(); |
portParam != pPort->params().end(); |
732 |
++portParam) { |
++portParam) { |
733 |
ts << "SET MIDI_INPUT_PORT_PARAMETER " << iDevice |
const qsamplerDeviceParam& param = portParam.data(); |
734 |
<< " " << iPort << " " << portParam.key() |
if (!param.fix && !param.value.isEmpty()) { |
735 |
<< "='" << portParam.data().value << "'" << endl; |
ts << "SET MIDI_INPUT_CHANNEL_PARAMETER " << iDevice |
736 |
|
<< " " << iPort << " " << portParam.key() |
737 |
|
<< "='" << param.value << "'" << endl; |
738 |
|
} |
739 |
} |
} |
740 |
} |
} |
741 |
// MIDI device index/id mapping. |
// MIDI device index/id mapping. |