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 |
* |
* |
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 |
/** |
/** |
62 |
*/ |
*/ |
63 |
public abstract InstrumentsDbTableView getInstrumentsDbTableView(); |
public abstract InstrumentsDbTableView getInstrumentsDbTableView(); |
64 |
|
|
65 |
|
public abstract BasicIconSet getBasicIconSet(); |
66 |
|
|
67 |
public abstract JSPrefs preferences(); |
public abstract JSPrefs preferences(); |
68 |
|
|
69 |
/** |
/** |
72 |
*/ |
*/ |
73 |
public boolean |
public boolean |
74 |
getInstrumentsDbSupport() { return false; } |
getInstrumentsDbSupport() { return false; } |
75 |
|
|
76 |
|
/** |
77 |
|
* Determines whether the volume values should be shown in decibels. |
78 |
|
*/ |
79 |
|
public boolean |
80 |
|
isMeasurementUnitDecibel() { return measurementUnitDecibel; } |
81 |
|
|
82 |
|
/** Exports the view configuration of the current session. */ |
83 |
|
public String |
84 |
|
exportSessionViewConfig() { return ""; } |
85 |
} |
} |