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

Diff of /jsampler/trunk/src/org/jsampler/view/JSViewConfig.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1285 by iliev, Fri Aug 10 19:55:03 2007 UTC revision 1752 by iliev, Mon Aug 11 22:51:24 2008 UTC
# Line 1  Line 1 
1  /*  /*
2   *   JSampler - a java front-end for LinuxSampler   *   JSampler - a java front-end for LinuxSampler
3   *   *
4   *   Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com>   *   Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com>
5   *   *
6   *   This file is part of JSampler.   *   This file is part of JSampler.
7   *   *
# Line 22  Line 22 
22    
23  package org.jsampler.view;  package org.jsampler.view;
24    
25    import java.beans.PropertyChangeEvent;
26    import java.beans.PropertyChangeListener;
27    
28  import org.jsampler.JSPrefs;  import org.jsampler.JSPrefs;
29    
30    import static org.jsampler.JSPrefs.VOL_MEASUREMENT_UNIT_DECIBEL;
31    
32  /**  /**
33   * Provides the view configuration.   * Provides the view configuration.
34   * @author Grigor Iliev   * @author Grigor Iliev
35   */   */
36  public abstract class JSViewConfig {  public abstract class JSViewConfig {
37            private boolean measurementUnitDecibel;
38                    
39          /** Creates a new instance of <code>JSViewConfig</code> */          /** Creates a new instance of <code>JSViewConfig</code> */
40          public          public
41          JSViewConfig() {          JSViewConfig() {
42                    measurementUnitDecibel = preferences().getBoolProperty(VOL_MEASUREMENT_UNIT_DECIBEL);
43                                    
44                    String s = VOL_MEASUREMENT_UNIT_DECIBEL;
45                    preferences().addPropertyChangeListener(s, new PropertyChangeListener() {
46                            public void
47                            propertyChange(PropertyChangeEvent e) {
48                                    boolean b;
49                                    b = preferences().getBoolProperty(VOL_MEASUREMENT_UNIT_DECIBEL);
50                                    measurementUnitDecibel = b;
51                            }
52                    });
53          }          }
54                    
55          /**          /**
# Line 46  public abstract class JSViewConfig { Line 62  public abstract class JSViewConfig {
62           */           */
63          public abstract InstrumentsDbTableView getInstrumentsDbTableView();          public abstract InstrumentsDbTableView getInstrumentsDbTableView();
64                    
65            public abstract BasicIconSet getBasicIconSet();
66            
67          public abstract JSPrefs preferences();          public abstract JSPrefs preferences();
68                    
69          /**          /**
# Line 54  public abstract class JSViewConfig { Line 72  public abstract class JSViewConfig {
72           */           */
73          public boolean          public boolean
74          getInstrumentsDbSupport() { return false; }          getInstrumentsDbSupport() { return false; }
75            
76            /**
77             * Determines whether the volume values should be shown in decibels.
78             */
79            public boolean
80            isMeasurementUnitDecibel() { return measurementUnitDecibel; }
81            
82            /** Exports the view configuration of the current session. */
83            public String
84            exportSessionViewConfig() { return ""; }
85  }  }

Legend:
Removed from v.1285  
changed lines
  Added in v.1752

  ViewVC Help
Powered by ViewVC