/[svn]/jsampler/trunk/src/org/jsampler/task/Channel.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/task/Channel.java

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

revision 1144 by iliev, Mon Apr 2 21:39:15 2007 UTC revision 1204 by iliev, Thu May 24 21:43:45 2007 UTC
# Line 298  public class Channel { Line 298  public class Channel {
298          }          }
299                    
300          /**          /**
301             * This task loads a sampler engine in a specific sampler channel.
302             * @author Grigor Iliev
303             */
304            public static class LoadEngine extends EnhancedTask {
305                    private String engine;
306                    private int channel;
307                    
308                    /**
309                     * Creates new instance of <code>LoadEngine</code>.
310                     * @param engine The name of the engine to load.
311                     * @param channel The number of the sampler channel
312                     * the deployed engine should be assigned to.
313                     */
314                    public
315                    LoadEngine(String engine, int channel) {
316                            this.engine = engine;
317                            this.channel = channel;
318                            
319                            setTitle("Channel.LoadEngine_task");
320                            
321                            Object[] objs = { engine, new Integer(channel) };
322                            setDescription(i18n.getMessage("Channel.LoadEngine.desc", objs));
323                    }
324                    
325                    /** The entry point of the task. */
326                    public void
327                    run() {
328                            try { CC.getClient().loadSamplerEngine(engine, channel); }
329                            catch(Exception x) {
330                                    setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x));
331                                    CC.getLogger().log(Level.FINE, getErrorMessage(), x);
332                            }
333                    }
334            }
335            
336            /**
337             * This task loads and assigns an instrument to a sampler channel.
338             * @author Grigor Iliev
339             */
340            public static class LoadInstrument extends EnhancedTask {
341                    private String filename;
342                    private int instrIndex;
343                    private int channel;
344                    
345                    /**
346                     * Creates new instance of <code>LoadInstrument</code>.
347                     * @param filename The name of the instrument file
348                     * on the LinuxSampler instance's host system.
349                     * @param instrIndex The index of the instrument in the instrument file.
350                     * @param channel The number of the sampler channel the
351                     * instrument should be assigned to.
352                     */
353                    public
354                    LoadInstrument(String filename, int instrIndex, int channel) {
355                            this.filename = filename;
356                            this.instrIndex = instrIndex;
357                            this.channel = channel;
358                            
359                            setTitle("Channel.LoadInstrument_task");
360                            setDescription(i18n.getMessage("Channel.LoadInstrument.desc"));
361                    }
362                    
363                    /** The entry point of the task. */
364                    public void
365                    run() {
366                            try { CC.getClient().loadInstrument(filename, instrIndex, channel, true); }
367                            catch(Exception x) {
368                                    setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x));
369                                    CC.getLogger().log(Level.FINE, getErrorMessage(), x);
370                            }
371                    }
372            }
373            
374            /**
375           * This task assigns the specifed MIDI instrument map to the specified sampler channel.           * This task assigns the specifed MIDI instrument map to the specified sampler channel.
376           */           */
377          public static class SetMidiInstrumentMap extends EnhancedTask {          public static class SetMidiInstrumentMap extends EnhancedTask {
# Line 653  public class Channel { Line 727  public class Channel {
727                  run() {                  run() {
728                          try {                          try {
729                                  SamplerChannelModel scm;                                  SamplerChannelModel scm;
730                                  scm = CC.getSamplerModel().getChannelModel(channel);                                  scm = CC.getSamplerModel().getChannelById(channel);
731                                  Integer[] fxSendIDs = CC.getClient().getFxSendIDs(channel);                                  Integer[] fxSendIDs = CC.getClient().getFxSendIDs(channel);
732                                                    
733                                  boolean found = false;                                  boolean found = false;
# Line 714  public class Channel { Line 788  public class Channel {
788                  run() {                  run() {
789                          try {                          try {
790                                  SamplerChannelModel scm;                                  SamplerChannelModel scm;
791                                  scm = CC.getSamplerModel().getChannelModel(channel);                                  scm = CC.getSamplerModel().getChannelById(channel);
792                                  scm.updateFxSend(CC.getClient().getFxSendInfo(channel, fxSend));                                  scm.updateFxSend(CC.getClient().getFxSendInfo(channel, fxSend));
793                          } catch(Exception x) {                          } catch(Exception x) {
794                                  /*                                  /*

Legend:
Removed from v.1144  
changed lines
  Added in v.1204

  ViewVC Help
Powered by ViewVC