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

Contents of /jsampler/trunk/src/org/jsampler/view/std/StdPrefs.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1871 - (show annotations) (download)
Sun Mar 22 18:11:39 2009 UTC (15 years, 1 month ago) by iliev
File size: 5853 byte(s)
* Mac OS integration, work in progress:
* Added option to use native file choosers
  (choose Edit/Preferences, then click the `View' tab)

1 /*
2 * JSampler - a java front-end for LinuxSampler
3 *
4 * Copyright (C) 2005-2009 Grigor Iliev <grigor@grigoriliev.com>
5 *
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.std;
24
25 import org.jsampler.CC;
26 import org.jsampler.JSPrefs;
27
28 /**
29 *
30 * @author Grigor Iliev
31 */
32 public class StdPrefs extends JSPrefs {
33 /** Property representing the maximum number of lines to be kept in the command history. */
34 public final static String LS_CONSOLE_HISTSIZE = "LSConsole.historySize";
35
36 /** Property which specifies whether the command history should be saved on exit. */
37 public final static String SAVE_LS_CONSOLE_HISTORY = "LSConsole.saveCommandHistory";
38
39 /** Property representing the background color of the LS Console. */
40 public final static String LS_CONSOLE_BACKGROUND_COLOR = "LSConsole.backgroundColor";
41
42 /** Property representing the text color of the LS Console. */
43 public final static String LS_CONSOLE_TEXT_COLOR = "LSConsole.textColor";
44
45 /** Property representing the notification messages' color of the LS Console. */
46 public final static String LS_CONSOLE_NOTIFY_COLOR = "LSConsole.notifyColor";
47
48 /** Property representing the warning messages' color of the LS Console. */
49 public final static String LS_CONSOLE_WARNING_COLOR = "LSConsole.warningColor";
50
51 /** Property representing the error messages' color of the LS Console. */
52 public final static String LS_CONSOLE_ERROR_COLOR = "LSConsole.errorColor";
53
54 /** Property representing the list of recent LSCP scripts. */
55 public final static String RECENT_LSCP_SCRIPTS = "recentLscpScripts";
56
57 /** Property representing the maximum number of recent LSCP scripts to be stored. */
58 public final static String RECENT_LSCP_SCRIPTS_SIZE = "recentLscpScripts.maxNumber";
59
60 /** Property which specifies whether the LS Console should be shown when script is run. */
61 public final static String SHOW_LS_CONSOLE_WHEN_RUN_SCRIPT = "showLSConsoleWhenRunScript";
62
63 /** Property representing the maximum master volume (in percents). */
64 public final static String MAXIMUM_MASTER_VOLUME = "maximumMasterVolume";
65
66 /** Property representing the maximum channel volume (in percents). */
67 public final static String MAXIMUM_CHANNEL_VOLUME = "maximumChannelVolume";
68
69 /** Property which specifies whether the user should confirm channel removals. */
70 public final static String CONFIRM_CHANNEL_REMOVAL = "confirmChannelRemoval";
71
72 /** Property which specifies whether the user should confirm audio/MIDI device removals. */
73 public final static String CONFIRM_DEVICE_REMOVAL = "confirmDeviceRemoval";
74
75 /** Property which specifies whether the user should confirm quiting. */
76 public final static String CONFIRM_APP_QUIT = "confirmAppQuit";
77
78 /** Property which specifies the sort order in the instruments database frame. */
79 public final static String INSTRUMENTS_DB_FRAME_SORT_ORDER = "instrumentsDbFrameSortOrder";
80
81 /** Property representing the channel view to be used when creating a sampler channel. */
82 public final static String DEFAULT_CHANNEL_VIEW = "defaultChannelView";
83
84 /**
85 * Property which specifies whether a different sampler channel view should be shown
86 * when the mouse cursor is over a sampler channel.
87 */
88 public final static String DIFFERENT_CHANNEL_VIEW_ON_MOUSE_OVER = "differentChannelViewOnMO";
89
90 /**
91 * Property representing the channel view to be used when
92 * the mouse cursor is over a sampler channel.
93 */
94 public final static String CHANNEL_VIEW_ON_MOUSE_OVER = "channelViewOnMouseOver";
95
96
97 /**
98 * Creates a new instance of <code>StdPrefs</code>.
99 * @param pathName The path name of the preferences node.
100 */
101 public
102 StdPrefs(String pathName) {
103 super(pathName);
104 }
105
106 @Override
107 public String
108 getDefaultStringValue(String name) {
109 if(name == RECENT_LSCP_SCRIPTS) return "";
110 if(name == DEFAULT_ENGINE) return "GIG";
111 if(name == DEFAULT_MIDI_INPUT) return "firstDeviceNextChannel";
112 if(name == DEFAULT_AUDIO_OUTPUT) return "firstDevice";
113 if(name == DEFAULT_MIDI_DRIVER) return "ALSA";
114 if(name == DEFAULT_AUDIO_DRIVER) return "ALSA";
115 if(name == DEFAULT_MIDI_INSTRUMENT_MAP) return "midiInstrumentMap.none";
116
117 return super.getDefaultStringValue(name);
118 }
119
120 @Override
121 public int
122 getDefaultIntValue(String name) {
123 if(name == DEFAULT_CHANNEL_VOLUME) return 100;
124 if(name == LS_CONSOLE_HISTSIZE) return 1000;
125 if(name == RECENT_LSCP_SCRIPTS_SIZE) return 7;
126 if(name == MAXIMUM_MASTER_VOLUME) return 100;
127 if(name == MAXIMUM_CHANNEL_VOLUME) return 100;
128 if(name == INSTRUMENTS_DB_FRAME_SORT_ORDER) return 1;
129 if(name == DEFAULT_CHANNEL_VIEW) return 1;
130 if(name == CHANNEL_VIEW_ON_MOUSE_OVER) return 1;
131
132 return super.getDefaultIntValue(name);
133 }
134
135 @Override
136 public boolean
137 getDefaultBoolValue(String name) {
138 if(name == DIFFERENT_CHANNEL_VIEW_ON_MOUSE_OVER) return true;
139 if(name == CONFIRM_CHANNEL_REMOVAL) return true;
140 if(name == CONFIRM_DEVICE_REMOVAL) return true;
141 if(name == CONFIRM_APP_QUIT) return true;
142 if(name == SAVE_LS_CONSOLE_HISTORY) return true;
143 if(name == USE_CHANNEL_DEFAULTS) return true;
144 if("nativeFileChoosers".equals(name) && CC.isMacOS()) return true;
145
146 return super.getDefaultBoolValue(name);
147 }
148 }

  ViewVC Help
Powered by ViewVC