22 |
|
|
23 |
package org.jsampler.view; |
package org.jsampler.view; |
24 |
|
|
25 |
|
import java.beans.PropertyChangeEvent; |
26 |
|
import java.beans.PropertyChangeListener; |
27 |
|
|
28 |
import org.jsampler.JSPrefs; |
import org.jsampler.JSPrefs; |
29 |
|
|
30 |
|
import static org.jsampler.JSPrefs.VOL_MEASUREMENT_UNIT_DECIBEL; |
31 |
|
|
32 |
/** |
/** |
33 |
* Provides the view configuration. |
* Provides the view configuration. |
34 |
* @author Grigor Iliev |
* @author Grigor Iliev |
35 |
*/ |
*/ |
36 |
public abstract class JSViewConfig { |
public abstract class JSViewConfig { |
37 |
|
private boolean measurementUnitDecibel; |
38 |
|
|
39 |
/** Creates a new instance of <code>JSViewConfig</code> */ |
/** Creates a new instance of <code>JSViewConfig</code> */ |
40 |
public |
public |
41 |
JSViewConfig() { |
JSViewConfig() { |
42 |
|
measurementUnitDecibel = preferences().getBoolProperty(VOL_MEASUREMENT_UNIT_DECIBEL); |
43 |
|
|
44 |
|
String s = VOL_MEASUREMENT_UNIT_DECIBEL; |
45 |
|
preferences().addPropertyChangeListener(s, new PropertyChangeListener() { |
46 |
|
public void |
47 |
|
propertyChange(PropertyChangeEvent e) { |
48 |
|
boolean b; |
49 |
|
b = preferences().getBoolProperty(VOL_MEASUREMENT_UNIT_DECIBEL); |
50 |
|
measurementUnitDecibel = b; |
51 |
|
} |
52 |
|
}); |
53 |
} |
} |
54 |
|
|
55 |
/** |
/** |
70 |
*/ |
*/ |
71 |
public boolean |
public boolean |
72 |
getInstrumentsDbSupport() { return false; } |
getInstrumentsDbSupport() { return false; } |
73 |
|
|
74 |
|
/** |
75 |
|
* Determines whether the volume values should be shown in decibels. |
76 |
|
*/ |
77 |
|
public boolean |
78 |
|
isMeasurementUnitDecibel() { return measurementUnitDecibel; } |
79 |
} |
} |