/[svn]/jsampler/trunk/src/org/jsampler/view/fantasia/FantasiaPrefs.java
ViewVC logotype

Annotation of /jsampler/trunk/src/org/jsampler/view/fantasia/FantasiaPrefs.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1767 - (hide annotations) (download)
Mon Sep 8 00:19:27 2008 UTC (15 years, 7 months ago) by iliev
File size: 3245 byte(s)
* Added `Copy To' and `Move To' commands to the MIDI bank context menu
  and to the MIDI instrument context menu
* Added commands to the MIDI instrument context menu for moving
  a MIDI instrument to another program
  (right-click on a MIDI instrument and choose `Change Program')
* Added option to choose between zero-based and one-based
  MIDI bank/program numbering
  (choose Edit/Preferences, then click the `Advanced' button)
* Added option to choose whether to include MIDI instrument
  mappings when exporting a sampler configuration to LSCP script.
  (choose Edit/Preferences, then click the `Advanced' button)
* Added option to set the MIDI instrument loading in background
  when exporting MIDI instrument mappings to LSCP script.
  (choose Edit/Preferences, then click the `Advanced' button)
* Implemented an option to change the socket read timeout
  (choose Edit/Preferences, then click the `Backend' tab)
* Updated LscpTree
* Fantasia: Added option to hide the active stream/voice count statistic
  in the sampler channel's small view
  (choose Edit/Preferences, then click the `Channels' tab)
* Fantasia: `Turn off animation effects' checkbox moved to the `View' tab

1 iliev 912 /*
2     * JSampler - a java front-end for LinuxSampler
3     *
4 iliev 1767 * Copyright (C) 2005-2008 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     import java.util.prefs.Preferences;
26    
27 iliev 1285 import org.jsampler.view.std.StdPrefs;
28 iliev 912
29 iliev 1285
30 iliev 912 /**
31     *
32     * @author Grigor Iliev
33     */
34 iliev 1285 public class FantasiaPrefs extends StdPrefs {
35     /** Property which specifies whether to use animation effects. */
36     public final static String ANIMATED = "animated";
37 iliev 912
38     private final static String WINDOW_LOCATION = "Mainframe.sizeAndLocation";
39     private final static String DEF_WINDOW_LOCATION = null;
40    
41 iliev 1285 private final static FantasiaPrefs prefs = new FantasiaPrefs();
42 iliev 912
43 iliev 1285
44 iliev 912 /** Forbits instantiation of <code>FantasiaPrefs</code>. */
45 iliev 1285 private
46     FantasiaPrefs() { super("org.jsampler.view.fantasia"); }
47 iliev 912
48 iliev 1285 public static FantasiaPrefs
49     preferences() { return prefs; }
50 iliev 912
51     /**
52     * Gets a string representation of the main window's location.
53     * The string representation is a comma-separated list
54     * of x and y coordinates.
55     * @return A string representation of the main window's location,
56     * or <code>null</code> if the value is not set.
57     */
58 iliev 1285 public String
59 iliev 912 getWindowLocation() {
60 iliev 1285 return getStringProperty(WINDOW_LOCATION, DEF_WINDOW_LOCATION);
61 iliev 912 }
62    
63     /**
64 iliev 1285 * Sets the main window's location.
65 iliev 912 * Use <code>null</code> to remove the current value.
66     * @param s A string representation of the main window'socation.
67     * @see #getWindowLocation
68     */
69 iliev 1285 public void
70 iliev 912 setWindowLocation(String s) {
71 iliev 1285 setStringProperty(WINDOW_LOCATION, s);
72 iliev 912 }
73    
74 iliev 1285 public int
75     getDefaultIntValue(String name) {
76     if(name == LS_CONSOLE_BACKGROUND_COLOR) return 0x626262;
77     if(name == LS_CONSOLE_TEXT_COLOR) return 0xb4b4b4;
78     if(name == LS_CONSOLE_NOTIFY_COLOR) return 0x848484;
79     if(name == LS_CONSOLE_WARNING_COLOR) return 0xf19e0e;
80     if(name == LS_CONSOLE_ERROR_COLOR) return 0xfa4a1f;
81    
82     return super.getDefaultIntValue(name);
83 iliev 912 }
84    
85 iliev 1496 public String
86     getDefaultStringValue(String name) {
87     if(name == "Theme") return "Graphite";
88    
89     return super.getDefaultStringValue(name);
90     }
91    
92 iliev 1285 public boolean
93     getDefaultBoolValue(String name) {
94     if(name == ANIMATED) return true;
95 iliev 1323 if("toolBar.visible".equals(name)) return true;
96 iliev 1729 if("leftSidePane.visible".equals(name)) return true;
97     if("rightSidePane.visible".equals(name)) return true;
98     if("rightSidePane.showInstrumentsDb".equals(name)) return true;
99 iliev 1743 if("channel.smallView.showChannelNumbering".equals(name)) return true;
100 iliev 1767 if("channel.smallView.showStreamVoiceCount".equals(name)) return true;
101 iliev 1285
102     return super.getDefaultBoolValue(name);
103 iliev 912 }
104     }

  ViewVC Help
Powered by ViewVC