22 |
|
|
23 |
package org.linuxsampler.lscp; |
package org.linuxsampler.lscp; |
24 |
|
|
25 |
|
import static org.linuxsampler.lscp.Parser.*; |
26 |
|
|
27 |
/** |
/** |
28 |
* Provides information about a MIDI instrument. |
* Provides information about a MIDI instrument. |
29 |
* @author Grigor Iliev |
* @author Grigor Iliev |
194 |
*/ |
*/ |
195 |
public boolean |
public boolean |
196 |
parse(String s) throws LscpException { |
parse(String s) throws LscpException { |
|
if (super.parse(s)) return true; |
|
|
|
|
197 |
if(s.startsWith("NAME: ")) { |
if(s.startsWith("NAME: ")) { |
198 |
setName(s.substring("NAME: ".length())); |
setName(toNonEscapedString(s.substring("NAME: ".length()))); |
199 |
} else if(s.startsWith("ENGINE_NAME: ")) { |
} else if(s.startsWith("ENGINE_NAME: ")) { |
200 |
setEngine(s.substring("ENGINE_NAME: ".length())); |
setEngine(s.substring("ENGINE_NAME: ".length())); |
201 |
} else if(s.startsWith("INSTRUMENT_NAME: ")) { |
} else if(s.startsWith("INSTRUMENT_NAME: ")) { |
202 |
instrName = s.substring("INSTRUMENT_NAME: ".length()); |
instrName = toNonEscapedString(s.substring("INSTRUMENT_NAME: ".length())); |
203 |
} else if(s.startsWith("LOAD_MODE: ")) { |
} else if(s.startsWith("LOAD_MODE: ")) { |
204 |
s = s.substring("LOAD_MODE: ".length()); |
s = s.substring("LOAD_MODE: ".length()); |
205 |
if(s.length() == 0) setLoadMode(LoadMode.DEFAULT); |
if(s.length() == 0) setLoadMode(LoadMode.DEFAULT); |
207 |
} else if(s.startsWith("VOLUME: ")) { |
} else if(s.startsWith("VOLUME: ")) { |
208 |
s = s.substring("VOLUME: ".length()); |
s = s.substring("VOLUME: ".length()); |
209 |
setVolume(Parser.parseFloat(s)); |
setVolume(Parser.parseFloat(s)); |
210 |
} else return false; |
} else return super.parse(s); |
211 |
|
|
212 |
return true; |
return true; |
213 |
} |
} |