28 |
import org.jsampler.HF; |
import org.jsampler.HF; |
29 |
|
|
30 |
import org.linuxsampler.lscp.ServerInfo; |
import org.linuxsampler.lscp.ServerInfo; |
31 |
|
import org.linuxsampler.lscp.Instrument; |
32 |
|
|
33 |
import static org.jsampler.JSI18n.i18n; |
import static org.jsampler.JSI18n.i18n; |
34 |
|
|
92 |
* This task gets the global volume of the sampler. |
* This task gets the global volume of the sampler. |
93 |
*/ |
*/ |
94 |
public static class GetVolume extends EnhancedTask<Float> { |
public static class GetVolume extends EnhancedTask<Float> { |
95 |
/** Creates a new instance of <code>Get</code>. */ |
/** Creates a new instance of <code>GetVolume</code>. */ |
96 |
public |
public |
97 |
GetVolume() { |
GetVolume() { |
98 |
setTitle("Global.GetVolume_task"); |
setTitle("Global.GetVolume_task"); |
139 |
} |
} |
140 |
} |
} |
141 |
} |
} |
142 |
|
|
143 |
|
/** |
144 |
|
* This task gets the list of instruments in the specified instrument file. |
145 |
|
*/ |
146 |
|
public static class GetFileInstruments extends EnhancedTask<Instrument[]> { |
147 |
|
private final String filename; |
148 |
|
|
149 |
|
/** Creates a new instance of <code>GetFileInstruments</code>. */ |
150 |
|
public |
151 |
|
GetFileInstruments(String filename) { |
152 |
|
this.filename = filename; |
153 |
|
setTitle("Global.GetFileInstruments_task"); |
154 |
|
setDescription(i18n.getMessage("Global.GetFileInstruments.desc")); |
155 |
|
} |
156 |
|
|
157 |
|
/** The entry point of the task. */ |
158 |
|
public void |
159 |
|
run() { |
160 |
|
try { setResult(CC.getClient().getFileInstruments(filename)); } |
161 |
|
catch(Exception x) { |
162 |
|
String s = getDescription() + ": " + HF.getErrorMessage(x); |
163 |
|
CC.getLogger().log(Level.FINER, s, x); |
164 |
|
} |
165 |
|
} |
166 |
|
} |
167 |
} |
} |