810 |
|
|
811 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
812 |
// MIDI instrument mapping... |
// MIDI instrument mapping... |
813 |
|
QMap<int, int> midiInstrumentMap; |
814 |
int *piMaps = ::lscp_list_midi_instrument_maps(m_pClient); |
int *piMaps = ::lscp_list_midi_instrument_maps(m_pClient); |
815 |
for (int iMap = 0; piMaps && piMaps[iMap] >= 0; iMap++) { |
for (int iMap = 0; piMaps && piMaps[iMap] >= 0; iMap++) { |
816 |
int iMidiMap = piMaps[iMap]; |
int iMidiMap = piMaps[iMap]; |
817 |
const char *pszMapName |
const char *pszMapName |
818 |
= ::lscp_get_midi_instrument_map_name(m_pClient, iMidiMap); |
= ::lscp_get_midi_instrument_map_name(m_pClient, iMidiMap); |
819 |
ts << "# " << tr("MIDI instrument map") << " " << iMidiMap; |
ts << "# " << tr("MIDI instrument map") << " " << iMap; |
820 |
if (pszMapName) |
if (pszMapName) |
821 |
ts << " - " << pszMapName; |
ts << " - " << pszMapName; |
822 |
ts << endl; |
ts << endl; |
832 |
= ::lscp_get_midi_instrument_info(m_pClient, &pInstrs[iInstr]); |
= ::lscp_get_midi_instrument_info(m_pClient, &pInstrs[iInstr]); |
833 |
if (pInstrInfo) { |
if (pInstrInfo) { |
834 |
ts << "MAP MIDI_INSTRUMENT " |
ts << "MAP MIDI_INSTRUMENT " |
835 |
<< pInstrs[iInstr].map << " " |
<< iMap << " " |
836 |
<< pInstrs[iInstr].bank << " " |
<< pInstrs[iInstr].bank << " " |
837 |
<< pInstrs[iInstr].prog << " " |
<< pInstrs[iInstr].prog << " " |
838 |
<< pInstrInfo->engine_name << " '" |
<< pInstrInfo->engine_name << " '" |
856 |
ts << " '" << pInstrInfo->name << "'"; |
ts << " '" << pInstrInfo->name << "'"; |
857 |
ts << endl; |
ts << endl; |
858 |
} |
} |
859 |
|
// MIDI device index/id mapping. |
860 |
|
midiInstrumentMap[iMidiMap] = iMap; |
861 |
// Try to keep it snappy :) |
// Try to keep it snappy :) |
862 |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
863 |
} |
} |
918 |
#ifdef CONFIG_MIDI_INSTRUMENT |
#ifdef CONFIG_MIDI_INSTRUMENT |
919 |
if (pChannel->midiMap() >= 0) { |
if (pChannel->midiMap() >= 0) { |
920 |
ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel |
ts << "SET CHANNEL MIDI_INSTRUMENT_MAP " << iChannel |
921 |
<< " " << pChannel->midiChannel() << endl; |
<< " " << midiInstrumentMap[pChannel->midiMap()] << endl; |
922 |
} |
} |
923 |
#endif |
#endif |
924 |
ts << endl; |
ts << endl; |