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

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

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

revision 1538 by iliev, Sun Sep 16 23:15:57 2007 UTC revision 1539 by iliev, Mon Dec 3 22:59:39 2007 UTC
# Line 28  import static org.linuxsampler.lscp.Pars Line 28  import static org.linuxsampler.lscp.Pars
28   *   *
29   * @author Grigor Iliev   * @author Grigor Iliev
30   */   */
31  public abstract class AbstractInstrument implements Parseable {  public abstract class AbstractInstrument implements Instrument, Parseable {
32          private String name = "Untitled";          private String name = "Untitled";
33          private String description = "";          private String description = "";
34          private String path = null;          private String path = null;
35          private int instrumentIndex = 0;          private int instrumentIndex = 0;
36            private String formatFamily = "";
37            private String formatVersion = "";
38                    
39          /**          /**
40           * Creates a new instance of <code>AbstractInstrument</code>.           * Creates a new instance of <code>AbstractInstrument</code>.
41           */           */
42          public AbstractInstrument() {          public
43            AbstractInstrument() { }
44            
45            /**
46             * Creates a new instance of <code>AbstractInstrument</code>.
47             * @param resultSet An array with information categories about an instrument.
48             */
49            public
50            AbstractInstrument(String[] resultSet) throws LscpException {
51                    for(String s : resultSet)
52                            if(!parse(s)) Client.getLogger().info(LscpI18n.getLogMsg("unknownLine", s));
53          }          }
54                    
55          /**          /**
# Line 90  public abstract class AbstractInstrument Line 102  public abstract class AbstractInstrument
102          setInstrumentIndex(int idx) { instrumentIndex = idx; }          setInstrumentIndex(int idx) { instrumentIndex = idx; }
103                    
104          /**          /**
105             * Returns the format family of the instrument.
106             **/
107            public String
108            getFormatFamily() { return formatFamily; }
109            
110            /**
111             * Returns the format version of the instrument.
112             **/
113            public String
114            getFormatVersion() { return formatVersion; }
115            
116            /**
117           * Parses a line of text.           * Parses a line of text.
118           * @param s The string to be parsed.           * @param s The string to be parsed.
119           * @return <code>true</code> if the line has been processed, <code>false</code> otherwise.           * @return <code>true</code> if the line has been processed, <code>false</code> otherwise.
# Line 107  public abstract class AbstractInstrument Line 131  public abstract class AbstractInstrument
131                  } else if(s.startsWith("INSTRUMENT_NR: ")) {                  } else if(s.startsWith("INSTRUMENT_NR: ")) {
132                          s = s.substring("INSTRUMENT_NR: ".length());                          s = s.substring("INSTRUMENT_NR: ".length());
133                          setInstrumentIndex(Parser.parseInt(s));                          setInstrumentIndex(Parser.parseInt(s));
134                    } else if(s.startsWith("FORMAT_FAMILY: ")) {
135                            formatFamily = s.substring("FORMAT_FAMILY: ".length());
136                    } else if(s.startsWith("FORMAT_VERSION: ")) {
137                            formatVersion = s.substring("FORMAT_VERSION: ".length());
138                  } else return false;                  } else return false;
139                                    
140                  return true;                  return true;

Legend:
Removed from v.1538  
changed lines
  Added in v.1539

  ViewVC Help
Powered by ViewVC