/[svn]/jlscp/trunk/src/org/linuxsampler/lscp/Client.java
ViewVC logotype

Diff of /jlscp/trunk/src/org/linuxsampler/lscp/Client.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1350 by iliev, Thu Sep 13 22:02:03 2007 UTC revision 1351 by iliev, Sun Sep 16 23:15:57 2007 UTC
# Line 34  import java.util.Vector; Line 34  import java.util.Vector;
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
# Line 545  public class Client { Line 546  public class Client {
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);
# Line 574  public class Client { Line 575  public class Client {
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);
# Line 2861  public class Client { Line 2862  public class Client {
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                                    
# Line 3885  public class Client { Line 3885  public class Client {
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          }          }
# Line 4143  public class Client { Line 4143  public class Client {
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                                    
# Line 4190  public class Client { Line 4190  public class Client {
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();
# Line 4274  public class Client { Line 4274  public class Client {
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                                    
# Line 4372  public class Client { Line 4372  public class Client {
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          }          }

Legend:
Removed from v.1350  
changed lines
  Added in v.1351

  ViewVC Help
Powered by ViewVC