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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1705 - (hide annotations) (download)
Tue Feb 19 16:32:36 2008 UTC (16 years, 2 months ago) by iliev
File size: 4953 byte(s)
* The column sort order in the Instruments Database
  window is now saved for the next session

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

  ViewVC Help
Powered by ViewVC