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

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

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

revision 910 by iliev, Thu Mar 16 18:08:34 2006 UTC revision 911 by iliev, Mon Aug 7 18:25:58 2006 UTC
# Line 36  import static org.jsampler.JSI18n.i18n; Line 36  import static org.jsampler.JSI18n.i18n;
36    
37    
38  /**  /**
39   *   * This task duplicates the specified sampler channels.
40   * @author Grigor Iliev   * @author Grigor Iliev
41   */   */
42  public class DuplicateChannels extends EnhancedTask {  public class DuplicateChannels extends EnhancedTask {
43          JSChannel[] channels;          SamplerChannel[] chnS;
44                    
45            /**
46             * Creates a new instance of <code>DuplicateChannels</code>.
47             * @param channel The channel to duplicate.
48             */
49            public
50            DuplicateChannels(SamplerChannel channel) {
51                    initTask();
52                    
53                    chnS = new SamplerChannel[1];
54                    chnS[0] = channel;
55            }
56            
57            /**
58             * Creates a new instance of <code>DuplicateChannels</code>.
59             * @param channels The channels to duplicate.
60             */
61          public          public
62          DuplicateChannels(JSChannel[] channels) {          DuplicateChannels(JSChannel[] channels) {
63                  this.channels = channels;                  initTask();
64                                    
65                    chnS = new SamplerChannel[channels.length];
66                    
67                    for(int i = 0; i < channels.length; i++) chnS[i] = channels[i].getChannelInfo();
68            }
69            
70            private void
71            initTask() {
72                  setTitle("DuplicateChannels_task");                  setTitle("DuplicateChannels_task");
73                  setDescription(i18n.getMessage("DuplicateChannels.description"));                  setDescription(i18n.getMessage("DuplicateChannels.description"));
74          }          }
75                    
76            /** The entry point of the task. */
77          public void          public void
78          run() {          run() {
79                  try {                  try {
80                          for(JSChannel c : channels) {                          for(SamplerChannel c : chnS) {
81                                  int i = CC.getClient().addSamplerChannel();                                  duplicateSettings(c, CC.getClient().addSamplerChannel());
                                 duplicateSettings(c.getChannelInfo(), i);  
82                          }                          }
83                  }                  }
84                  catch(Exception x) {                  catch(Exception x) {

Legend:
Removed from v.910  
changed lines
  Added in v.911

  ViewVC Help
Powered by ViewVC