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

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

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

revision 1544 by iliev, Sat Nov 3 13:14:31 2007 UTC revision 1545 by iliev, Tue Dec 4 18:28:29 2007 UTC
# Line 63  public class DefaultSamplerModel impleme Line 63  public class DefaultSamplerModel impleme
63          private MidiInputDriver[] miDrvS = null;          private MidiInputDriver[] miDrvS = null;
64          private SamplerEngine[] engines = null;          private SamplerEngine[] engines = null;
65                    
66            private int totalStreamCount = 0;
67          private int totalVoiceCount = 0;          private int totalVoiceCount = 0;
68          private int totalVoiceCountMax = 0;          private int totalVoiceCountMax = 0;
69                    
# Line 800  public class DefaultSamplerModel impleme Line 801  public class DefaultSamplerModel impleme
801          }          }
802                    
803          /**          /**
804             * Gets the total number of active streams.
805             * @return The total number of active streams.
806             */
807            public int
808            getTotalStreamCount() { return totalStreamCount; }
809            
810            /**
811           * Gets the total number of active voices.           * Gets the total number of active voices.
812           * @return The total number of active voices.           * @return The total number of active voices.
813           */           */
# Line 848  public class DefaultSamplerModel impleme Line 856  public class DefaultSamplerModel impleme
856          resetBackend() { CC.getTaskQueue().add(new org.jsampler.task.Global.ResetSampler()); }          resetBackend() { CC.getTaskQueue().add(new org.jsampler.task.Global.ResetSampler()); }
857                    
858          /**          /**
859             * Updates the current number of active disk streams in the sampler.
860             * @param count The new number of active streams.
861             */
862            public void
863            updateActiveStreamsInfo(int count) {
864                    if(totalStreamCount == count) return;
865                    
866                    totalStreamCount = count;
867                    fireTotalStreamCountChanged();
868            }
869            
870            /**
871           * Updates the current and the maximum number of active voices in the sampler.           * Updates the current and the maximum number of active voices in the sampler.
872           * @param count The new number of active voices.           * @param count The new number of active voices.
873           * @param countMax The maximum number of active voices.           * @param countMax The maximum number of active voices.
# Line 1097  public class DefaultSamplerModel impleme Line 1117  public class DefaultSamplerModel impleme
1117          }          }
1118                    
1119          /*          /*
1120             * Notifies listeners that the total number of active streams has changed.
1121             * This method can be invoked outside the event-dispatching thread.
1122             */
1123            private void
1124            fireTotalStreamCountChanged() {
1125                    final SamplerEvent e = new SamplerEvent(this);
1126                            
1127                    SwingUtilities.invokeLater(new Runnable() {
1128                            public void
1129                            run() { fireTotalStreamCountChanged(e); }
1130                    });
1131            }
1132            
1133            /**
1134             * Notifies listeners that the total number of active streams has changed.
1135             */
1136            private void
1137            fireTotalStreamCountChanged(SamplerEvent e) {
1138                    for(SamplerListener l : listeners) l.totalStreamCountChanged(e);
1139            }
1140            
1141            /*
1142           * Notifies listeners that the total number of active voices has changed.           * Notifies listeners that the total number of active voices has changed.
1143           * This method can be invoked outside the event-dispatching thread.           * This method can be invoked outside the event-dispatching thread.
1144           */           */

Legend:
Removed from v.1544  
changed lines
  Added in v.1545

  ViewVC Help
Powered by ViewVC