/[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 1688 by iliev, Thu Feb 14 16:52:36 2008 UTC revision 1734 by iliev, Sun May 4 18:40:13 2008 UTC
# Line 136  public class CC { Line 136  public class CC {
136          scheduleTask(Task t) {          scheduleTask(Task t) {
137                  while(getTaskQueue().removeTask(t)) { }                  while(getTaskQueue().removeTask(t)) { }
138                                    
                 if(getTaskQueue().getPendingTaskCount() == 0) {  
                         if(t.equals(getTaskQueue().getRunningTask())) return;  
                 }  
                   
139                  getTaskQueue().add(t);                  getTaskQueue().add(t);
140          }          }
141                    
142          /**          /**
143             * Adds the specified task to the task queue only if the last
144             * task in the is not equal to <code>t</code>.
145             */
146            public static void
147            addTask(Task t) {
148                    Task[] tasks = getTaskQueue().getPendingTasks();
149                    if(tasks.length > 0 && tasks[tasks.length - 1].equals(t)) return;
150                    getTaskQueue().add(t);
151            }
152            
153            /**
154           * Gets the configuration of the current view.           * Gets the configuration of the current view.
155           */           */
156          public static JSViewConfig          public static JSViewConfig
# Line 404  public class CC { Line 411  public class CC {
411           */           */
412          public static InstrumentsDbTreeModel          public static InstrumentsDbTreeModel
413          getInstrumentsDbTreeModel() {          getInstrumentsDbTreeModel() {
414                    if(CC.getSamplerModel().getServerInfo() == null) return null;
415                  if(!CC.getSamplerModel().getServerInfo().hasInstrumentsDbSupport()) return null;                  if(!CC.getSamplerModel().getServerInfo().hasInstrumentsDbSupport()) return null;
416                                    
417                  if(instrumentsDbTreeModel == null) {                  if(instrumentsDbTreeModel == null) {
# Line 424  public class CC { Line 432  public class CC {
432                  idtmListeners.remove(l);                  idtmListeners.remove(l);
433          }          }
434                    
435            private static final LostFilesModel lostFilesModel = new LostFilesModel();
436            
437            public static LostFilesModel
438            getLostFilesModel() { return lostFilesModel; }
439            
440          /**          /**
441           * 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>.
442           * 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 795  public class CC {
795                                  getTaskQueue().add(mgim);                                  getTaskQueue().add(mgim);
796                                  getTaskQueue().add(new Midi.UpdateDevices());                                  getTaskQueue().add(new Midi.UpdateDevices());
797                                  getTaskQueue().add(new Audio.UpdateDevices());                                  getTaskQueue().add(new Audio.UpdateDevices());
798                                  getTaskQueue().add(uc);                                  addTask(uc);
799                          }                          }
800                  });                  });
801                                    
# Line 913  public class CC { Line 926  public class CC {
926                          sb.append("\r\n");                          sb.append("\r\n");
927                  }                  }
928                                    
929                    exportInstrMapsToLscpScript(lscpClient);
930                    sb.append(out.toString());
931                    out.reset();
932                    sb.append("\r\n");
933                    
934                  SamplerChannelModel[] channels = getSamplerModel().getChannels();                  SamplerChannelModel[] channels = getSamplerModel().getChannels();
935                                    
936                  for(int i = 0; i < channels.length; i++) {                  for(int i = 0; i < channels.length; i++) {
# Line 930  public class CC { Line 948  public class CC {
948                          sb.append("\r\n");                          sb.append("\r\n");
949                  }                  }
950                                    
                 exportInstrMapsToLscpScript(lscpClient);  
                 sb.append(out.toString());  
                 out.reset();  
                   
951                  return sb.toString();                  return sb.toString();
952          }          }
953                    
# Line 1000  public class CC { Line 1014  public class CC {
1014                          if(chn.getEngine() != null) {                          if(chn.getEngine() != null) {
1015                                  lscpCLient.loadSamplerEngine(chn.getEngine().getName(), chnId);                                  lscpCLient.loadSamplerEngine(chn.getEngine().getName(), chnId);
1016                                  lscpCLient.setChannelVolume(chnId, chn.getVolume());                                  lscpCLient.setChannelVolume(chnId, chn.getVolume());
1017                                    int mapId = chn.getMidiInstrumentMapId();
1018                                    lscpCLient.setChannelMidiInstrumentMap(chnId, mapId);
1019                          }                          }
1020                                                    
1021                          id = chn.getAudioOutputDevice();                          id = chn.getAudioOutputDevice();
# Line 1089  public class CC { Line 1105  public class CC {
1105                  /** Invoked when the number of channels has changed. */                  /** Invoked when the number of channels has changed. */
1106                  public void                  public void
1107                  channelCountChanged( ChannelCountEvent e) {                  channelCountChanged( ChannelCountEvent e) {
1108                          getTaskQueue().add(new UpdateChannels());                          addTask(new UpdateChannels());
1109                  }                  }
1110                                    
1111                  /** Invoked when changes to the sampler channel has occured. */                  /** Invoked when changes to the sampler channel has occured. */
# Line 1203  public class CC { Line 1219  public class CC {
1219                  /** 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. */
1220                  public void                  public void
1221                  instrumentCountChanged(MidiInstrumentCountEvent e) {                  instrumentCountChanged(MidiInstrumentCountEvent e) {
1222                          getTaskQueue().add(new Midi.UpdateInstruments(e.getMapId()));                          scheduleTask(new Midi.UpdateInstruments(e.getMapId()));
1223                  }                  }
1224                                    
1225                  /** 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.1688  
changed lines
  Added in v.1734

  ViewVC Help
Powered by ViewVC