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. |
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() { |
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 |
/** |
/** |
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 |
} |
} |