/[svn]/jsampler/trunk/src/org/jsampler/view/fantasia/AudioDevicesPane.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/fantasia/AudioDevicesPane.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 1818 by iliev, Wed Dec 24 17:29:47 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 45  import javax.swing.JScrollPane; Line 45  import javax.swing.JScrollPane;
45  import javax.swing.ListSelectionModel;  import javax.swing.ListSelectionModel;
46    
47  import net.sf.juife.ComponentList;  import net.sf.juife.ComponentList;
 import net.sf.juife.ComponentListModel;  
48  import net.sf.juife.DefaultComponentListModel;  import net.sf.juife.DefaultComponentListModel;
49    
50  import net.sf.juife.event.TaskEvent;  import net.sf.juife.event.TaskEvent;
# Line 61  import org.jsampler.event.ListListener; Line 60  import org.jsampler.event.ListListener;
60    
61  import org.jsampler.task.Audio;  import org.jsampler.task.Audio;
62    
63    import org.jsampler.view.JSViewConfig;
64    import org.jsampler.view.SessionViewConfig.DeviceConfig;
65    
66    import org.jsampler.view.fantasia.basic.PixmapButton;
67    import org.jsampler.view.fantasia.basic.PixmapPane;
68  import org.jsampler.view.std.JSNewAudioDeviceDlg;  import org.jsampler.view.std.JSNewAudioDeviceDlg;
69    
70  import org.linuxsampler.lscp.AudioOutputDriver;  import org.linuxsampler.lscp.AudioOutputDriver;
71    
 import static org.jsampler.view.fantasia.A4n.a4n;  
72  import static org.jsampler.view.fantasia.FantasiaI18n.i18n;  import static org.jsampler.view.fantasia.FantasiaI18n.i18n;
73  import static org.jsampler.view.fantasia.FantasiaPrefs.*;  import static org.jsampler.view.fantasia.FantasiaPrefs.*;
74    
# Line 97  public class AudioDevicesPane extends JP Line 100  public class AudioDevicesPane extends JP
100                  }                  }
101          }          }
102                    
103            public int
104            getDevicePaneCount() { return listModel.size(); }
105            
106            public AudioDevicePane
107            getDevicePaneAt(int index) { return listModel.get(index); }
108            
109          private void          private void
110          addDevice(AudioDeviceModel model) {          addDevice(AudioDeviceModel model) {
111                  for(int i = 0; i < listModel.getSize(); i++) {                  for(int i = 0; i < listModel.getSize(); i++) {
# Line 106  public class AudioDevicesPane extends JP Line 115  public class AudioDevicesPane extends JP
115                          }                          }
116                  }                  }
117                                    
118                  listModel.add(new AudioDevicePane(model));                  AudioDevicePane dev = new AudioDevicePane(model);
119                    DeviceConfig config = null;
120                    JSViewConfig viewConfig = CC.getViewConfig();
121                    if(viewConfig != null && viewConfig.getSessionViewConfig() != null) {
122                            config = viewConfig.getSessionViewConfig().pollAudioDeviceConfig();
123                    }
124                    
125                    if(config != null && config.expanded) dev.showOptionsPane(true);
126                    
127                    listModel.add(dev);
128          }          }
129                    
130          private void          private void
# Line 124  public class AudioDevicesPane extends JP Line 142  public class AudioDevicesPane extends JP
142          class DeviceListPane extends ComponentList {          class DeviceListPane extends ComponentList {
143                  private Dimension maxSize = new Dimension();                  private Dimension maxSize = new Dimension();
144                                    
145                    @Override
146                  public Dimension                  public Dimension
147                  getMaximumSize() {                  getMaximumSize() {
148                          maxSize.width = Short.MAX_VALUE;                          maxSize.width = Short.MAX_VALUE;
# Line 326  public class AudioDevicesPane extends JP Line 345  public class AudioDevicesPane extends JP
345          getHandler() { return eventHandler; }          getHandler() { return eventHandler; }
346                    
347          private class EventHandler implements ListListener<AudioDeviceModel> {          private class EventHandler implements ListListener<AudioDeviceModel> {
348                    @Override
349                  public void                  public void
350                  entryAdded(ListEvent<AudioDeviceModel> e) {                  entryAdded(ListEvent<AudioDeviceModel> e) {
351                          addDevice(e.getEntry());                          addDevice(e.getEntry());
352                  }                  }
353                                    
354                    @Override
355                  public void                  public void
356                  entryRemoved(ListEvent<AudioDeviceModel> e) {                  entryRemoved(ListEvent<AudioDeviceModel> e) {
357                          removeDevice(e.getEntry());                          removeDevice(e.getEntry());

Legend:
Removed from v.1688  
changed lines
  Added in v.1818

  ViewVC Help
Powered by ViewVC