1567 |
} |
} |
1568 |
} |
} |
1569 |
|
|
1570 |
String LSCPServer::AddOrReplaceMIDIInstrumentMapping(uint MidiMapID, uint MidiBank, uint MidiProg, String EngineType, String InstrumentFile, uint InstrumentIndex, float Volume, MidiInstrumentMapper::mode_t LoadMode, String Name) { |
String LSCPServer::AddOrReplaceMIDIInstrumentMapping(uint MidiMapID, uint MidiBank, uint MidiProg, String EngineType, String InstrumentFile, uint InstrumentIndex, float Volume, MidiInstrumentMapper::mode_t LoadMode, String Name, bool bModal) { |
1571 |
dmsg(2,("LSCPServer: AddOrReplaceMIDIInstrumentMapping()\n")); |
dmsg(2,("LSCPServer: AddOrReplaceMIDIInstrumentMapping()\n")); |
1572 |
|
|
1573 |
midi_prog_index_t idx; |
midi_prog_index_t idx; |
1585 |
|
|
1586 |
LSCPResultSet result; |
LSCPResultSet result; |
1587 |
try { |
try { |
1588 |
// PERSISTENT mapping commands might bloock for a long time, so in |
// PERSISTENT mapping commands might block for a long time, so in |
1589 |
// that case we add/replace the mapping in another thread |
// that case we add/replace the mapping in another thread in case |
1590 |
bool bInBackground = (entry.LoadMode == MidiInstrumentMapper::PERSISTENT); |
// the NON_MODAL argument was supplied, non persistent mappings |
1591 |
|
// should return immediately, so we don't need to do that for them |
1592 |
|
bool bInBackground = (entry.LoadMode == MidiInstrumentMapper::PERSISTENT && !bModal); |
1593 |
MidiInstrumentMapper::AddOrReplaceEntry(MidiMapID, idx, entry, bInBackground); |
MidiInstrumentMapper::AddOrReplaceEntry(MidiMapID, idx, entry, bInBackground); |
1594 |
} catch (Exception e) { |
} catch (Exception e) { |
1595 |
result.Error(e); |
result.Error(e); |