1 |
iliev |
912 |
/* |
2 |
|
|
* JSampler - a java front-end for LinuxSampler |
3 |
|
|
* |
4 |
iliev |
1872 |
* Copyright (C) 2005-2009 Grigor Iliev <grigor@grigoriliev.com> |
5 |
iliev |
912 |
* |
6 |
|
|
* This file is part of JSampler. |
7 |
|
|
* |
8 |
|
|
* JSampler is free software; you can redistribute it and/or modify |
9 |
|
|
* it under the terms of the GNU General Public License version 2 |
10 |
|
|
* as published by the Free Software Foundation. |
11 |
|
|
* |
12 |
|
|
* JSampler is distributed in the hope that it will be useful, |
13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
|
* GNU General Public License for more details. |
16 |
|
|
* |
17 |
|
|
* You should have received a copy of the GNU General Public License |
18 |
|
|
* along with JSampler; if not, write to the Free Software |
19 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
20 |
|
|
* MA 02111-1307 USA |
21 |
|
|
*/ |
22 |
|
|
|
23 |
|
|
package org.jsampler.view.fantasia; |
24 |
|
|
|
25 |
iliev |
2288 |
import org.jsampler.JSPrefs; |
26 |
iliev |
912 |
|
27 |
iliev |
1285 |
|
28 |
iliev |
912 |
/** |
29 |
|
|
* |
30 |
|
|
* @author Grigor Iliev |
31 |
|
|
*/ |
32 |
iliev |
2288 |
public class FantasiaPrefs extends JSPrefs { |
33 |
iliev |
1285 |
/** Property which specifies whether to use animation effects. */ |
34 |
|
|
public final static String ANIMATED = "animated"; |
35 |
iliev |
912 |
|
36 |
|
|
private final static String WINDOW_LOCATION = "Mainframe.sizeAndLocation"; |
37 |
|
|
private final static String DEF_WINDOW_LOCATION = null; |
38 |
|
|
|
39 |
iliev |
1285 |
private final static FantasiaPrefs prefs = new FantasiaPrefs(); |
40 |
iliev |
912 |
|
41 |
iliev |
1285 |
|
42 |
iliev |
912 |
/** Forbits instantiation of <code>FantasiaPrefs</code>. */ |
43 |
iliev |
1285 |
private |
44 |
|
|
FantasiaPrefs() { super("org.jsampler.view.fantasia"); } |
45 |
iliev |
912 |
|
46 |
iliev |
1285 |
public static FantasiaPrefs |
47 |
|
|
preferences() { return prefs; } |
48 |
iliev |
912 |
|
49 |
|
|
/** |
50 |
|
|
* Gets a string representation of the main window's location. |
51 |
|
|
* The string representation is a comma-separated list |
52 |
|
|
* of x and y coordinates. |
53 |
|
|
* @return A string representation of the main window's location, |
54 |
|
|
* or <code>null</code> if the value is not set. |
55 |
|
|
*/ |
56 |
iliev |
1285 |
public String |
57 |
iliev |
912 |
getWindowLocation() { |
58 |
iliev |
1285 |
return getStringProperty(WINDOW_LOCATION, DEF_WINDOW_LOCATION); |
59 |
iliev |
912 |
} |
60 |
|
|
|
61 |
|
|
/** |
62 |
iliev |
1285 |
* Sets the main window's location. |
63 |
iliev |
912 |
* Use <code>null</code> to remove the current value. |
64 |
|
|
* @param s A string representation of the main window'socation. |
65 |
|
|
* @see #getWindowLocation |
66 |
|
|
*/ |
67 |
iliev |
1285 |
public void |
68 |
iliev |
912 |
setWindowLocation(String s) { |
69 |
iliev |
1285 |
setStringProperty(WINDOW_LOCATION, s); |
70 |
iliev |
912 |
} |
71 |
|
|
|
72 |
iliev |
1285 |
public int |
73 |
|
|
getDefaultIntValue(String name) { |
74 |
|
|
if(name == LS_CONSOLE_BACKGROUND_COLOR) return 0x626262; |
75 |
|
|
if(name == LS_CONSOLE_TEXT_COLOR) return 0xb4b4b4; |
76 |
|
|
if(name == LS_CONSOLE_NOTIFY_COLOR) return 0x848484; |
77 |
|
|
if(name == LS_CONSOLE_WARNING_COLOR) return 0xf19e0e; |
78 |
|
|
if(name == LS_CONSOLE_ERROR_COLOR) return 0xfa4a1f; |
79 |
|
|
|
80 |
iliev |
1778 |
if("midiKeyboard.height".equals(name)) return 85; |
81 |
iliev |
1776 |
if("midiKeyboard.firstKey".equals(name)) return 0; |
82 |
|
|
if("midiKeyboard.lastKey".equals(name)) return 127; |
83 |
iliev |
1872 |
if("channelLanes.count".equals(name)) return 4; |
84 |
iliev |
1776 |
|
85 |
iliev |
1285 |
return super.getDefaultIntValue(name); |
86 |
iliev |
912 |
} |
87 |
|
|
|
88 |
iliev |
1496 |
public String |
89 |
|
|
getDefaultStringValue(String name) { |
90 |
|
|
if(name == "Theme") return "Graphite"; |
91 |
|
|
|
92 |
|
|
return super.getDefaultStringValue(name); |
93 |
|
|
} |
94 |
|
|
|
95 |
iliev |
1285 |
public boolean |
96 |
|
|
getDefaultBoolValue(String name) { |
97 |
|
|
if(name == ANIMATED) return true; |
98 |
iliev |
1323 |
if("toolBar.visible".equals(name)) return true; |
99 |
iliev |
1729 |
if("leftSidePane.visible".equals(name)) return true; |
100 |
|
|
if("rightSidePane.visible".equals(name)) return true; |
101 |
iliev |
1776 |
if("midiKeyboard.visible".equals(name)) return true; |
102 |
iliev |
1729 |
if("rightSidePane.showInstrumentsDb".equals(name)) return true; |
103 |
iliev |
1743 |
if("channel.smallView.showChannelNumbering".equals(name)) return true; |
104 |
iliev |
1767 |
if("channel.smallView.showStreamVoiceCount".equals(name)) return true; |
105 |
iliev |
1285 |
|
106 |
|
|
return super.getDefaultBoolValue(name); |
107 |
iliev |
912 |
} |
108 |
|
|
} |