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

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

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

revision 2191 by iliev, Sun Mar 29 19:10:49 2009 UTC revision 2192 by iliev, Fri Jun 24 21:34:51 2011 UTC
# Line 1  Line 1 
1  /*  /*
2   *   JSampler - a java front-end for LinuxSampler   *   JSampler - a java front-end for LinuxSampler
3   *   *
4   *   Copyright (C) 2005-2009 Grigor Iliev <grigor@grigoriliev.com>   *   Copyright (C) 2005-2011 Grigor Iliev <grigor@grigoriliev.com>
5   *   *
6   *   This file is part of JSampler.   *   This file is part of JSampler.
7   *   *
# Line 22  Line 22 
22    
23  package org.jsampler.task;  package org.jsampler.task;
24    
 import java.util.Vector;  
   
25  import org.jsampler.CC;  import org.jsampler.CC;
26  import org.jsampler.SamplerChannelModel;  import org.jsampler.SamplerChannelModel;
27  import org.jsampler.SamplerModel;  import org.jsampler.SamplerModel;
# Line 45  public class UpdateChannels extends Enha Line 43  public class UpdateChannels extends Enha
43          UpdateChannels() {          UpdateChannels() {
44                  setTitle("UpdateChannels_task");                  setTitle("UpdateChannels_task");
45                  setDescription(i18n.getMessage("UpdateChannels.description"));                  setDescription(i18n.getMessage("UpdateChannels.description"));
46                    //setCalculateElapsedTime(true);
47          }          }
48                    
49          /** The entry point of the task. */          /** The entry point of the task. */
# Line 80  public class UpdateChannels extends Enha Line 79  public class UpdateChannels extends Enha
79                          }                          }
80                          found = false;                          found = false;
81                  }                  }
82    
83                    SamplerChannel[] chns = CC.getClient().getSamplerChannels(chnIDs);
84                                    
85                  Vector<SamplerChannel> v = new Vector<SamplerChannel>();                  for(int i = 0; i < chns.length - 1; i++) sm.addChannel(chns[i]);
                 for(int id : chnIDs) {  
                         if(id >= 0) v.add(CC.getClient().getSamplerChannelInfo(id));  
                 }  
                   
                 for(int i = 0; i < v.size() - 1; i++) sm.addChannel(v.elementAt(i));  
86                                    
87                  manageAutoUpdate(false);                  manageAutoUpdate(false);
88                                    
89                  if(v.size() > 0) sm.addChannel(v.elementAt(v.size() - 1));                  if(chns.length > 0) sm.addChannel(chns[chns.length - 1]);
90                  else if(!CC.getSamplerModel().getChannelListIsAdjusting()) {                  else if(!CC.getSamplerModel().getChannelListIsAdjusting()) {
91                          if(!isAdjustingOld && !changed); // do nothing if nothing is changed                          if(!isAdjustingOld && !changed); // do nothing if nothing is changed
92                          else sm.addChannel(null); // fire dummy event to end an adjusting sequence                          else sm.addChannel(null); // fire dummy event to end an adjusting sequence

Legend:
Removed from v.2191  
changed lines
  Added in v.2192

  ViewVC Help
Powered by ViewVC