58 |
!(c == '*') && !(c == '+') && !(c == ',') && !(c == '-') && |
!(c == '*') && !(c == '+') && !(c == ',') && !(c == '-') && |
59 |
!(c == '.') && !(c == '/') && !(c == ':') && !(c == ';') && |
!(c == '.') && !(c == '/') && !(c == ':') && !(c == ';') && |
60 |
!(c == '<') && !(c == '=') && !(c == '>') && !(c == '?') && |
!(c == '<') && !(c == '=') && !(c == '>') && !(c == '?') && |
61 |
!(c == '@') && !(c == '[') && !(c == '\\') && !(c == ']') && |
!(c == '@') && !(c == '[') && !(c == ']') && |
62 |
!(c == '^') && !(c == '_') && !(c == '`') && !(c == '{') && |
!(c == '^') && !(c == '_') && !(c == '`') && !(c == '{') && |
63 |
!(c == '|') && !(c == '}') && !(c == '~') |
!(c == '|') && !(c == '}') && !(c == '~') |
64 |
) { |
) { |
877 |
if (pSamplerChannel->GetMidiInputChannel() == midi_chan_all) result.Add("MIDI_INPUT_CHANNEL", "ALL"); |
if (pSamplerChannel->GetMidiInputChannel() == midi_chan_all) result.Add("MIDI_INPUT_CHANNEL", "ALL"); |
878 |
else result.Add("MIDI_INPUT_CHANNEL", pSamplerChannel->GetMidiInputChannel()); |
else result.Add("MIDI_INPUT_CHANNEL", pSamplerChannel->GetMidiInputChannel()); |
879 |
|
|
880 |
result.Add("INSTRUMENT_FILE", |
// convert the filename into the correct encoding as defined for LSCP |
881 |
(InstrumentFileName != "NONE" && InstrumentFileName != "") ? |
// (especially in terms of special characters -> escape sequences) |
882 |
Path::fromPosix(InstrumentFileName).toLscp() : // TODO: assuming POSIX |
if (InstrumentFileName != "NONE" && InstrumentFileName != "") { |
883 |
InstrumentFileName |
#if WIN32 |
884 |
); |
InstrumentFileName = Path::fromWindows(InstrumentFileName).toLscp(); |
885 |
|
#else |
886 |
|
// assuming POSIX |
887 |
|
InstrumentFileName = Path::fromPosix(InstrumentFileName).toLscp(); |
888 |
|
#endif |
889 |
|
} |
890 |
|
|
891 |
|
result.Add("INSTRUMENT_FILE", InstrumentFileName); |
892 |
result.Add("INSTRUMENT_NR", InstrumentIndex); |
result.Add("INSTRUMENT_NR", InstrumentIndex); |
893 |
result.Add("INSTRUMENT_NAME", _escapeLscpResponse(InstrumentName)); |
result.Add("INSTRUMENT_NAME", _escapeLscpResponse(InstrumentName)); |
894 |
result.Add("INSTRUMENT_STATUS", InstrumentStatus); |
result.Add("INSTRUMENT_STATUS", InstrumentStatus); |
1832 |
std::map<midi_prog_index_t,MidiInstrumentMapper::entry_t>::iterator iter = mappings.find(idx); |
std::map<midi_prog_index_t,MidiInstrumentMapper::entry_t>::iterator iter = mappings.find(idx); |
1833 |
if (iter == mappings.end()) result.Error("there is no map entry with that index"); |
if (iter == mappings.end()) result.Error("there is no map entry with that index"); |
1834 |
else { // found |
else { // found |
1835 |
|
|
1836 |
|
// convert the filename into the correct encoding as defined for LSCP |
1837 |
|
// (especially in terms of special characters -> escape sequences) |
1838 |
|
#if WIN32 |
1839 |
|
const String instrumentFileName = Path::fromWindows(iter->second.InstrumentFile).toLscp(); |
1840 |
|
#else |
1841 |
|
// assuming POSIX |
1842 |
|
const String instrumentFileName = Path::fromPosix(iter->second.InstrumentFile).toLscp(); |
1843 |
|
#endif |
1844 |
|
|
1845 |
result.Add("NAME", _escapeLscpResponse(iter->second.Name)); |
result.Add("NAME", _escapeLscpResponse(iter->second.Name)); |
1846 |
result.Add("ENGINE_NAME", iter->second.EngineName); |
result.Add("ENGINE_NAME", iter->second.EngineName); |
1847 |
result.Add("INSTRUMENT_FILE", Path::fromPosix(iter->second.InstrumentFile).toLscp()); //TODO: assuming POSIX |
result.Add("INSTRUMENT_FILE", instrumentFileName); |
1848 |
result.Add("INSTRUMENT_NR", (int) iter->second.InstrumentIndex); |
result.Add("INSTRUMENT_NR", (int) iter->second.InstrumentIndex); |
1849 |
String instrumentName; |
String instrumentName; |
1850 |
Engine* pEngine = EngineFactory::Create(iter->second.EngineName); |
Engine* pEngine = EngineFactory::Create(iter->second.EngineName); |
2433 |
try { |
try { |
2434 |
DbDirectory info = InstrumentsDb::GetInstrumentsDb()->GetDirectoryInfo(Dir); |
DbDirectory info = InstrumentsDb::GetInstrumentsDb()->GetDirectoryInfo(Dir); |
2435 |
|
|
2436 |
result.Add("DESCRIPTION", InstrumentsDb::toEscapedText(info.Description)); |
result.Add("DESCRIPTION", _escapeLscpResponse(info.Description)); |
2437 |
result.Add("CREATED", info.Created); |
result.Add("CREATED", info.Created); |
2438 |
result.Add("MODIFIED", info.Modified); |
result.Add("MODIFIED", info.Modified); |
2439 |
} catch (Exception e) { |
} catch (Exception e) { |
2617 |
result.Add("SIZE", (int)info.Size); |
result.Add("SIZE", (int)info.Size); |
2618 |
result.Add("CREATED", info.Created); |
result.Add("CREATED", info.Created); |
2619 |
result.Add("MODIFIED", info.Modified); |
result.Add("MODIFIED", info.Modified); |
2620 |
result.Add("DESCRIPTION", InstrumentsDb::toEscapedText(info.Description)); |
result.Add("DESCRIPTION", _escapeLscpResponse(info.Description)); |
2621 |
result.Add("IS_DRUM", info.IsDrum); |
result.Add("IS_DRUM", info.IsDrum); |
2622 |
result.Add("PRODUCT", InstrumentsDb::toEscapedText(info.Product)); |
result.Add("PRODUCT", _escapeLscpResponse(info.Product)); |
2623 |
result.Add("ARTISTS", InstrumentsDb::toEscapedText(info.Artists)); |
result.Add("ARTISTS", _escapeLscpResponse(info.Artists)); |
2624 |
result.Add("KEYWORDS", InstrumentsDb::toEscapedText(info.Keywords)); |
result.Add("KEYWORDS", _escapeLscpResponse(info.Keywords)); |
2625 |
} catch (Exception e) { |
} catch (Exception e) { |
2626 |
result.Error(e); |
result.Error(e); |
2627 |
} |
} |