/[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 1351 by iliev, Sun Sep 16 23:15:57 2007 UTC revision 1494 by iliev, Mon Nov 19 22:00:04 2007 UTC
# Line 2216  public class Client { Line 2216  public class Client {
2216                                  mid.setActive(Boolean.parseBoolean(s));                                  mid.setActive(Boolean.parseBoolean(s));
2217                          } else if(s.startsWith("PORTS: ")) {                          } else if(s.startsWith("PORTS: ")) {
2218                                  s = s.substring("PORTS: ".length());                                  s = s.substring("PORTS: ".length());
2219                                  int ports = Parser.parseInt(s);                                  
2220                                  MidiPort[] midiPorts = new MidiPort[ports > 0 ? ports : 0];                                  Parameter<Integer> ports = (Parameter<Integer>)
2221                                            getMidiInputDriverParameterInfo(drv, "PORTS");
2222                                    
2223                                    ports.parseValue(s);
2224                                    mid.setPortsParameter(ports);
2225                                    
2226                                    int j = ports.getValue();
2227                                    MidiPort[] midiPorts = new MidiPort[j > 0 ? j : 0];
2228                                                                    
2229                                  for(int i = 0; i < midiPorts.length; i++)                                  for(int i = 0; i < midiPorts.length; i++)
2230                                          midiPorts[i] = getMidiInputPortInfo(deviceId, i);                                          midiPorts[i] = getMidiInputPortInfo(deviceId, i);
# Line 2460  public class Client { Line 2467  public class Client {
2467          public synchronized int          public synchronized int
2468          addMidiInstrumentMap(String name) throws IOException, LSException, LscpException {          addMidiInstrumentMap(String name) throws IOException, LSException, LscpException {
2469                  verifyConnection();                  verifyConnection();
2470                  out.writeLine("ADD MIDI_INSTRUMENT_MAP '" + name + "'");                  out.writeLine("ADD MIDI_INSTRUMENT_MAP '" + toEscapedString(name) + "'");
2471                  if(getPrintOnlyMode()) return -1;                  if(getPrintOnlyMode()) return -1;
2472                                    
2473                  ResultSet rs = getEmptyResultSet();                  ResultSet rs = getEmptyResultSet();
# Line 2563  public class Client { Line 2570  public class Client {
2570                                    
2571                  for(String s : lnS) {                  for(String s : lnS) {
2572                          if(s.startsWith("NAME: ")) {                          if(s.startsWith("NAME: ")) {
2573                                  name = s.substring("NAME: ".length());                                  name = toNonEscapedString(s.substring("NAME: ".length()));
2574                          } else if(s.startsWith("DEFAULT: ")) {                          } else if(s.startsWith("DEFAULT: ")) {
2575                                  b = Boolean.parseBoolean(s.substring("DEFAULT: ".length()));                                  b = Boolean.parseBoolean(s.substring("DEFAULT: ".length()));
2576                          } else {                          } else {
# Line 2611  public class Client { Line 2618  public class Client {
2618                                  throws IOException, LscpException, LSException {                                  throws IOException, LscpException, LSException {
2619                                    
2620                  verifyConnection();                  verifyConnection();
2621                    name = toEscapedString(name);
2622                  out.writeLine("SET MIDI_INSTRUMENT_MAP NAME " +  + mapId + " '" + name + "'");                  out.writeLine("SET MIDI_INSTRUMENT_MAP NAME " +  + mapId + " '" + name + "'");
2623                  if(getPrintOnlyMode()) return;                  if(getPrintOnlyMode()) return;
2624                                    
# Line 2666  public class Client { Line 2674  public class Client {
2674                  if(!info.getLoadMode().name().equals("DEFAULT")) {                  if(!info.getLoadMode().name().equals("DEFAULT")) {
2675                          cmd.append(' ').append(info.getLoadMode().name());                          cmd.append(' ').append(info.getLoadMode().name());
2676                  }                  }
2677                  if(info.getName() != null) cmd.append(" '").append(info.getName()).append("'");                  
2678                    if(info.getName() != null) {
2679                            String s = toEscapedString(info.getName());
2680                            cmd.append(" '").append(s).append("'");
2681                    }
2682                                    
2683                  out.writeLine(cmd.toString());                  out.writeLine(cmd.toString());
2684                  if(getPrintOnlyMode()) return;                  if(getPrintOnlyMode()) return;
# Line 3044  public class Client { Line 3056  public class Client {
3056                  out.writeLine("LIST AVAILABLE_ENGINES");                  out.writeLine("LIST AVAILABLE_ENGINES");
3057                  if(getPrintOnlyMode()) return null;                  if(getPrintOnlyMode()) return null;
3058                                    
3059                  return parseQuotedStringList(getSingleLineResultSet().getResult());                  return parseStringList(getSingleLineResultSet().getResult());
3060          }          }
3061                    
3062          /**          /**
# Line 3515  public class Client { Line 3527  public class Client {
3527                                    
3528                  verifyConnection();                  verifyConnection();
3529                  String s = String.valueOf(channel) + " " + String.valueOf(midiCtrl);                  String s = String.valueOf(channel) + " " + String.valueOf(midiCtrl);
3530                  if(name != null) s += " '" + name + "'";                  if(name != null) s += " '" + toEscapedString(name) + "'";
3531                  out.writeLine("CREATE FX_SEND " + s);                  out.writeLine("CREATE FX_SEND " + s);
3532                  if(getPrintOnlyMode()) return -1;                  if(getPrintOnlyMode()) return -1;
3533                                    
# Line 3646  public class Client { Line 3658  public class Client {
3658                                  throws IOException, LscpException, LSException {                                  throws IOException, LscpException, LSException {
3659                                    
3660                  verifyConnection();                  verifyConnection();
3661                  String args = " " + channel + " " + fxSend + " '" + name + "'";                  String args = " " + channel + " " + fxSend + " '" + toEscapedString(name) + "'";
3662                  out.writeLine("SET FX_SEND NAME" + args);                  out.writeLine("SET FX_SEND NAME" + args);
3663                  if(getPrintOnlyMode()) return;                  if(getPrintOnlyMode()) return;
3664                                    
# Line 3745  public class Client { Line 3757  public class Client {
3757           * @see #getSamplerChannels           * @see #getSamplerChannels
3758           */           */
3759          public synchronized void          public synchronized void
3760          editInstrument(int samplerChn) throws IOException, LscpException, LSException {          editChannelInstrument(int samplerChn) throws IOException, LscpException, LSException {
3761                  verifyConnection();                  verifyConnection();
3762                  out.writeLine("EDIT INSTRUMENT " + samplerChn);                  out.writeLine("EDIT CHANNEL INSTRUMENT " + samplerChn);
3763                  if(getPrintOnlyMode()) return;                  if(getPrintOnlyMode()) return;
3764                                    
3765                  ResultSet rs = getEmptyResultSet();                  ResultSet rs = getEmptyResultSet();
# Line 4807  public class Client { Line 4819  public class Client {
4819          }          }
4820                    
4821          /**          /**
4822             * Removes all instruments and directories and re-creates
4823             * the instruments database structure.
4824             * @throws IOException If some I/O error occurs.
4825             * @throws LscpException If LSCP protocol corruption occurs.
4826             * @throws LSException If the formatting of the instruments database failed.
4827             */
4828            public synchronized void
4829            formatInstrumentsDb() throws IOException, LscpException, LSException {
4830                    verifyConnection();
4831                    out.writeLine("FORMAT INSTRUMENTS_DB");
4832                    if(getPrintOnlyMode()) return;
4833                    
4834                    ResultSet rs = getEmptyResultSet();
4835            }
4836            
4837            /**
4838           * Resets the specified sampler channel.           * Resets the specified sampler channel.
4839           *           *
4840           * @param samplerChn The sampler channel number.           * @param samplerChn The sampler channel number.

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

  ViewVC Help
Powered by ViewVC