/[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 1817 by iliev, Thu May 8 17:26:19 2008 UTC revision 1818 by iliev, Wed Dec 24 17:29:47 2008 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-2006 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   *   *
# Line 52  public class UpdateChannels extends Enha Line 52  public class UpdateChannels extends Enha
52          /** The entry point of the task. */          /** The entry point of the task. */
53          public void          public void
54          run() {          run() {
55                  try {                  try {
56                          SamplerModel sm = CC.getSamplerModel();                          SamplerModel sm = CC.getSamplerModel();
57                          Integer[] chnIDs = CC.getClient().getSamplerChannelIDs();                          Integer[] chnIDs = CC.getClient().getSamplerChannelIDs();
58                                                    
# Line 91  public class UpdateChannels extends Enha Line 91  public class UpdateChannels extends Enha
91                                                    
92                          if(v.size() > 0) sm.addChannel(v.elementAt(v.size() - 1));                          if(v.size() > 0) sm.addChannel(v.elementAt(v.size() - 1));
93                          else if(!CC.getSamplerModel().getChannelListIsAdjusting()) {                          else if(!CC.getSamplerModel().getChannelListIsAdjusting()) {
94                                  if(oldValue) sm.addChannel(null);                                  // FIXME: no change after
95                                    // CC.getSamplerModel().setChannelListIsAdjusting(false);
96                          }                          }
97                  } catch(Exception x) {                  } catch(Exception x) {
98                          setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x));                          setErrorMessage(getDescription() + ": " + HF.getErrorMessage(x));
# Line 107  public class UpdateChannels extends Enha Line 108  public class UpdateChannels extends Enha
108                          for(Task t : tasks) if(t.equals(this)) return;                          for(Task t : tasks) if(t.equals(this)) return;
109                  }                  }
110                                    
111                  javax.swing.SwingUtilities.invokeLater(new Runnable() {                  try {
112                          public void                          javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
113                          run() {                                  public void
114                                  CC.getSamplerModel().setChannelListIsAdjusting(false);                                  run() {
115                                  CC.getMainFrame().setAutoUpdateChannelListUI(true);                                          CC.getSamplerModel().setChannelListIsAdjusting(false);
116                                  CC.getMainFrame().updateChannelListUI();                                          CC.getMainFrame().setAutoUpdateChannelListUI(true);
117                          }                                          CC.getMainFrame().updateChannelListUI();
118                  });                                  }
119                            });
120                    } catch(Exception x) {
121                            x.printStackTrace();
122                    }
123          }          }
124                                    
125          /**          /**
# Line 122  public class UpdateChannels extends Enha Line 127  public class UpdateChannels extends Enha
127           * equal to this are removed if added using {@link org.jsampler.CC#scheduleTask}.           * equal to this are removed if added using {@link org.jsampler.CC#scheduleTask}.
128           * @see org.jsampler.CC#addTask           * @see org.jsampler.CC#addTask
129           */           */
130            @Override
131          public boolean          public boolean
132          equals(Object obj) {          equals(Object obj) {
133                  if(obj == null) return false;                  if(obj == null) return false;

Legend:
Removed from v.1817  
changed lines
  Added in v.1818

  ViewVC Help
Powered by ViewVC