/[svn]/jsampler/trunk/src/org/jsampler/view/classic/Channel.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/classic/Channel.java

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

revision 1742 by iliev, Thu Dec 6 19:37:41 2007 UTC revision 1743 by iliev, Sat May 31 23:04:01 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-2007 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 1486  class ChannelProperties extends JPanel { Line 1486  class ChannelProperties extends JPanel {
1486          private void          private void
1487          setUpdate(boolean b) { update = b; }          setUpdate(boolean b) { update = b; }
1488                    
1489            protected void
1490            onDestroy() {
1491                    SamplerModel sm = CC.getSamplerModel();
1492                    
1493                    sm.removeMidiDeviceListListener(getHandler());
1494                    sm.removeAudioDeviceListListener(getHandler());
1495                    sm.removeMidiInstrumentMapListListener(mapListListener);
1496                    sm.removeSamplerListener(samplerListener);
1497                    sm.removeSamplerChannelListListener(getHandler());
1498                    
1499                    if(midiDevice != null) {
1500                            midiDevice.removeMidiDeviceListener(getHandler());
1501                    }
1502                    
1503                    if(fxSendsDlg != null) fxSendsDlg.dispose();
1504            }
1505            
1506          private final Handler handler = new Handler();          private final Handler handler = new Handler();
1507                    
1508          private Handler          private Handler
# Line 1551  class ChannelProperties extends JPanel { Line 1568  class ChannelProperties extends JPanel {
1568                  channelRemoved(SamplerChannelListEvent e) {                  channelRemoved(SamplerChannelListEvent e) {
1569                          // Some cleanup when the channel is removed.                          // Some cleanup when the channel is removed.
1570                          if(e.getChannelModel().getChannelId() == channelModel.getChannelId()) {                          if(e.getChannelModel().getChannelId() == channelModel.getChannelId()) {
1571                                  SamplerModel sm = CC.getSamplerModel();                                  onDestroy();
                                   
                                 sm.removeMidiDeviceListListener(getHandler());  
                                 sm.removeAudioDeviceListListener(getHandler());  
                                 sm.removeMidiInstrumentMapListListener(mapListListener);  
                                 sm.removeSamplerListener(samplerListener);  
                                 sm.removeSamplerChannelListListener(getHandler());  
                                   
                                 if(midiDevice != null) {  
                                         midiDevice.removeMidiDeviceListener(getHandler());  
                                 }  
1572                          }                          }
1573                  }                  }
1574                                    

Legend:
Removed from v.1742  
changed lines
  Added in v.1743

  ViewVC Help
Powered by ViewVC