2 |
// |
// |
3 |
// ui.h extension file, included from the uic-generated form implementation. |
// ui.h extension file, included from the uic-generated form implementation. |
4 |
/**************************************************************************** |
/**************************************************************************** |
5 |
Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
142 |
// Make it an MDI workspace. |
// Make it an MDI workspace. |
143 |
m_pWorkspace = new QWorkspace(this); |
m_pWorkspace = new QWorkspace(this); |
144 |
m_pWorkspace->setScrollBarsEnabled(true); |
m_pWorkspace->setScrollBarsEnabled(true); |
145 |
// Set the activation connection. |
// Set the activation connection. |
146 |
QObject::connect(m_pWorkspace, SIGNAL(windowActivated(QWidget *)), this, SLOT(stabilizeForm())); |
QObject::connect(m_pWorkspace, |
147 |
|
SIGNAL(windowActivated(QWidget *)), |
148 |
|
SLOT(stabilizeForm())); |
149 |
// Make it shine :-) |
// Make it shine :-) |
150 |
setCentralWidget(m_pWorkspace); |
setCentralWidget(m_pWorkspace); |
151 |
|
|
255 |
updateMessagesLimit(); |
updateMessagesLimit(); |
256 |
updateMessagesCapture(); |
updateMessagesCapture(); |
257 |
// Set the visibility signal. |
// Set the visibility signal. |
258 |
QObject::connect(m_pMessages, |
QObject::connect(m_pMessages, |
259 |
SIGNAL(visibilityChanged(bool)), |
SIGNAL(visibilityChanged(bool)), |
260 |
SLOT(stabilizeForm())); |
SLOT(stabilizeForm())); |
261 |
|
|
653 |
iLine++; |
iLine++; |
654 |
// If not empty, nor a comment, call the server... |
// If not empty, nor a comment, call the server... |
655 |
if (!sCommand.isEmpty() && sCommand[0] != '#') { |
if (!sCommand.isEmpty() && sCommand[0] != '#') { |
656 |
// Remember that, no matter what, |
// Remember that, no matter what, |
657 |
// all LSCP commands are CR/LF terminated. |
// all LSCP commands are CR/LF terminated. |
658 |
sCommand += "\r\n"; |
sCommand += "\r\n"; |
659 |
if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) { |
if (::lscp_client_query(m_pClient, sCommand.latin1()) != LSCP_OK) { |
660 |
appendMessagesColor(QString("%1(%2): %3") |
appendMessagesColor(QString("%1(%2): %3") |
661 |
.arg(QFileInfo(sFilename).fileName()).arg(iLine) |
.arg(QFileInfo(sFilename).fileName()).arg(iLine) |
662 |
.arg(sCommand.simplifyWhiteSpace()), "#996633"); |
.arg(sCommand.simplifyWhiteSpace()), "#996633"); |
663 |
appendMessagesClient("lscp_client_query"); |
appendMessagesClient("lscp_client_query"); |
664 |
iErrors++; |
iErrors++; |
665 |
} |
} |
666 |
} |
} |
667 |
// Try to make it snappy :) |
// Try to make it snappy :) |
668 |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
877 |
appendMessagesClient("lscp_get_midi_instrument_info"); |
appendMessagesClient("lscp_get_midi_instrument_info"); |
878 |
iErrors++; |
iErrors++; |
879 |
} |
} |
|
// MIDI device index/id mapping. |
|
|
midiInstrumentMap[iMidiMap] = iMap; |
|
880 |
// Try to keep it snappy :) |
// Try to keep it snappy :) |
881 |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
882 |
} |
} |
883 |
|
ts << endl; |
884 |
// Check for errors... |
// Check for errors... |
885 |
if (pInstrs) |
if (pInstrs == NULL && ::lscp_client_get_errno(m_pClient)) { |
|
ts << endl; |
|
|
else if (::lscp_client_get_errno(m_pClient)) { |
|
886 |
appendMessagesClient("lscp_list_midi_instruments"); |
appendMessagesClient("lscp_list_midi_instruments"); |
887 |
iErrors++; |
iErrors++; |
888 |
} |
} |
889 |
|
// MIDI strument index/id mapping. |
890 |
|
midiInstrumentMap[iMidiMap] = iMap; |
891 |
} |
} |
892 |
// Check for errors... |
// Check for errors... |
893 |
if (piMaps == NULL && ::lscp_client_get_errno(m_pClient)) { |
if (piMaps == NULL && ::lscp_client_get_errno(m_pClient)) { |
894 |
appendMessagesClient("lscp_list_midi_instrument_maps"); |
appendMessagesClient("lscp_list_midi_instrument_maps"); |
895 |
iErrors++; |
iErrors++; |
896 |
} |
} |
897 |
#endif // CONFIG_MIDI_INSTRUMENT |
#endif // CONFIG_MIDI_INSTRUMENT |
898 |
|
|
899 |
// Sampler channel mapping. |
// Sampler channel mapping. |
900 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QWidgetList wlist = m_pWorkspace->windowList(); |
901 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
902 |
qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); |
qsamplerChannelStrip *pChannelStrip |
903 |
|
= static_cast<qsamplerChannelStrip *> (wlist.at(iChannel)); |
904 |
if (pChannelStrip) { |
if (pChannelStrip) { |
905 |
qsamplerChannel *pChannel = pChannelStrip->channel(); |
qsamplerChannel *pChannel = pChannelStrip->channel(); |
906 |
if (pChannel) { |
if (pChannel) { |
952 |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
953 |
} |
} |
954 |
#endif |
#endif |
955 |
|
#ifdef CONFIG_FXSEND |
956 |
|
int iChannelID = pChannel->channelID(); |
957 |
|
int *piFxSends = ::lscp_list_fxsends(m_pClient, iChannelID); |
958 |
|
for (int iFxSend = 0; |
959 |
|
piFxSends && piFxSends[iFxSend] >= 0; |
960 |
|
iFxSend++) { |
961 |
|
lscp_fxsend_info_t *pFxSendInfo = ::lscp_get_fxsend_info( |
962 |
|
m_pClient, iChannelID, piFxSends[iFxSend]); |
963 |
|
if (pFxSendInfo) { |
964 |
|
ts << "CREATE FX_SEND " << iChannel |
965 |
|
<< " " << pFxSendInfo->midi_controller; |
966 |
|
if (pFxSendInfo->name) |
967 |
|
ts << " '" << pFxSendInfo->name << "'"; |
968 |
|
ts << endl; |
969 |
|
int *piRouting = pFxSendInfo->audio_routing; |
970 |
|
for (int iAudioSrc = 0; |
971 |
|
piRouting && piRouting[iAudioSrc] >= 0; |
972 |
|
iAudioSrc++) { |
973 |
|
ts << "SET FX_SEND AUDIO_OUTPUT_CHANNEL " |
974 |
|
<< iChannel |
975 |
|
<< " " << iFxSend |
976 |
|
<< " " << iAudioSrc |
977 |
|
<< " " << piRouting[iAudioSrc] << endl; |
978 |
|
} |
979 |
|
#ifdef CONFIG_FXSEND_LEVEL |
980 |
|
ts << "SET FX_SEND LEVEL " << iChannel |
981 |
|
<< " " << iFxSend |
982 |
|
<< " " << pFxSendInfo->level << endl; |
983 |
|
#endif |
984 |
|
} // Check for errors... |
985 |
|
else if (::lscp_client_get_errno(m_pClient)) { |
986 |
|
appendMessagesClient("lscp_get_fxsend_info"); |
987 |
|
iErrors++; |
988 |
|
} |
989 |
|
} |
990 |
|
#endif |
991 |
ts << endl; |
ts << endl; |
992 |
} |
} |
993 |
} |
} |
1092 |
tr("Reset"), tr("Cancel")) > 0) |
tr("Reset"), tr("Cancel")) > 0) |
1093 |
return; |
return; |
1094 |
|
|
1095 |
|
// Trye closing the current session, first... |
1096 |
|
if (!closeSession(true)) |
1097 |
|
return; |
1098 |
|
|
1099 |
// Just do the reset, after closing down current session... |
// Just do the reset, after closing down current session... |
1100 |
if (closeSession(true) && ::lscp_reset_sampler(m_pClient) != LSCP_OK) { |
// Do the actual sampler reset... |
1101 |
appendMessagesClient("lscp_reset_sampler"); |
if (::lscp_reset_sampler(m_pClient) != LSCP_OK) { |
1102 |
appendMessagesError(tr("Could not reset sampler instance.\n\nSorry.")); |
appendMessagesClient("lscp_reset_sampler"); |
1103 |
return; |
appendMessagesError(tr("Could not reset sampler instance.\n\nSorry.")); |
1104 |
} |
return; |
1105 |
|
} |
1106 |
|
|
1107 |
// Log this. |
// Log this. |
1108 |
appendMessages(tr("Sampler reset.")); |
appendMessages(tr("Sampler reset.")); |
1536 |
sText += tr("Sampler channel Mute/Solo support disabled."); |
sText += tr("Sampler channel Mute/Solo support disabled."); |
1537 |
sText += "</font></small><br />"; |
sText += "</font></small><br />"; |
1538 |
#endif |
#endif |
1539 |
|
#ifndef CONFIG_AUDIO_ROUTING |
1540 |
|
sText += "<small><font color=\"red\">"; |
1541 |
|
sText += tr("LSCP (liblscp) audio_routing support disabled."); |
1542 |
|
sText += "</font></small><br />"; |
1543 |
|
#endif |
1544 |
|
#ifndef CONFIG_FXSEND |
1545 |
|
sText += "<small><font color=\"red\">"; |
1546 |
|
sText += tr("Sampler channel Effect Sends support disabled."); |
1547 |
|
sText += "</font></small><br />"; |
1548 |
|
#endif |
1549 |
#ifndef CONFIG_MIDI_INSTRUMENT |
#ifndef CONFIG_MIDI_INSTRUMENT |
1550 |
sText += "<small><font color=\"red\">"; |
sText += "<small><font color=\"red\">"; |
1551 |
sText += tr("MIDI instrument mapping support disabled."); |
sText += tr("MIDI instrument mapping support disabled."); |
1663 |
void qsamplerMainForm::updateSession (void) |
void qsamplerMainForm::updateSession (void) |
1664 |
{ |
{ |
1665 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
1666 |
// FIXME Make some room for default instrument maps... |
// FIXME: Make some room for default instrument maps... |
1667 |
int iMaps = ::lscp_get_midi_instrument_maps(m_pClient); |
int iMaps = ::lscp_get_midi_instrument_maps(m_pClient); |
1668 |
if (iMaps < 0) |
if (iMaps < 0) |
1669 |
appendMessagesClient("lscp_get_midi_instrument_maps"); |
appendMessagesClient("lscp_get_midi_instrument_maps"); |
1964 |
|
|
1965 |
// Actual channel strip setup... |
// Actual channel strip setup... |
1966 |
pChannelStrip->setup(pChannel); |
pChannelStrip->setup(pChannel); |
1967 |
QObject::connect(pChannelStrip, SIGNAL(channelChanged(qsamplerChannelStrip *)), this, SLOT(channelStripChanged(qsamplerChannelStrip *))); |
QObject::connect(pChannelStrip, |
1968 |
|
SIGNAL(channelChanged(qsamplerChannelStrip *)), |
1969 |
|
SLOT(channelStripChanged(qsamplerChannelStrip *))); |
1970 |
// Set some initial aesthetic options... |
// Set some initial aesthetic options... |
1971 |
if (m_pOptions) { |
if (m_pOptions) { |
1972 |
// Background display effect... |
// Background display effect... |
2173 |
m_pServer = new QProcess(this); |
m_pServer = new QProcess(this); |
2174 |
|
|
2175 |
// Setup stdout/stderr capture... |
// Setup stdout/stderr capture... |
2176 |
//if (m_pOptions->bStdoutCapture) { |
// if (m_pOptions->bStdoutCapture) { |
2177 |
m_pServer->setCommunication(QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr); |
m_pServer->setCommunication( |
2178 |
QObject::connect(m_pServer, SIGNAL(readyReadStdout()), this, SLOT(readServerStdout())); |
QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr); |
2179 |
QObject::connect(m_pServer, SIGNAL(readyReadStderr()), this, SLOT(readServerStdout())); |
QObject::connect(m_pServer, |
2180 |
//} |
SIGNAL(readyReadStdout()), |
2181 |
// The unforgiveable signal communication... |
SLOT(readServerStdout())); |
2182 |
QObject::connect(m_pServer, SIGNAL(processExited()), this, SLOT(processServerExit())); |
QObject::connect(m_pServer, |
2183 |
|
SIGNAL(readyReadStderr()), |
2184 |
|
SLOT(readServerStdout())); |
2185 |
|
// } |
2186 |
|
// The unforgiveable signal communication... |
2187 |
|
QObject::connect(m_pServer, |
2188 |
|
SIGNAL(processExited()), |
2189 |
|
SLOT(processServerExit())); |
2190 |
|
|
2191 |
// Build process arguments... |
// Build process arguments... |
2192 |
m_pServer->setArguments(QStringList::split(' ', m_pOptions->sServerCmdLine)); |
m_pServer->setArguments(QStringList::split(' ', m_pOptions->sServerCmdLine)); |