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

Annotation of /jsampler/trunk/src/org/jsampler/view/JSViewConfig.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: 3558 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 1285 /*
2     * JSampler - a java front-end for LinuxSampler
3     *
4 iliev 1752 * Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com>
5 iliev 1285 *
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;
24    
25 iliev 1540 import java.beans.PropertyChangeEvent;
26     import java.beans.PropertyChangeListener;
27    
28 iliev 1285 import org.jsampler.JSPrefs;
29 iliev 1767 import org.jsampler.MidiInstrument;
30 iliev 1285
31 iliev 1767 import static org.jsampler.JSPrefs.*;
32 iliev 1540
33 iliev 1285 /**
34     * Provides the view configuration.
35     * @author Grigor Iliev
36     */
37     public abstract class JSViewConfig {
38 iliev 1540 private boolean measurementUnitDecibel;
39 iliev 1285
40 iliev 1767 private int firstMidiBankNumber;
41     private int firstMidiProgramNumber;
42    
43 iliev 1285 /** Creates a new instance of <code>JSViewConfig</code> */
44     public
45     JSViewConfig() {
46 iliev 1540 measurementUnitDecibel = preferences().getBoolProperty(VOL_MEASUREMENT_UNIT_DECIBEL);
47 iliev 1285
48 iliev 1540 String s = VOL_MEASUREMENT_UNIT_DECIBEL;
49     preferences().addPropertyChangeListener(s, new PropertyChangeListener() {
50     public void
51     propertyChange(PropertyChangeEvent e) {
52     boolean b;
53     b = preferences().getBoolProperty(VOL_MEASUREMENT_UNIT_DECIBEL);
54     measurementUnitDecibel = b;
55     }
56     });
57 iliev 1767
58     firstMidiBankNumber = preferences().getIntProperty(FIRST_MIDI_BANK_NUMBER);
59     firstMidiProgramNumber = preferences().getIntProperty(FIRST_MIDI_PROGRAM_NUMBER);
60    
61     MidiInstrument.setFirstProgramNumber(firstMidiProgramNumber);
62    
63     s = FIRST_MIDI_BANK_NUMBER;
64     preferences().addPropertyChangeListener(s, new PropertyChangeListener() {
65     public void
66     propertyChange(PropertyChangeEvent e) {
67     firstMidiBankNumber = preferences().getIntProperty(FIRST_MIDI_BANK_NUMBER);
68     }
69     });
70    
71     s = FIRST_MIDI_PROGRAM_NUMBER;
72     preferences().addPropertyChangeListener(s, new PropertyChangeListener() {
73     public void
74     propertyChange(PropertyChangeEvent e) {
75     firstMidiProgramNumber = preferences().getIntProperty(FIRST_MIDI_PROGRAM_NUMBER);
76     MidiInstrument.setFirstProgramNumber(firstMidiProgramNumber);
77     }
78     });
79 iliev 1285 }
80    
81     /**
82     * Provides UI information for instruments database trees.
83     */
84     public abstract InstrumentsDbTreeView getInstrumentsDbTreeView();
85    
86     /**
87     * Provides UI information for instruments database tables.
88     */
89     public abstract InstrumentsDbTableView getInstrumentsDbTableView();
90    
91 iliev 1752 public abstract BasicIconSet getBasicIconSet();
92    
93 iliev 1285 public abstract JSPrefs preferences();
94    
95     /**
96     * Determines whether this view provides instruments database support.
97     * @return <code>false</code>
98     */
99     public boolean
100     getInstrumentsDbSupport() { return false; }
101 iliev 1540
102     /**
103     * Determines whether the volume values should be shown in decibels.
104     */
105     public boolean
106     isMeasurementUnitDecibel() { return measurementUnitDecibel; }
107 iliev 1752
108     /** Exports the view configuration of the current session. */
109     public String
110     exportSessionViewConfig() { return ""; }
111 iliev 1767
112     public int
113     getFirstMidiBankNumber() { return firstMidiBankNumber; }
114    
115     public int
116     getFirstMidiProgramNumber() { return firstMidiProgramNumber; }
117 iliev 1285 }

  ViewVC Help
Powered by ViewVC