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 |
* |
* |
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; |
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. */ |
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 |