34 |
import java.util.logging.Level; |
import java.util.logging.Level; |
35 |
import java.util.logging.Logger; |
import java.util.logging.Logger; |
36 |
|
|
|
import static org.linuxsampler.lscp.Parser.*; |
|
37 |
import org.linuxsampler.lscp.event.*; |
import org.linuxsampler.lscp.event.*; |
38 |
|
|
39 |
|
import static org.linuxsampler.lscp.Parser.*; |
40 |
|
|
41 |
|
|
42 |
/** |
/** |
43 |
* This class is the abstraction representing a client endpoint for communication with LinuxSampler |
* This class is the abstraction representing a client endpoint for communication with LinuxSampler |
546 |
s = s.substring("NAME ".length()); |
s = s.substring("NAME ".length()); |
547 |
list = parseEscapedStringList(s, ' '); |
list = parseEscapedStringList(s, ' '); |
548 |
if(list.length != 2) throw new LscpException(); |
if(list.length != 2) throw new LscpException(); |
549 |
list[1] = toNonEscapedText(list[1]); |
list[1] = toNonEscapedString(list[1]); |
550 |
e = new InstrumentsDbEvent(this, list[0], list[1]); |
e = new InstrumentsDbEvent(this, list[0], list[1]); |
551 |
for(InstrumentsDbListener l : llID) { |
for(InstrumentsDbListener l : llID) { |
552 |
l.directoryNameChanged(e); |
l.directoryNameChanged(e); |
575 |
s = s.substring("NAME ".length()); |
s = s.substring("NAME ".length()); |
576 |
list = parseEscapedStringList(s, ' '); |
list = parseEscapedStringList(s, ' '); |
577 |
if(list.length != 2) throw new LscpException(); |
if(list.length != 2) throw new LscpException(); |
578 |
list[1] = toNonEscapedText(list[1]); |
list[1] = toNonEscapedString(list[1]); |
579 |
e = new InstrumentsDbEvent(this, list[0], list[1]); |
e = new InstrumentsDbEvent(this, list[0], list[1]); |
580 |
for(InstrumentsDbListener l : llID) { |
for(InstrumentsDbListener l : llID) { |
581 |
l.instrumentNameChanged(e); |
l.instrumentNameChanged(e); |
2862 |
loadInstrument(String filename, int instrIdx, int samplerChn, boolean nonModal) |
loadInstrument(String filename, int instrIdx, int samplerChn, boolean nonModal) |
2863 |
throws IOException, LscpException, LSException { |
throws IOException, LscpException, LSException { |
2864 |
|
|
|
filename = toEscapedString(filename); |
|
2865 |
String cmd = nonModal ? "LOAD INSTRUMENT NON_MODAL " : "LOAD INSTRUMENT "; |
String cmd = nonModal ? "LOAD INSTRUMENT NON_MODAL " : "LOAD INSTRUMENT "; |
2866 |
String args = '\'' + filename + "' " + instrIdx + ' ' + samplerChn; |
String args = '\'' + filename + "' " + instrIdx + ' ' + samplerChn; |
2867 |
|
|
3885 |
|
|
3886 |
String[] names = parseEscapedStringList(getSingleLineResultSet().getResult()); |
String[] names = parseEscapedStringList(getSingleLineResultSet().getResult()); |
3887 |
for(int i = 0; i < names.length; i++) { |
for(int i = 0; i < names.length; i++) { |
3888 |
names[i] = toNonEscapedText(names[i]); |
names[i] = toNonEscapedString(names[i]); |
3889 |
} |
} |
3890 |
return names; |
return names; |
3891 |
} |
} |
4143 |
verifyConnection(); |
verifyConnection(); |
4144 |
String s = "ADD DB_INSTRUMENTS"; |
String s = "ADD DB_INSTRUMENTS"; |
4145 |
if(background) s += " NON_MODAL"; |
if(background) s += " NON_MODAL"; |
4146 |
s += " '" + dbDir + "' '" + toEscapedString(filePath) + "' "; |
s += " '" + dbDir + "' '" + filePath + "' "; |
4147 |
out.writeLine(s + String.valueOf(instrIndex)); |
out.writeLine(s + String.valueOf(instrIndex)); |
4148 |
if(getPrintOnlyMode()) return -1; |
if(getPrintOnlyMode()) return -1; |
4149 |
|
|
4190 |
verifyConnection(); |
verifyConnection(); |
4191 |
String s = "ADD DB_INSTRUMENTS"; |
String s = "ADD DB_INSTRUMENTS"; |
4192 |
if(background) s += " NON_MODAL"; |
if(background) s += " NON_MODAL"; |
4193 |
out.writeLine(s + " '" + dbDir + "' '" + toEscapedString(filePath) + "'"); |
out.writeLine(s + " '" + dbDir + "' '" + filePath + "'"); |
4194 |
if(getPrintOnlyMode()) return -1; |
if(getPrintOnlyMode()) return -1; |
4195 |
|
|
4196 |
ResultSet rs = getEmptyResultSet(); |
ResultSet rs = getEmptyResultSet(); |
4274 |
} |
} |
4275 |
|
|
4276 |
sb.append(" '").append(dbDir).append("' '"); |
sb.append(" '").append(dbDir).append("' '"); |
4277 |
sb.append(toEscapedString(fsDir)).append("'"); |
sb.append(fsDir).append("'"); |
4278 |
out.writeLine(sb.toString()); |
out.writeLine(sb.toString()); |
4279 |
if(getPrintOnlyMode()) return -1; |
if(getPrintOnlyMode()) return -1; |
4280 |
|
|
4372 |
|
|
4373 |
String[] names = parseEscapedStringList(getSingleLineResultSet().getResult()); |
String[] names = parseEscapedStringList(getSingleLineResultSet().getResult()); |
4374 |
for(int i = 0; i < names.length; i++) { |
for(int i = 0; i < names.length; i++) { |
4375 |
names[i] = toNonEscapedText(names[i]); |
names[i] = toNonEscapedString(names[i]); |
4376 |
} |
} |
4377 |
return names; |
return names; |
4378 |
} |
} |