--- jsampler/trunk/src/org/jsampler/task/Global.java 2007/12/03 22:59:39 1539 +++ jsampler/trunk/src/org/jsampler/task/Global.java 2007/12/03 23:22:02 1540 @@ -28,6 +28,7 @@ import org.jsampler.HF; import org.linuxsampler.lscp.ServerInfo; +import org.linuxsampler.lscp.Instrument; import static org.jsampler.JSI18n.i18n; @@ -91,7 +92,7 @@ * This task gets the global volume of the sampler. */ public static class GetVolume extends EnhancedTask { - /** Creates a new instance of Get. */ + /** Creates a new instance of GetVolume. */ public GetVolume() { setTitle("Global.GetVolume_task"); @@ -138,4 +139,29 @@ } } } + + /** + * This task gets the list of instruments in the specified instrument file. + */ + public static class GetFileInstruments extends EnhancedTask { + private final String filename; + + /** Creates a new instance of GetFileInstruments. */ + public + GetFileInstruments(String filename) { + this.filename = filename; + setTitle("Global.GetFileInstruments_task"); + setDescription(i18n.getMessage("Global.GetFileInstruments.desc")); + } + + /** The entry point of the task. */ + public void + run() { + try { setResult(CC.getClient().getFileInstruments(filename)); } + catch(Exception x) { + String s = getDescription() + ": " + HF.getErrorMessage(x); + CC.getLogger().log(Level.FINER, s, x); + } + } + } }