Chris@136: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@136: Chris@136: /* Chris@136: Sonic Visualiser Chris@136: An audio file viewer and annotation editor. Chris@136: Centre for Digital Music, Queen Mary, University of London. Chris@136: This file copyright 2006 Chris Cannam. Chris@136: Chris@136: This program is free software; you can redistribute it and/or Chris@136: modify it under the terms of the GNU General Public License as Chris@136: published by the Free Software Foundation; either version 2 of the Chris@136: License, or (at your option) any later version. See the file Chris@136: COPYING included with this distribution for more information. Chris@136: */ Chris@136: Chris@136: #ifndef _PREFERENCES_H_ Chris@136: #define _PREFERENCES_H_ Chris@136: Chris@136: #include "PropertyContainer.h" Chris@136: Chris@140: #include "Window.h" Chris@140: Chris@136: class Preferences : public PropertyContainer Chris@136: { Chris@136: Q_OBJECT Chris@136: Chris@136: public: Chris@136: static Preferences *getInstance() { return m_instance; } Chris@136: Chris@136: virtual PropertyList getProperties() const; Chris@136: virtual QString getPropertyLabel(const PropertyName &) const; Chris@136: virtual PropertyType getPropertyType(const PropertyName &) const; Chris@136: virtual int getPropertyRangeAndValue(const PropertyName &, int *, int *) const; Chris@136: virtual QString getPropertyValueLabel(const PropertyName &, int value) const; Chris@136: virtual QString getPropertyContainerName() const; Chris@136: virtual QString getPropertyContainerIconName() const; Chris@136: Chris@136: bool getSmoothSpectrogram() const { return m_smoothSpectrogram; } Chris@136: float getTuningFrequency() const { return m_tuningFrequency; } Chris@140: WindowType getWindowType() const { return m_windowType; } Chris@136: Chris@138: //!!! harmonise with PaneStack Chris@138: enum PropertyBoxLayout { Chris@138: VerticallyStacked, Chris@138: Layered Chris@138: }; Chris@138: PropertyBoxLayout getPropertyBoxLayout() const { return m_propertyBoxLayout; } Chris@138: Chris@136: public slots: Chris@136: virtual void setProperty(const PropertyName &, int); Chris@136: Chris@136: void setSmoothSpectrogram(bool smooth); Chris@136: void setTuningFrequency(float freq); Chris@138: void setPropertyBoxLayout(PropertyBoxLayout layout); Chris@140: void setWindowType(WindowType type); Chris@136: Chris@136: private: Chris@136: Preferences(); Chris@136: virtual ~Preferences() { } Chris@136: Chris@136: static Preferences *m_instance; Chris@136: Chris@136: bool m_smoothSpectrogram; Chris@136: float m_tuningFrequency; Chris@138: PropertyBoxLayout m_propertyBoxLayout; Chris@140: WindowType m_windowType; Chris@136: }; Chris@136: Chris@136: #endif