1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
55 |
} |
} |
56 |
|
|
57 |
/** The entry point of the task. */ |
/** The entry point of the task. */ |
58 |
|
@Override |
59 |
public void |
public void |
60 |
run() { |
run() { |
61 |
try { setResult(CC.getClient().getServerInfo()); } |
try { setResult(CC.getClient().getServerInfo()); } |
79 |
} |
} |
80 |
|
|
81 |
/** The entry point of the task. */ |
/** The entry point of the task. */ |
82 |
|
@Override |
83 |
public void |
public void |
84 |
run() { |
run() { |
85 |
try { CC.getClient().resetSampler(); } |
try { CC.getClient().resetSampler(); } |
102 |
} |
} |
103 |
|
|
104 |
/** The entry point of the task. */ |
/** The entry point of the task. */ |
105 |
|
@Override |
106 |
public void |
public void |
107 |
run() { |
run() { |
108 |
try { setResult(CC.getClient().getVolume()); } |
try { setResult(CC.getClient().getVolume()); } |
132 |
} |
} |
133 |
|
|
134 |
/** The entry point of the task. */ |
/** The entry point of the task. */ |
135 |
|
@Override |
136 |
public void |
public void |
137 |
run() { |
run() { |
138 |
try { |
try { |
146 |
|
|
147 |
|
|
148 |
/** |
/** |
149 |
|
* This task sets the global sampler-wide limits of maximum voices and streams. |
150 |
|
*/ |
151 |
|
public static class SetPolyphony extends EnhancedTask { |
152 |
|
private int maxVoices; |
153 |
|
private int maxStreams; |
154 |
|
|
155 |
|
/** |
156 |
|
* Creates new instance of <code>SetPolyphony</code>. |
157 |
|
* @param maxVoices The new global limit of maximum voices or |
158 |
|
* <code>-1</code> to ignore it. |
159 |
|
* @param maxStreams The new global limit of maximum disk streams or |
160 |
|
* <code>-1</code> to ignore it. |
161 |
|
*/ |
162 |
|
public |
163 |
|
SetPolyphony(int maxVoices, int maxStreams) { |
164 |
|
setTitle("Global.SetPolyphony_task"); |
165 |
|
setDescription(i18n.getMessage("Global.SetPolyphony.desc")); |
166 |
|
this.maxVoices = maxVoices; |
167 |
|
this.maxStreams = maxStreams; |
168 |
|
} |
169 |
|
|
170 |
|
/** The entry point of the task. */ |
171 |
|
@Override |
172 |
|
public void |
173 |
|
run() { |
174 |
|
try { |
175 |
|
if(maxVoices != -1) CC.getClient().setGlobalVoiceLimit(maxVoices); |
176 |
|
if(maxStreams != -1) CC.getClient().setGlobalStreamLimit(maxStreams); |
177 |
|
} catch(Exception x) { |
178 |
|
setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x)); |
179 |
|
CC.getLogger().log(Level.FINE, getErrorMessage(), x); |
180 |
|
} |
181 |
|
} |
182 |
|
} |
183 |
|
|
184 |
|
|
185 |
|
/** |
186 |
* This task sets the LSCP client's read timeout. |
* This task sets the LSCP client's read timeout. |
187 |
*/ |
*/ |
188 |
public static class SetClientReadTimeout extends EnhancedTask { |
public static class SetClientReadTimeout extends EnhancedTask { |
200 |
} |
} |
201 |
|
|
202 |
/** The entry point of the task. */ |
/** The entry point of the task. */ |
203 |
|
@Override |
204 |
public void |
public void |
205 |
run() { |
run() { |
206 |
try { |
try { |
227 |
} |
} |
228 |
|
|
229 |
/** The entry point of the task. */ |
/** The entry point of the task. */ |
230 |
|
@Override |
231 |
public void |
public void |
232 |
run() { |
run() { |
233 |
try { setResult(CC.getClient().getFileInstruments(filename)); } |
try { setResult(CC.getClient().getFileInstruments(filename)); } |
255 |
} |
} |
256 |
|
|
257 |
/** The entry point of the task. */ |
/** The entry point of the task. */ |
258 |
|
@Override |
259 |
public void |
public void |
260 |
run() { |
run() { |
261 |
try { setResult(CC.getClient().getFileInstrumentInfo(filename, instrIdx)); } |
try { setResult(CC.getClient().getFileInstrumentInfo(filename, instrIdx)); } |
267 |
} |
} |
268 |
|
|
269 |
public static class DummyTask extends EnhancedTask { |
public static class DummyTask extends EnhancedTask { |
270 |
|
@Override |
271 |
public void |
public void |
272 |
run() { } |
run() { } |
273 |
} |
} |