/[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 1202 by iliev, Thu May 24 20:17:25 2007 UTC revision 1346 by iliev, Thu Sep 13 22:02:03 2007 UTC
# Line 542  public class Client { Line 542  public class Client {
542                          if(s.startsWith("NAME ")) {                          if(s.startsWith("NAME ")) {
543                                  String[] list;                                  String[] list;
544                                  try {                                  try {
545                                          list = parseStringList(s.substring("NAME ".length()), ' ');                                          s = s.substring("NAME ".length());
546                                            list = parseEscapedStringList(s, ' ');
547                                          if(list.length != 2) throw new LscpException();                                          if(list.length != 2) throw new LscpException();
548                                            list[1] = toNonEscapedText(list[1]);
549                                          e = new InstrumentsDbEvent(this, list[0], list[1]);                                          e = new InstrumentsDbEvent(this, list[0], list[1]);
550                                          for(InstrumentsDbListener l : llID) {                                          for(InstrumentsDbListener l : llID) {
551                                                  l.directoryNameChanged(e);                                                  l.directoryNameChanged(e);
# Line 569  public class Client { Line 571  public class Client {
571                          if(s.startsWith("NAME ")) {                          if(s.startsWith("NAME ")) {
572                                  String[] list;                                  String[] list;
573                                  try {                                  try {
574                                          list = parseStringList(s.substring("NAME ".length()), ' ');                                          s = s.substring("NAME ".length());
575                                            list = parseEscapedStringList(s, ' ');
576                                          if(list.length != 2) throw new LscpException();                                          if(list.length != 2) throw new LscpException();
577                                            list[1] = toNonEscapedText(list[1]);
578                                          e = new InstrumentsDbEvent(this, list[0], list[1]);                                          e = new InstrumentsDbEvent(this, list[0], list[1]);
579                                          for(InstrumentsDbListener l : llID) {                                          for(InstrumentsDbListener l : llID) {
580                                                  l.instrumentNameChanged(e);                                                  l.instrumentNameChanged(e);
# Line 1355  public class Client { Line 1359  public class Client {
1359          /**          /**
1360           * Gets detailed information about a specific audio output driver.           * Gets detailed information about a specific audio output driver.
1361           * @param driverName The name of the audio output driver.           * @param driverName The name of the audio output driver.
1362           *           * @param depList An optional list of dependences parameters.
1363           * @return An <code>AudioOutputDriver</code> object containing           * @return An <code>AudioOutputDriver</code> object containing
1364           * information about the specified audio output driver.           * information about the specified audio output driver.
1365           *           *
# Line 1365  public class Client { Line 1369  public class Client {
1369           *           *
1370           * @see #getAudioOutputDriverNames           * @see #getAudioOutputDriverNames
1371           */           */
1372          private synchronized AudioOutputDriver          public synchronized AudioOutputDriver
1373          getAudioOutputDriverInfo(String driverName) throws IOException, LscpException, LSException {          getAudioOutputDriverInfo(String driverName, Parameter... depList)
1374                                            throws IOException, LscpException, LSException {
1375                    
1376                  verifyConnection();                  verifyConnection();
1377                  out.writeLine("GET AUDIO_OUTPUT_DRIVER INFO " + driverName);                  out.writeLine("GET AUDIO_OUTPUT_DRIVER INFO " + driverName);
1378                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
# Line 1376  public class Client { Line 1382  public class Client {
1382                  aod.setName(driverName);                  aod.setName(driverName);
1383                                    
1384                  for(String s : aod.getParameterNames())                  for(String s : aod.getParameterNames())
1385                          aod.addParameter(getAudioOutputDriverParameterInfo(driverName, s));                          aod.addParameter(getAudioOutputDriverParameterInfo(driverName, s, depList));
1386                                    
1387                  return aod;                  return aod;
1388          }          }
# Line 1410  public class Client { Line 1416  public class Client {
1416                  StringBuffer args = new StringBuffer(driver);                  StringBuffer args = new StringBuffer(driver);
1417                  args.append(' ').append(param);                  args.append(' ').append(param);
1418                                    
1419                  for(Parameter p : deplist)                  for(Parameter p : deplist) {
1420                            if(p.getValue() == null) continue;
1421                          args.append(' ').append(p.getName()).append('=').append(p.getStringValue());                          args.append(' ').append(p.getName()).append('=').append(p.getStringValue());
1422                    }
1423                                    
1424                  out.writeLine("GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO " + args.toString());                  out.writeLine("GET AUDIO_OUTPUT_DRIVER_PARAMETER INFO " + args.toString());
1425                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
# Line 1472  public class Client { Line 1480  public class Client {
1480                  verifyConnection();                  verifyConnection();
1481                  StringBuffer args = new StringBuffer(aoDriver);                  StringBuffer args = new StringBuffer(aoDriver);
1482                                    
1483                  for(Parameter p : paramList)                  for(Parameter p : paramList) {
1484                            if(p.getValue() == null) continue;
1485                          args.append(' ').append(p.getName()).append('=').append(p.getStringValue());                          args.append(' ').append(p.getName()).append('=').append(p.getStringValue());
1486                    }
1487                                    
1488                  out.writeLine("CREATE AUDIO_OUTPUT_DEVICE " + args.toString());                  out.writeLine("CREATE AUDIO_OUTPUT_DEVICE " + args.toString());
1489                  if(getPrintOnlyMode()) return -1;                  if(getPrintOnlyMode()) return -1;
# Line 1934  public class Client { Line 1944  public class Client {
1944          /**          /**
1945           * Gets detailed information about a specific MIDI input driver.           * Gets detailed information about a specific MIDI input driver.
1946           * @param driverName The name of the MIDI input driver.           * @param driverName The name of the MIDI input driver.
1947           *           * @param depList An optional list of dependences parameters.
1948           * @return A <code>MidiInputDriver</code> object containing           * @return A <code>MidiInputDriver</code> object containing
1949           * information about the specified MIDI input driver.           * information about the specified MIDI input driver.
1950           *           *
# Line 1944  public class Client { Line 1954  public class Client {
1954           *           *
1955           * @see #getMidiInputDriverNames           * @see #getMidiInputDriverNames
1956           */           */
1957          private synchronized MidiInputDriver          public synchronized MidiInputDriver
1958          getMidiInputDriverInfo(String driverName) throws IOException, LscpException, LSException {          getMidiInputDriverInfo(String driverName, Parameter... depList)
1959                                            throws IOException, LscpException, LSException {
1960                    
1961                  verifyConnection();                  verifyConnection();
1962                  out.writeLine("GET MIDI_INPUT_DRIVER INFO " + driverName);                  out.writeLine("GET MIDI_INPUT_DRIVER INFO " + driverName);
1963                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
# Line 1956  public class Client { Line 1968  public class Client {
1968                  mid.setName(driverName);                  mid.setName(driverName);
1969                                    
1970                  for(String s : mid.getParameterNames())                  for(String s : mid.getParameterNames())
1971                          mid.addParameter(getMidiInputDriverParameterInfo(driverName, s));                          mid.addParameter(getMidiInputDriverParameterInfo(driverName, s, depList));
1972                                    
1973                  return mid;                  return mid;
1974          }          }
# Line 1990  public class Client { Line 2002  public class Client {
2002                  StringBuffer args = new StringBuffer(driver);                  StringBuffer args = new StringBuffer(driver);
2003                  args.append(' ').append(param);                  args.append(' ').append(param);
2004                                    
2005                  for(Parameter p : deplist)                  for(Parameter p : deplist) {
2006                            if(p.getValue() == null) continue;
2007                          args.append(' ').append(p.getName()).append('=').append(p.getStringValue());                          args.append(' ').append(p.getName()).append('=').append(p.getStringValue());
2008                    }
2009                                    
2010                  out.writeLine("GET MIDI_INPUT_DRIVER_PARAMETER INFO " + args.toString());                  out.writeLine("GET MIDI_INPUT_DRIVER_PARAMETER INFO " + args.toString());
2011                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
# Line 2053  public class Client { Line 2067  public class Client {
2067                  verifyConnection();                  verifyConnection();
2068                  StringBuffer args = new StringBuffer(miDriver);                  StringBuffer args = new StringBuffer(miDriver);
2069                                    
2070                  for(Parameter p : paramList)                  for(Parameter p : paramList) {
2071                            if(p.getValue() == null) continue;
2072                          args.append(' ').append(p.getName()).append('=').append(p.getStringValue());                          args.append(' ').append(p.getName()).append('=').append(p.getStringValue());
2073                    }
2074                                    
2075                  out.writeLine("CREATE MIDI_INPUT_DEVICE " + args.toString());                  out.writeLine("CREATE MIDI_INPUT_DEVICE " + args.toString());
2076                  if(getPrintOnlyMode()) return -1;                  if(getPrintOnlyMode()) return -1;
# Line 2845  public class Client { Line 2861  public class Client {
2861          loadInstrument(String filename, int instrIdx, int samplerChn, boolean nonModal)          loadInstrument(String filename, int instrIdx, int samplerChn, boolean nonModal)
2862                                                  throws IOException, LscpException, LSException {                                                  throws IOException, LscpException, LSException {
2863                                    
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 3027  public class Client { Line 3044  public class Client {
3044                  out.writeLine("LIST AVAILABLE_ENGINES");                  out.writeLine("LIST AVAILABLE_ENGINES");
3045                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
3046                                    
3047                  return parseStringList(getSingleLineResultSet().getResult());                  return parseQuotedStringList(getSingleLineResultSet().getResult());
3048          }          }
3049                    
3050          /**          /**
# Line 3717  public class Client { Line 3734  public class Client {
3734                  ResultSet rs = getEmptyResultSet();                  ResultSet rs = getEmptyResultSet();
3735          }          }
3736                    
3737            /**
3738             * Starts an instrument editor for editing the loaded instrument
3739             * on the specified sampler channel.
3740             * @param samplerChn The sampler channel number.
3741             * @throws IOException If some I/O error occurs.
3742             * @throws LscpException If LSCP protocol corruption occurs.
3743             * @throws LSException If <code>samplerChn</code> is not a valid channel number or if
3744             * there is no instrument loaded on the specified sampler channel.
3745             * @see #getSamplerChannels
3746             */
3747            public synchronized void
3748            editInstrument(int samplerChn) throws IOException, LscpException, LSException {
3749                    verifyConnection();
3750                    out.writeLine("EDIT INSTRUMENT " + samplerChn);
3751                    if(getPrintOnlyMode()) return;
3752                    
3753                    ResultSet rs = getEmptyResultSet();
3754            }
3755            
3756                    
3757                    
3758          /**          /**
3759           * Adds the specified directory to the instruments database.           * Adds the specified directory to the instruments database.
3760           * @param dir The absolute path name of the directory to add.           * @param dir The absolute (escaped) path name of the directory to add.
3761           * @throws IOException If some I/O error occurs.           * @throws IOException If some I/O error occurs.
3762           * @throws LSException If the creation of the directory failed.           * @throws LSException If the creation of the directory failed.
3763           * @throws LscpException If LSCP protocol corruption occurs.           * @throws LscpException If LSCP protocol corruption occurs.
# Line 3737  public class Client { Line 3773  public class Client {
3773                    
3774          /**          /**
3775           * Removes the specified directory from the instruments database.           * Removes the specified directory from the instruments database.
3776           * @param dir The absolute path name of the directory to remove.           * @param dir The absolute (escaped) path name of the directory to remove.
3777           * @throws IOException If some I/O error occurs.           * @throws IOException If some I/O error occurs.
3778           * @throws LscpException If LSCP protocol corruption occurs.           * @throws LscpException If LSCP protocol corruption occurs.
3779           * @throws LSException If the specified directory is not           * @throws LSException If the specified directory is not
# Line 3772  public class Client { Line 3808  public class Client {
3808                    
3809          /**          /**
3810           * Removes the specified directories from the instruments database.           * Removes the specified directories from the instruments database.
3811           * @param dirs The absolute path names of the directories to remove.           * @param dirs The absolute (escaped) path names of the directories to remove.
3812           * @param force If <code>true</code> forces the removal of non-empty           * @param force If <code>true</code> forces the removal of non-empty
3813           * directories.           * directories.
3814           * @throws IOException If some I/O error occurs.           * @throws IOException If some I/O error occurs.
# Line 3847  public class Client { Line 3883  public class Client {
3883                  out.writeLine("LIST DB_INSTRUMENT_DIRECTORIES '" + dir + "'");                  out.writeLine("LIST DB_INSTRUMENT_DIRECTORIES '" + dir + "'");
3884                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
3885                                    
3886                  return parseStringList(getSingleLineResultSet().getResult());                  String[] names = parseEscapedStringList(getSingleLineResultSet().getResult());
3887                    for(int i = 0; i < names.length; i++) {
3888                            names[i] = toNonEscapedText(names[i]);
3889                    }
3890                    return names;
3891          }          }
3892                    
3893          /**          /**
# Line 3869  public class Client { Line 3909  public class Client {
3909                  DbDirectoryInfo info = new DbDirectoryInfo(rs.getMultiLineResult());                  DbDirectoryInfo info = new DbDirectoryInfo(rs.getMultiLineResult());
3910                  if(dir.equals("/")) {                  if(dir.equals("/")) {
3911                          info.setName("/");                          info.setName("/");
3912                  } else if(dir.length() > 1 && dir.charAt(dir.length() - 1) == '/') {                  } else {
3913                          dir = dir.substring(0, dir.length() - 1);                          dir = removeEndingFileSeparator(dir);
                 }  
                 int i = dir.lastIndexOf('/');  
                 if(i != -1 && i < dir.length() - 1) {  
                         info.setName(dir.substring(i + 1));  
                         if(i == 0) info.setParentDirectoryPath("/");  
                         else info.setParentDirectoryPath(dir.substring(0, i));  
3914                  }                  }
3915                    String s = getFileName(dir);
3916                    if(s != null) info.setName(toNonEscapedFileName(s));
3917                    s = getParentDirectory(dir);
3918                    if(s != null) info.setParentDirectoryPath(s);
3919                                    
3920                  return info;                  return info;
3921          }          }
# Line 3894  public class Client { Line 3932  public class Client {
3932          public synchronized DbDirectoryInfo[]          public synchronized DbDirectoryInfo[]
3933          getDbDirectories(String dir) throws IOException, LscpException, LSException {          getDbDirectories(String dir) throws IOException, LscpException, LSException {
3934                  String[] dirS = getDbDirectoryNames(dir);                  String[] dirS = getDbDirectoryNames(dir);
3935                  if(dir.charAt(dir.length() - 1) != '/') dir += "/";                  if(!hasEndingFileSeparator(dir)) dir += "/";
3936                  DbDirectoryInfo[] infoS = new DbDirectoryInfo[dirS.length];                  DbDirectoryInfo[] infoS = new DbDirectoryInfo[dirS.length];
3937                  for(int i = 0; i < dirS.length; i++) infoS[i] = getDbDirectoryInfo(dir + dirS[i]);                  for(int i = 0; i < dirS.length; i++) {
3938                            infoS[i] = getDbDirectoryInfo(dir + toEscapedFileName(dirS[i]));
3939                    }
3940                  return infoS;                  return infoS;
3941          }          }
3942                    
# Line 3961  public class Client { Line 4001  public class Client {
4001          public synchronized void          public synchronized void
4002          renameDbDirectory(String dir, String name) throws IOException, LSException, LscpException {          renameDbDirectory(String dir, String name) throws IOException, LSException, LscpException {
4003                  verifyConnection();                  verifyConnection();
4004                    name = toEscapedString(name);
4005                  out.writeLine("SET DB_INSTRUMENT_DIRECTORY NAME '" + dir + "' '" + name + "'");                  out.writeLine("SET DB_INSTRUMENT_DIRECTORY NAME '" + dir + "' '" + name + "'");
4006                  if(getPrintOnlyMode()) return;                  if(getPrintOnlyMode()) return;
4007                                    
# Line 4053  public class Client { Line 4094  public class Client {
4094                                    
4095                  verifyConnection();                  verifyConnection();
4096                  String s = "SET DB_INSTRUMENT_DIRECTORY DESCRIPTION '";                  String s = "SET DB_INSTRUMENT_DIRECTORY DESCRIPTION '";
4097                  out.writeLine(s + dir + "' '" + desc + "'");                  out.writeLine(s + dir + "' '" + toEscapedString(desc) + "'");
4098                  if(getPrintOnlyMode()) return;                  if(getPrintOnlyMode()) return;
4099                                    
4100                  ResultSet rs = getEmptyResultSet();                  ResultSet rs = getEmptyResultSet();
# Line 4102  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 + "' '" + filePath + "' ";                  s += " '" + dbDir + "' '" + toEscapedString(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 4149  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 + "' '" + filePath + "'");                  out.writeLine(s + " '" + dbDir + "' '" + toEscapedString(filePath) + "'");
4194                  if(getPrintOnlyMode()) return -1;                  if(getPrintOnlyMode()) return -1;
4195                                    
4196                  ResultSet rs = getEmptyResultSet();                  ResultSet rs = getEmptyResultSet();
# Line 4232  public class Client { Line 4273  public class Client {
4273                                  break;                                  break;
4274                  }                  }
4275                                    
4276                  sb.append(" '").append(dbDir).append("' '").append(fsDir).append("'");                  sb.append(" '").append(dbDir).append("' '");
4277                    sb.append(toEscapedString(fsDir)).append("'");
4278                  out.writeLine(sb.toString());                  out.writeLine(sb.toString());
4279                  if(getPrintOnlyMode()) return -1;                  if(getPrintOnlyMode()) return -1;
4280                                    
# Line 4328  public class Client { Line 4370  public class Client {
4370                  out.writeLine("LIST DB_INSTRUMENTS '" + dir + "'");                  out.writeLine("LIST DB_INSTRUMENTS '" + dir + "'");
4371                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
4372                                    
4373                  return parseStringList(getSingleLineResultSet().getResult());                  String[] names = parseEscapedStringList(getSingleLineResultSet().getResult());
4374                    for(int i = 0; i < names.length; i++) {
4375                            names[i] = toNonEscapedText(names[i]);
4376                    }
4377                    return names;
4378          }          }
4379                    
4380          /**          /**
# Line 4348  public class Client { Line 4394  public class Client {
4394                                    
4395                  ResultSet rs = getMultiLineResultSet();                  ResultSet rs = getMultiLineResultSet();
4396                  DbInstrumentInfo info = new DbInstrumentInfo(rs.getMultiLineResult());                  DbInstrumentInfo info = new DbInstrumentInfo(rs.getMultiLineResult());
4397                  int i = instr.lastIndexOf('/');                  String s = getParentDirectory(instr);
4398                  if(i != -1 && i < instr.length() - 1) {                  if(s != null) info.setDirectoryPath(s);
4399                          info.setName(instr.substring(i + 1));                  s = getFileName(instr);
4400                          if(i == 0) info.setDirectoryPath("/");                  if(s != null) info.setName(toNonEscapedFileName(s));
                         else info.setDirectoryPath(instr.substring(0, i));  
                 }  
4401                                    
4402                  return info;                  return info;
4403          }          }
# Line 4370  public class Client { Line 4414  public class Client {
4414          public synchronized DbInstrumentInfo[]          public synchronized DbInstrumentInfo[]
4415          getDbInstruments(String dir) throws IOException, LscpException, LSException {          getDbInstruments(String dir) throws IOException, LscpException, LSException {
4416                  String[] instrS = getDbInstrumentNames(dir);                  String[] instrS = getDbInstrumentNames(dir);
4417                  if(dir.charAt(dir.length() - 1) != '/') dir += "/";                  if(!hasEndingFileSeparator(dir)) dir += "/";
4418                                    
4419                  DbInstrumentInfo[] infoS = new DbInstrumentInfo[instrS.length];                  DbInstrumentInfo[] infoS = new DbInstrumentInfo[instrS.length];
4420                  for(int i = 0; i < instrS.length; i++) {                  for(int i = 0; i < instrS.length; i++) {
4421                          infoS[i] = getDbInstrumentInfo(dir + instrS[i]);                          infoS[i] = getDbInstrumentInfo(dir + toEscapedFileName(instrS[i]));
4422                  }                  }
4423                  return infoS;                  return infoS;
4424          }          }
# Line 4442  public class Client { Line 4486  public class Client {
4486                                  throws IOException, LSException, LscpException {                                  throws IOException, LSException, LscpException {
4487                                    
4488                  verifyConnection();                  verifyConnection();
4489                    name = toEscapedString(name);
4490                  out.writeLine("SET DB_INSTRUMENT NAME '" + instr + "' '" + name + "'");                  out.writeLine("SET DB_INSTRUMENT NAME '" + instr + "' '" + name + "'");
4491                  if(getPrintOnlyMode()) return;                  if(getPrintOnlyMode()) return;
4492                                    
# Line 4533  public class Client { Line 4578  public class Client {
4578                                  throws IOException, LSException, LscpException {                                  throws IOException, LSException, LscpException {
4579                                    
4580                  verifyConnection();                  verifyConnection();
4581                    desc = toEscapedString(desc);
4582                  out.writeLine("SET DB_INSTRUMENT DESCRIPTION '" + instr + "' '" + desc + "'");                  out.writeLine("SET DB_INSTRUMENT DESCRIPTION '" + instr + "' '" + desc + "'");
4583                  if(getPrintOnlyMode()) return;                  if(getPrintOnlyMode()) return;
4584                                    
# Line 4580  public class Client { Line 4626  public class Client {
4626                  sb.append(" '").append(dir).append("'");                  sb.append(" '").append(dir).append("'");
4627                                    
4628                  if(query.name != null && query.name.length() > 0) {                  if(query.name != null && query.name.length() > 0) {
4629                          sb.append(" NAME='").append(query.name).append("'");                          sb.append(" NAME='").append(toEscapedString(query.name)).append("'");
4630                  }                  }
4631                                    
4632                  String s = query.getCreatedAfter();                  String s = query.getCreatedAfter();
# Line 4604  public class Client { Line 4650  public class Client {
4650                  }                  }
4651                                    
4652                  if(query.description != null && query.description.length() > 0) {                  if(query.description != null && query.description.length() > 0) {
4653                          sb.append(" DESCRIPTION='").append(query.description).append("'");                          sb.append(" DESCRIPTION='");
4654                            sb.append(toEscapedString(query.description)).append("'");
4655                  }                  }
4656                                    
4657                  out.writeLine(sb.toString());                  out.writeLine(sb.toString());
4658                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
4659                                    
4660                  String[] dirS = parseStringList(getSingleLineResultSet().getResult());                  String[] dirS = parseEscapedStringList(getSingleLineResultSet().getResult());
4661                                    
4662                  DbDirectoryInfo[] infoS = new DbDirectoryInfo[dirS.length];                  DbDirectoryInfo[] infoS = new DbDirectoryInfo[dirS.length];
4663                  for(int i = 0; i < dirS.length; i++) {                  for(int i = 0; i < dirS.length; i++) {
# Line 4660  public class Client { Line 4707  public class Client {
4707                  sb.append(" '").append(dir).append("'");                  sb.append(" '").append(dir).append("'");
4708                                    
4709                  if(query.name != null && query.name.length() > 0) {                  if(query.name != null && query.name.length() > 0) {
4710                          sb.append(" NAME='").append(query.name).append("'");                          sb.append(" NAME='").append(toEscapedString(query.name)).append("'");
4711                  }                  }
4712                                    
4713                  if(query.formatFamilies.size() > 0) {                  if(query.formatFamilies.size() > 0) {
# Line 4700  public class Client { Line 4747  public class Client {
4747                  }                  }
4748                                    
4749                  if(query.description != null && query.description.length() > 0) {                  if(query.description != null && query.description.length() > 0) {
4750                          sb.append(" DESCRIPTION='").append(query.description).append("'");                          sb.append(" DESCRIPTION='");
4751                            sb.append(toEscapedString(query.description)).append("'");
4752                  }                  }
4753                                    
4754                  if(query.instrumentType != DbSearchQuery.InstrumentType.BOTH) {                  if(query.instrumentType != DbSearchQuery.InstrumentType.BOTH) {
# Line 4713  public class Client { Line 4761  public class Client {
4761                  }                  }
4762                                    
4763                  if(query.product != null && query.product.length() > 0) {                  if(query.product != null && query.product.length() > 0) {
4764                          sb.append(" PRODUCT='").append(query.product).append("'");                          sb.append(" PRODUCT='").append(toEscapedString(query.product)).append("'");
4765                  }                  }
4766                                    
4767                  if(query.artists != null && query.artists.length() > 0) {                  if(query.artists != null && query.artists.length() > 0) {
4768                          sb.append(" ARTISTS='").append(query.artists).append("'");                          sb.append(" ARTISTS='").append(toEscapedString(query.artists)).append("'");
4769                  }                  }
4770                                    
4771                  if(query.keywords != null && query.keywords.length() > 0) {                  if(query.keywords != null && query.keywords.length() > 0) {
4772                          sb.append(" KEYWORDS='").append(query.keywords).append("'");                          sb.append(" KEYWORDS='");
4773                            sb.append(toEscapedString(query.keywords)).append("'");
4774                  }                  }
4775                                    
4776                  out.writeLine(sb.toString());                  out.writeLine(sb.toString());
4777                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
4778                                    
4779                  String[] instrS = parseStringList(getSingleLineResultSet().getResult());                  String[] instrS = parseEscapedStringList(getSingleLineResultSet().getResult());
4780                                    
4781                  DbInstrumentInfo[] infoS = new DbInstrumentInfo[instrS.length];                  DbInstrumentInfo[] infoS = new DbInstrumentInfo[instrS.length];
4782                  for(int i = 0; i < instrS.length; i++) {                  for(int i = 0; i < instrS.length; i++) {

Legend:
Removed from v.1202  
changed lines
  Added in v.1346

  ViewVC Help
Powered by ViewVC