Preferences.h

Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     Sonic Visualiser
00005     An audio file viewer and annotation editor.
00006     Centre for Digital Music, Queen Mary, University of London.
00007     This file copyright 2006 Chris Cannam and QMUL.
00008     
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License as
00011     published by the Free Software Foundation; either version 2 of the
00012     License, or (at your option) any later version.  See the file
00013     COPYING included with this distribution for more information.
00014 */
00015 
00016 #ifndef _PREFERENCES_H_
00017 #define _PREFERENCES_H_
00018 
00019 #include "PropertyContainer.h"
00020 
00021 #include "Window.h"
00022 
00023 class Preferences : public PropertyContainer
00024 {
00025     Q_OBJECT
00026 
00027 public:
00028     static Preferences *getInstance();
00029 
00030     virtual PropertyList getProperties() const;
00031     virtual QString getPropertyLabel(const PropertyName &) const;
00032     virtual PropertyType getPropertyType(const PropertyName &) const;
00033     virtual int getPropertyRangeAndValue(const PropertyName &, int *, int *, int *) const;
00034     virtual QString getPropertyValueLabel(const PropertyName &, int value) const;
00035     virtual QString getPropertyContainerName() const;
00036     virtual QString getPropertyContainerIconName() const;
00037 
00038     enum SpectrogramSmoothing {
00039         NoSpectrogramSmoothing,
00040         SpectrogramInterpolated,
00041         SpectrogramZeroPadded,
00042         SpectrogramZeroPaddedAndInterpolated
00043     };
00044 
00045     SpectrogramSmoothing getSpectrogramSmoothing() const { return m_spectrogramSmoothing; }
00046     float getTuningFrequency() const { return m_tuningFrequency; }
00047     WindowType getWindowType() const { return m_windowType; }
00048     int getResampleQuality() const { return m_resampleQuality; }
00049 
00051     enum PropertyBoxLayout {
00052         VerticallyStacked,
00053         Layered
00054     };
00055     PropertyBoxLayout getPropertyBoxLayout() const { return m_propertyBoxLayout; }
00056 
00057     int getViewFontSize() const { return m_viewFontSize; }
00058 
00059     bool getOmitTempsFromRecentFiles() const { return m_omitRecentTemps; }
00060 
00061     QString getTemporaryDirectoryRoot() const { return m_tempDirRoot; }
00062 
00063     bool getResampleOnLoad() const { return m_resampleOnLoad; }    
00064     
00065     enum BackgroundMode {
00066         BackgroundFromTheme,
00067         DarkBackground,
00068         LightBackground 
00069     };
00070     BackgroundMode getBackgroundMode() const { return m_backgroundMode; }
00071 
00072     bool getShowSplash() const { return m_showSplash; }
00073 
00074 public slots:
00075     virtual void setProperty(const PropertyName &, int);
00076 
00077     void setSpectrogramSmoothing(SpectrogramSmoothing smoothing);
00078     void setTuningFrequency(float freq);
00079     void setPropertyBoxLayout(PropertyBoxLayout layout);
00080     void setWindowType(WindowType type);
00081     void setResampleQuality(int quality);
00082     void setOmitTempsFromRecentFiles(bool omit);
00083     void setTemporaryDirectoryRoot(QString tempDirRoot);
00084     void setResampleOnLoad(bool);
00085     void setBackgroundMode(BackgroundMode mode);
00086     void setViewFontSize(int size);
00087     void setShowSplash(bool);
00088 
00089 private:
00090     Preferences(); // may throw DirectoryCreationFailed
00091     virtual ~Preferences();
00092 
00093     static Preferences *m_instance;
00094 
00095     SpectrogramSmoothing m_spectrogramSmoothing;
00096     float m_tuningFrequency;
00097     PropertyBoxLayout m_propertyBoxLayout;
00098     WindowType m_windowType;
00099     int m_resampleQuality;
00100     bool m_omitRecentTemps;
00101     QString m_tempDirRoot;
00102     bool m_resampleOnLoad;
00103     int m_viewFontSize;
00104     BackgroundMode m_backgroundMode;
00105     bool m_showSplash;
00106 };
00107 
00108 #endif

Generated on Wed Feb 20 15:45:27 2008 for SonicVisualiser by  doxygen 1.5.1