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

Diff of /jsampler/trunk/src/org/jsampler/view/JSViewConfig.java

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

revision 1766 by iliev, Mon Aug 11 22:51:24 2008 UTC revision 1767 by iliev, Mon Sep 8 00:19:27 2008 UTC
# Line 26  import java.beans.PropertyChangeEvent; Line 26  import java.beans.PropertyChangeEvent;
26  import java.beans.PropertyChangeListener;  import java.beans.PropertyChangeListener;
27    
28  import org.jsampler.JSPrefs;  import org.jsampler.JSPrefs;
29    import org.jsampler.MidiInstrument;
30    
31  import static org.jsampler.JSPrefs.VOL_MEASUREMENT_UNIT_DECIBEL;  import static org.jsampler.JSPrefs.*;
32    
33  /**  /**
34   * Provides the view configuration.   * Provides the view configuration.
# Line 36  import static org.jsampler.JSPrefs.VOL_M Line 37  import static org.jsampler.JSPrefs.VOL_M
37  public abstract class JSViewConfig {  public abstract class JSViewConfig {
38          private boolean measurementUnitDecibel;          private boolean measurementUnitDecibel;
39                    
40            private int firstMidiBankNumber;
41            private int firstMidiProgramNumber;
42            
43          /** Creates a new instance of <code>JSViewConfig</code> */          /** Creates a new instance of <code>JSViewConfig</code> */
44          public          public
45          JSViewConfig() {          JSViewConfig() {
# Line 50  public abstract class JSViewConfig { Line 54  public abstract class JSViewConfig {
54                                  measurementUnitDecibel = b;                                  measurementUnitDecibel = b;
55                          }                          }
56                  });                  });
57                    
58                    firstMidiBankNumber = preferences().getIntProperty(FIRST_MIDI_BANK_NUMBER);
59                    firstMidiProgramNumber = preferences().getIntProperty(FIRST_MIDI_PROGRAM_NUMBER);
60                    
61                    MidiInstrument.setFirstProgramNumber(firstMidiProgramNumber);
62                    
63                    s = FIRST_MIDI_BANK_NUMBER;
64                    preferences().addPropertyChangeListener(s, new PropertyChangeListener() {
65                            public void
66                            propertyChange(PropertyChangeEvent e) {
67                                    firstMidiBankNumber = preferences().getIntProperty(FIRST_MIDI_BANK_NUMBER);
68                            }
69                    });
70                    
71                    s = FIRST_MIDI_PROGRAM_NUMBER;
72                    preferences().addPropertyChangeListener(s, new PropertyChangeListener() {
73                            public void
74                            propertyChange(PropertyChangeEvent e) {
75                                    firstMidiProgramNumber = preferences().getIntProperty(FIRST_MIDI_PROGRAM_NUMBER);
76                                    MidiInstrument.setFirstProgramNumber(firstMidiProgramNumber);
77                            }
78                    });
79          }          }
80                    
81          /**          /**
# Line 82  public abstract class JSViewConfig { Line 108  public abstract class JSViewConfig {
108          /** Exports the view configuration of the current session. */          /** Exports the view configuration of the current session. */
109          public String          public String
110          exportSessionViewConfig() { return ""; }          exportSessionViewConfig() { return ""; }
111            
112            public int
113            getFirstMidiBankNumber() { return firstMidiBankNumber; }
114            
115            public int
116            getFirstMidiProgramNumber() { return firstMidiProgramNumber; }
117  }  }

Legend:
Removed from v.1766  
changed lines
  Added in v.1767

  ViewVC Help
Powered by ViewVC