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

Diff of /jsampler/trunk/src/org/jsampler/CC.java

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

revision 1708 by iliev, Wed Feb 20 15:20:34 2008 UTC revision 1737 by iliev, Thu May 8 17:26:19 2008 UTC
# Line 25  package org.jsampler; Line 25  package org.jsampler;
25  import java.awt.event.ActionEvent;  import java.awt.event.ActionEvent;
26  import java.awt.event.ActionListener;  import java.awt.event.ActionListener;
27    
 import java.io.ByteArrayInputStream;  
28  import java.io.ByteArrayOutputStream;  import java.io.ByteArrayOutputStream;
29  import java.io.File;  import java.io.File;
30  import java.io.FileInputStream;  import java.io.FileInputStream;
# Line 80  import org.w3c.dom.Document; Line 79  import org.w3c.dom.Document;
79  import org.w3c.dom.Node;  import org.w3c.dom.Node;
80    
81  import static org.jsampler.JSI18n.i18n;  import static org.jsampler.JSI18n.i18n;
 import static org.jsampler.JSPrefs.MANUAL_SERVER_SELECT_ON_STARTUP;  
82    
83    
84  /**  /**
# Line 136  public class CC { Line 134  public class CC {
134          scheduleTask(Task t) {          scheduleTask(Task t) {
135                  while(getTaskQueue().removeTask(t)) { }                  while(getTaskQueue().removeTask(t)) { }
136                                    
                 if(getTaskQueue().getPendingTaskCount() == 0) {  
                         if(t.equals(getTaskQueue().getRunningTask())) return;  
                 }  
                   
137                  getTaskQueue().add(t);                  getTaskQueue().add(t);
138          }          }
139                    
140          /**          /**
141             * Adds the specified task to the task queue only if the last
142             * task in the is not equal to <code>t</code>.
143             */
144            public static void
145            addTask(Task t) {
146                    Task[] tasks = getTaskQueue().getPendingTasks();
147                    if(tasks.length > 0 && tasks[tasks.length - 1].equals(t)) return;
148                    getTaskQueue().add(t);
149            }
150            
151            /**
152           * Gets the configuration of the current view.           * Gets the configuration of the current view.
153           */           */
154          public static JSViewConfig          public static JSViewConfig
# Line 404  public class CC { Line 409  public class CC {
409           */           */
410          public static InstrumentsDbTreeModel          public static InstrumentsDbTreeModel
411          getInstrumentsDbTreeModel() {          getInstrumentsDbTreeModel() {
412                    if(CC.getSamplerModel().getServerInfo() == null) return null;
413                  if(!CC.getSamplerModel().getServerInfo().hasInstrumentsDbSupport()) return null;                  if(!CC.getSamplerModel().getServerInfo().hasInstrumentsDbSupport()) return null;
414                                    
415                  if(instrumentsDbTreeModel == null) {                  if(instrumentsDbTreeModel == null) {
# Line 424  public class CC { Line 430  public class CC {
430                  idtmListeners.remove(l);                  idtmListeners.remove(l);
431          }          }
432                    
433            private static final LostFilesModel lostFilesModel = new LostFilesModel();
434            
435            public static LostFilesModel
436            getLostFilesModel() { return lostFilesModel; }
437            
438          /**          /**
439           * Loads the orchestras described in <code>&lt;jsampler_home&gt;/orchestras.xml</code>.           * Loads the orchestras described in <code>&lt;jsampler_home&gt;/orchestras.xml</code>.
440           * If file with name <code>orchestras.xml.bkp</code> exist in the JSampler's home           * If file with name <code>orchestras.xml.bkp</code> exist in the JSampler's home
# Line 782  public class CC { Line 793  public class CC {
793                                  getTaskQueue().add(mgim);                                  getTaskQueue().add(mgim);
794                                  getTaskQueue().add(new Midi.UpdateDevices());                                  getTaskQueue().add(new Midi.UpdateDevices());
795                                  getTaskQueue().add(new Audio.UpdateDevices());                                  getTaskQueue().add(new Audio.UpdateDevices());
796                                  getTaskQueue().add(uc);                                  addTask(uc);
797                          }                          }
798                  });                  });
799                                    
# Line 916  public class CC { Line 927  public class CC {
927                  exportInstrMapsToLscpScript(lscpClient);                  exportInstrMapsToLscpScript(lscpClient);
928                  sb.append(out.toString());                  sb.append(out.toString());
929                  out.reset();                  out.reset();
930                    sb.append("\r\n");
931                                    
932                  SamplerChannelModel[] channels = getSamplerModel().getChannels();                  SamplerChannelModel[] channels = getSamplerModel().getChannels();
933                                    
# Line 1091  public class CC { Line 1103  public class CC {
1103                  /** Invoked when the number of channels has changed. */                  /** Invoked when the number of channels has changed. */
1104                  public void                  public void
1105                  channelCountChanged( ChannelCountEvent e) {                  channelCountChanged( ChannelCountEvent e) {
1106                          getTaskQueue().add(new UpdateChannels());                          addTask(new UpdateChannels());
1107                  }                  }
1108                                    
1109                  /** Invoked when changes to the sampler channel has occured. */                  /** Invoked when changes to the sampler channel has occured. */
# Line 1205  public class CC { Line 1217  public class CC {
1217                  /** Invoked when the number of MIDI instruments in a MIDI instrument map is changed. */                  /** Invoked when the number of MIDI instruments in a MIDI instrument map is changed. */
1218                  public void                  public void
1219                  instrumentCountChanged(MidiInstrumentCountEvent e) {                  instrumentCountChanged(MidiInstrumentCountEvent e) {
1220                          getTaskQueue().add(new Midi.UpdateInstruments(e.getMapId()));                          scheduleTask(new Midi.UpdateInstruments(e.getMapId()));
1221                  }                  }
1222                                    
1223                  /** Invoked when a MIDI instrument in a MIDI instrument map is changed. */                  /** Invoked when a MIDI instrument in a MIDI instrument map is changed. */

Legend:
Removed from v.1708  
changed lines
  Added in v.1737

  ViewVC Help
Powered by ViewVC