/[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 1285 by iliev, Fri Aug 10 19:55:03 2007 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 42  import java.util.logging.StreamHandler; Line 41  import java.util.logging.StreamHandler;
41    
42  import javax.swing.Timer;  import javax.swing.Timer;
43    
44    import javax.swing.event.ChangeEvent;
45    import javax.swing.event.ChangeListener;
46    
47  import net.sf.juife.Task;  import net.sf.juife.Task;
48  import net.sf.juife.TaskQueue;  import net.sf.juife.TaskQueue;
49    
# Line 132  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
155          getViewConfig() { return viewConfig; }          getViewConfig() { return viewConfig; }
156                    
157            private static JSPrefs
158            preferences() { return getViewConfig().preferences(); }
159            
160          /**          /**
161           * Sets the configuration of the current view.           * Sets the configuration of the current view.
162           */           */
# Line 233  public class CC { Line 245  public class CC {
245                                    
246                  HF.setUIDefaultFont(Prefs.getInterfaceFont());                  HF.setUIDefaultFont(Prefs.getInterfaceFont());
247                                    
                 getClient().setServerAddress(Prefs.getLSAddress());  
                 getClient().setServerPort(Prefs.getLSPort());  
                   
248                  timer.setRepeats(false);                  timer.setRepeats(false);
249                                    
250                  timer.addActionListener(new ActionListener() {                  timer.addActionListener(new ActionListener() {
# Line 265  public class CC { Line 274  public class CC {
274                  getClient().removeVoiceCountListener(getHandler());                  getClient().removeVoiceCountListener(getHandler());
275                  getClient().addVoiceCountListener(getHandler());                  getClient().addVoiceCountListener(getHandler());
276                                    
277                    getClient().removeTotalStreamCountListener(getHandler());
278                    getClient().addTotalStreamCountListener(getHandler());
279                    
280                  getClient().removeTotalVoiceCountListener(getHandler());                  getClient().removeTotalVoiceCountListener(getHandler());
281                  getClient().addTotalVoiceCountListener(getHandler());                  getClient().addTotalVoiceCountListener(getHandler());
282                                    
# Line 369  public class CC { Line 381  public class CC {
381          public static OrchestraListModel          public static OrchestraListModel
382          getOrchestras() { return orchestras; }          getOrchestras() { return orchestras; }
383                    
384            private final static ServerList servers = new ServerList();
385            
386            /** Returns the server list. */
387            public static ServerList
388            getServerList() { return servers; }
389            
390            private static ServerListListener serverListListener = new ServerListListener();
391            
392            private static class ServerListListener implements ChangeListener {
393                    public void
394                    stateChanged(ChangeEvent e) {
395                            saveServerList();
396                    }
397            }
398            
399            private static final Vector<ChangeListener> idtmListeners = new Vector<ChangeListener>();
400          private static InstrumentsDbTreeModel instrumentsDbTreeModel = null;          private static InstrumentsDbTreeModel instrumentsDbTreeModel = null;
401            
402          /**          /**
403           * Gets the tree model of the instruments database.           * Gets the tree model of the instruments database.
404           * If the currently used view doesn't have instruments           * If the currently used view doesn't have instruments
405           * database support the tree model is initialized on first use.           * database support the tree model is initialized on first use.
406           * @return The tree model of the instruments database or           * @return The tree model of the instruments database or
407           * <code>null</code> if the backend doesn't have instruments database support.           * <code>null</code> if the backend doesn't have instruments database support.
408           * @see org.jsampler.view.JSMainFrame#getInstrumentsDbSupport           * @see org.jsampler.view.JSViewConfig#getInstrumentsDbSupport
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) {
416                          instrumentsDbTreeModel = new InstrumentsDbTreeModel();                          instrumentsDbTreeModel = new InstrumentsDbTreeModel();
417                            for(ChangeListener l : idtmListeners) l.stateChanged(null);
418                  }                  }
419                                    
420                  return instrumentsDbTreeModel;                  return instrumentsDbTreeModel;
421          }          }
422                    
423            public static void
424            addInstrumentsDbChangeListener(ChangeListener l) {
425                    idtmListeners.add(l);
426            }
427            
428            public static void
429            removeInstrumentsDbChangeListener(ChangeListener l) {
430                    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 400  public class CC { Line 446  public class CC {
446          loadOrchestras() {          loadOrchestras() {
447                  if(getJSamplerHome() == null) return;                  if(getJSamplerHome() == null) return;
448                                    
                 //TODO: This should be removed in the next release (including loadOrchestras0())  
                 File f2 = new File(getJSamplerHome() + File.separator + "orchestras.xml");  
                 if(!f2.isFile()) {  
                         loadOrchestras0();  
                         saveOrchestras();  
                         return;  
                 }  
                 ///////  
                   
449                  try {                  try {
450                          String s = getJSamplerHome();                          String s = getJSamplerHome();
                         if(s == null) return;  
451                                                    
452                          File f = new File(s + File.separator + "orchestras.xml.bkp");                          File f = new File(s + File.separator + "orchestras.xml.bkp");
453                          if(f.isFile()) HF.createBackup("orchestras.xml.bkp", "orchestras.xml.rec");                          if(f.isFile()) HF.createBackup("orchestras.xml.bkp", "orchestras.xml.rec");
# Line 424  public class CC { Line 460  public class CC {
460                  } catch(Exception x) {                  } catch(Exception x) {
461                          getLogger().log(Level.INFO, HF.getErrorMessage(x), x);                          getLogger().log(Level.INFO, HF.getErrorMessage(x), x);
462                  }                  }
463                    
464                    getOrchestras().addOrchestraListListener(getHandler());
465          }          }
466                    
467                    
# Line 440  public class CC { Line 478  public class CC {
478                  for(int i = 0; i < getOrchestras().getOrchestraCount(); i++) {                  for(int i = 0; i < getOrchestras().getOrchestraCount(); i++) {
479                          getOrchestras().getOrchestra(i).addOrchestraListener(getHandler());                          getOrchestras().getOrchestra(i).addOrchestraListener(getHandler());
480                  }                  }
                 getOrchestras().addOrchestraListListener(getHandler());  
         }  
           
         private static void  
         loadOrchestras0() {  
                 String s = Prefs.getOrchestras();  
                 if(s == null) return;  
                   
                 ByteArrayInputStream bais = new ByteArrayInputStream(s.getBytes());  
                 Document doc = DOMUtils.readObject(bais);  
                   
                 try { getOrchestras().readObject(doc.getDocumentElement()); }  
                 catch(Exception x) { HF.showErrorMessage(x, "Loading orchestras: "); }  
481          }          }
482                    
483          private static void          private static void
# Line 487  public class CC { Line 512  public class CC {
512          }          }
513                    
514          /**          /**
515             * Loads the servers' info described in <code>&lt;jsampler_home&gt;/servers.xml</code>.
516             * If file with name <code>servers.xml.bkp</code> exist in the JSampler's home
517             * directory, this means that the last save has failed. In that case a recovery file
518             * <code>servers.xml.rec</code> is created and a recovery procedure
519             * will be initiated.
520             */
521            public static void
522            loadServerList() {
523                    if(getJSamplerHome() == null) return;
524                    
525                    try {
526                            String s = getJSamplerHome();
527                            
528                            File f = new File(s + File.separator + "servers.xml.bkp");
529                            if(f.isFile()) HF.createBackup("servers.xml.bkp", "servers.xml.rec");
530                            
531                            FileInputStream fis;
532                            fis = new FileInputStream(s + File.separator + "servers.xml");
533                            
534                            loadServerList(fis);
535                            fis.close();
536                    } catch(Exception x) {
537                            getLogger().log(Level.INFO, HF.getErrorMessage(x), x);
538                    }
539                    
540                    getServerList().addChangeListener(serverListListener);
541                    
542                    /* We should have at least one server to connect. */
543                    if(getServerList().getServerCount() == 0) {
544                            Server server = new Server();
545                            server.setName("127.0.0.1:8888");
546                            server.setAddress("127.0.0.1");
547                            server.setPort(8888);
548                            getServerList().addServer(server);
549                    }
550            }
551            
552            
553            private static void
554            loadServerList(InputStream in) {
555                    Document doc = DOMUtils.readObject(in);
556                    
557                    try { getServerList().readObject(doc.getDocumentElement()); }
558                    catch(Exception x) {
559                            HF.showErrorMessage(x, "Loading server list: ");
560                            return;
561                    }
562            }
563            
564            private static void
565            saveServerList() {
566                    try {
567                            String s = getJSamplerHome();
568                            if(s == null) return;
569                            
570                            HF.createBackup("servers.xml", "servers.xml.bkp");
571                            
572                            FileOutputStream fos;
573                            fos = new FileOutputStream(s + File.separator + "servers.xml", false);
574                            
575                            Document doc = DOMUtils.createEmptyDocument();
576                    
577                            Node node = doc.createElement("temp");
578                            doc.appendChild(node);
579                            
580                            getServerList().writeObject(doc, doc.getDocumentElement());
581                            
582                            doc.replaceChild(node.getFirstChild(), node);
583                    
584                            DOMUtils.writeObject(doc, fos);
585                            
586                            fos.close();
587                            
588                            HF.deleteFile("servers.xml.bkp");
589                    } catch(Exception x) {
590                            HF.showErrorMessage(x, "Saving server list: ");
591                            return;
592                    }
593            }
594            
595            /**
596           * The exit point of the application which ensures clean exit with default exit status 0.           * The exit point of the application which ensures clean exit with default exit status 0.
597           *  @see #cleanExit(int i)           *  @see #cleanExit(int i)
598           */           */
# Line 542  public class CC { Line 648  public class CC {
648          getSamplerModel() { return samplerModel; }          getSamplerModel() { return samplerModel; }
649                    
650          /**          /**
651             * Connects to LinuxSampler.
652             */
653            public static void
654            connect() { initSamplerModel(); }
655            
656            /**
657           * Reconnects to LinuxSampler.           * Reconnects to LinuxSampler.
658           */           */
659          public static void          public static void
660          reconnect() {          reconnect() { initSamplerModel(getCurrentServer()); }
661                  initSamplerModel();          
662                  fireReconnectEvent();          private static Server currentServer = null;
         }  
663                    
664          /**          /**
665           * This method updates the information about the backend state.           * Gets the server, to which the frontend is going to connect
666             * or is already connected.
667             */
668            public static Server
669            getCurrentServer() { return currentServer; }
670            
671            /**
672             * Sets the current server.
673           */           */
674          public static void          public static void
675            setCurrentServer(Server server) { currentServer = server; }
676            
677            /**
678             * This method updates the information about the backend state.
679             */
680            private static void
681          initSamplerModel() {          initSamplerModel() {
682                    Server srv = getMainFrame().getServer();
683                    if(srv == null) return;
684                    initSamplerModel(srv);
685            }
686            
687            /**
688             * This method updates the information about the backend state.
689             */
690            private static void
691            initSamplerModel(Server srv) {
692                    setCurrentServer(srv);
693                    final SetServerAddress ssa = new SetServerAddress(srv.getAddress(), srv.getPort());
694                    
695                  final DefaultSamplerModel model = (DefaultSamplerModel)getSamplerModel();                  final DefaultSamplerModel model = (DefaultSamplerModel)getSamplerModel();
696                                    
697                  final Global.GetServerInfo gsi = new Global.GetServerInfo();                  final Global.GetServerInfo gsi = new Global.GetServerInfo();
# Line 631  public class CC { Line 768  public class CC {
768                                          gfs.addTaskListener(new GetFxSendsListener());                                          gfs.addTaskListener(new GetFxSendsListener());
769                                          getTaskQueue().add(gfs);                                          getTaskQueue().add(gfs);
770                                  }                                  }
771                                    
772                                    // TODO: This should be done after the fx sends are set
773                                    //CC.getSamplerModel().setModified(false);
774                          }                          }
775                  });                  });
776                                    
# Line 639  public class CC { Line 779  public class CC {
779                  cnt.addTaskListener(new TaskListener() {                  cnt.addTaskListener(new TaskListener() {
780                          public void                          public void
781                          taskPerformed(TaskEvent e) {                          taskPerformed(TaskEvent e) {
782                                  if(cnt.doneWithErrors()) return;                                  if(cnt.doneWithErrors()) {
783                                            setCurrentServer(null);
784                                            retryToConnect();
785                                            return;
786                                    }
787                                                                    
788                                  getTaskQueue().add(gsi);                                  getTaskQueue().add(gsi);
789                                  getTaskQueue().add(gaod);                                  getTaskQueue().add(gaod);
# Line 649  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                    
800                    ssa.addTaskListener(new TaskListener() {
801                            public void
802                            taskPerformed(TaskEvent e) {
803                                    CC.getTaskQueue().add(cnt);
804                          }                          }
805                  });                  });
806                  getTaskQueue().add(cnt);                  
807                    getSamplerModel().reset();
808                    if(instrumentsDbTreeModel != null) {
809                            instrumentsDbTreeModel.reset();
810                            instrumentsDbTreeModel = null;
811                    }
812                    
813                    getTaskQueue().removePendingTasks();
814                    getTaskQueue().add(ssa);
815                    
816                    fireReconnectEvent();
817            }
818            
819            private static void
820            retryToConnect() {
821                    javax.swing.SwingUtilities.invokeLater(new Runnable() {
822                            public void
823                            run() { changeBackend(); }
824                    });
825            }
826            
827            public static void
828            changeBackend() {
829                    Server s = getMainFrame().getServer(true);
830                    if(s != null) initSamplerModel(s);
831          }          }
832                    
833          private static class GetFxSendsListener implements TaskListener {          private static class GetFxSendsListener implements TaskListener {
# Line 711  public class CC { Line 886  public class CC {
886                    
887          public static String          public static String
888          exportSessionToLscpScript() {          exportSessionToLscpScript() {
889                    CC.getSamplerModel().setModified(false);
890                    
891                  StringBuffer sb = new StringBuffer("# Exported by: ");                  StringBuffer sb = new StringBuffer("# Exported by: ");
892                  sb.append("JSampler - a java front-end for LinuxSampler\r\n# Version: ");                  sb.append("JSampler - a java front-end for LinuxSampler\r\n# Version: ");
893                  sb.append(JSampler.VERSION).append("\r\n");                  sb.append(JSampler.VERSION).append("\r\n");
# Line 747  public class CC { Line 924  public class CC {
924                          sb.append("\r\n");                          sb.append("\r\n");
925                  }                  }
926                                    
927                    exportInstrMapsToLscpScript(lscpClient);
928                    sb.append(out.toString());
929                    out.reset();
930                    sb.append("\r\n");
931                    
932                  SamplerChannelModel[] channels = getSamplerModel().getChannels();                  SamplerChannelModel[] channels = getSamplerModel().getChannels();
933                                    
934                  for(int i = 0; i < channels.length; i++) {                  for(int i = 0; i < channels.length; i++) {
935                          SamplerChannelModel scm = getSamplerModel().getChannelById(i);                          SamplerChannelModel scm = channels[i];
936                          exportChannelToLscpScript(scm.getChannelInfo(), i, lscpClient);                          exportChannelToLscpScript(scm.getChannelInfo(), i, lscpClient);
937                          sb.append(out.toString());                          sb.append(out.toString());
938                          out.reset();                          out.reset();
# Line 764  public class CC { Line 946  public class CC {
946                          sb.append("\r\n");                          sb.append("\r\n");
947                  }                  }
948                                    
                 exportInstrMapsToLscpScript(lscpClient);  
                 sb.append(out.toString());  
                 out.reset();  
                   
949                  return sb.toString();                  return sb.toString();
950          }          }
951                    
# Line 818  public class CC { Line 996  public class CC {
996                  try {                  try {
997                          lscpCLient.addSamplerChannel();                          lscpCLient.addSamplerChannel();
998                                                    
999                          int i = chn.getMidiInputDevice();                          SamplerModel sm = CC.getSamplerModel();
1000                          if(i != -1) lscpCLient.setChannelMidiInputDevice(chnId, i);                          int id = chn.getMidiInputDevice();
1001                          lscpCLient.setChannelMidiInputPort(chnId, chn.getMidiInputPort());                          if(id != -1) {
1002                          lscpCLient.setChannelMidiInputChannel(chnId, chn.getMidiInputChannel());                                  for(int i = 0; i < sm.getMidiDeviceCount(); i++) {
1003                                                                    if(sm.getMidiDevice(i).getDeviceId() == id) {
1004                          i = chn.getAudioOutputDevice();                                                  lscpCLient.setChannelMidiInputDevice(chnId, i);
1005                          if(i != -1) {                                                  break;
1006                                  lscpCLient.setChannelAudioOutputDevice(chnId, i);                                          }
1007                                    }
1008                                    lscpCLient.setChannelMidiInputPort(chnId, chn.getMidiInputPort());
1009                                    lscpCLient.setChannelMidiInputChannel(chnId, chn.getMidiInputChannel());
1010                            }
1011                            
1012                            if(chn.getEngine() != null) {
1013                                    lscpCLient.loadSamplerEngine(chn.getEngine().getName(), chnId);
1014                                    lscpCLient.setChannelVolume(chnId, chn.getVolume());
1015                                    int mapId = chn.getMidiInstrumentMapId();
1016                                    lscpCLient.setChannelMidiInstrumentMap(chnId, mapId);
1017                            }
1018                            
1019                            id = chn.getAudioOutputDevice();
1020                            if(id != -1) {
1021                                    for(int i = 0; i < sm.getAudioDeviceCount(); i++) {
1022                                            if(sm.getAudioDevice(i).getDeviceId() == id) {
1023                                                    lscpCLient.setChannelAudioOutputDevice(chnId, i);
1024                                                    break;
1025                                            }
1026                                    }
1027                                    
1028                                  Integer[] routing = chn.getAudioOutputRouting();                                  Integer[] routing = chn.getAudioOutputRouting();
1029                                                                    
1030                                  for(int j = 0; j < routing.length; j++) {                                  for(int j = 0; j < routing.length; j++) {
# Line 836  public class CC { Line 1035  public class CC {
1035                                  }                                  }
1036                          }                          }
1037                                                    
                         if(chn.getEngine() != null) {  
                                 lscpCLient.loadSamplerEngine(chn.getEngine().getName(), chnId);  
                                 lscpCLient.setChannelVolume(chnId, chn.getVolume());  
                         }  
                           
1038                          String s = chn.getInstrumentFile();                          String s = chn.getInstrumentFile();
1039                          i = chn.getInstrumentIndex();                          int i = chn.getInstrumentIndex();
1040                          if(s != null) lscpCLient.loadInstrument(s, i, chnId, true);                          if(s != null) lscpCLient.loadInstrument(s, i, chnId, true);
1041                                                    
1042                          if(chn.isMuted()) lscpCLient.setChannelMute(chnId, true);                          if(chn.isMuted()) lscpCLient.setChannelMute(chnId, true);
# Line 871  public class CC { Line 1065  public class CC {
1065                  }                  }
1066          }          }
1067                    
1068            public static void
1069            scheduleInTaskQueue(final Runnable r) {
1070                    Task dummy = new Global.DummyTask();
1071                    dummy.addTaskListener(new TaskListener() {
1072                            public void
1073                            taskPerformed(TaskEvent e) {
1074                                    javax.swing.SwingUtilities.invokeLater(r);
1075                            }
1076                    });
1077                    
1078                    CC.getTaskQueue().add(dummy);
1079            }
1080            
1081            public static boolean
1082            verifyConnection() {
1083                    if(getCurrentServer() == null) {
1084                            HF.showErrorMessage(i18n.getError("CC.notConnected"));
1085                            return false;
1086                    }
1087                    
1088                    return true;
1089            }
1090            
1091                    
1092          private final static EventHandler eventHandler = new EventHandler();          private final static EventHandler eventHandler = new EventHandler();
1093                    
# Line 879  public class CC { Line 1096  public class CC {
1096                    
1097          private static class EventHandler implements ChannelCountListener, ChannelInfoListener,          private static class EventHandler implements ChannelCountListener, ChannelInfoListener,
1098                  FxSendCountListener, FxSendInfoListener, StreamCountListener, VoiceCountListener,                  FxSendCountListener, FxSendInfoListener, StreamCountListener, VoiceCountListener,
1099                  TotalVoiceCountListener, TaskQueueListener, OrchestraListener,                  TotalStreamCountListener, TotalVoiceCountListener, TaskQueueListener,
1100                  ListListener<OrchestraModel>, MidiInstrumentCountListener,                  OrchestraListener, ListListener<OrchestraModel>, MidiInstrumentCountListener,
1101                  MidiInstrumentInfoListener, GlobalInfoListener {                  MidiInstrumentInfoListener, GlobalInfoListener {
1102                                    
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 985  public class CC { Line 1202  public class CC {
1202                          scm.setVoiceCount(e.getVoiceCount());                          scm.setVoiceCount(e.getVoiceCount());
1203                  }                  }
1204                                    
1205                    /** Invoked when the total number of active streams has changed. */
1206                    public void
1207                    totalStreamCountChanged(TotalStreamCountEvent e) {
1208                            getSamplerModel().updateActiveStreamsInfo(e.getTotalStreamCount());
1209                    }
1210                    
1211                  /** Invoked when the total number of active voices has changed. */                  /** Invoked when the total number of active voices has changed. */
1212                  public void                  public void
1213                  totalVoiceCountChanged(TotalVoiceCountEvent e) {                  totalVoiceCountChanged(TotalVoiceCountEvent e) {
# Line 994  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.1285  
changed lines
  Added in v.1737

  ViewVC Help
Powered by ViewVC