annotate base/Preferences.h @ 138:6332e41c1619

* Various experiments in spectrogram colour scaling, etc. Nothing final here yet, but some promising developments.
author Chris Cannam
date Fri, 14 Jul 2006 17:12:16 +0000
parents e4acb520ad2a
children a35098a9c814
rev   line source
Chris@136 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@136 2
Chris@136 3 /*
Chris@136 4 Sonic Visualiser
Chris@136 5 An audio file viewer and annotation editor.
Chris@136 6 Centre for Digital Music, Queen Mary, University of London.
Chris@136 7 This file copyright 2006 Chris Cannam.
Chris@136 8
Chris@136 9 This program is free software; you can redistribute it and/or
Chris@136 10 modify it under the terms of the GNU General Public License as
Chris@136 11 published by the Free Software Foundation; either version 2 of the
Chris@136 12 License, or (at your option) any later version. See the file
Chris@136 13 COPYING included with this distribution for more information.
Chris@136 14 */
Chris@136 15
Chris@136 16 #ifndef _PREFERENCES_H_
Chris@136 17 #define _PREFERENCES_H_
Chris@136 18
Chris@136 19 #include "PropertyContainer.h"
Chris@136 20
Chris@136 21 class Preferences : public PropertyContainer
Chris@136 22 {
Chris@136 23 Q_OBJECT
Chris@136 24
Chris@136 25 public:
Chris@136 26 static Preferences *getInstance() { return m_instance; }
Chris@136 27
Chris@136 28 virtual PropertyList getProperties() const;
Chris@136 29 virtual QString getPropertyLabel(const PropertyName &) const;
Chris@136 30 virtual PropertyType getPropertyType(const PropertyName &) const;
Chris@136 31 virtual int getPropertyRangeAndValue(const PropertyName &, int *, int *) const;
Chris@136 32 virtual QString getPropertyValueLabel(const PropertyName &, int value) const;
Chris@136 33 virtual QString getPropertyContainerName() const;
Chris@136 34 virtual QString getPropertyContainerIconName() const;
Chris@136 35
Chris@136 36 bool getSmoothSpectrogram() const { return m_smoothSpectrogram; }
Chris@136 37 float getTuningFrequency() const { return m_tuningFrequency; }
Chris@136 38
Chris@138 39 //!!! harmonise with PaneStack
Chris@138 40 enum PropertyBoxLayout {
Chris@138 41 VerticallyStacked,
Chris@138 42 Layered
Chris@138 43 };
Chris@138 44 PropertyBoxLayout getPropertyBoxLayout() const { return m_propertyBoxLayout; }
Chris@138 45
Chris@136 46 public slots:
Chris@136 47 virtual void setProperty(const PropertyName &, int);
Chris@136 48
Chris@136 49 void setSmoothSpectrogram(bool smooth);
Chris@136 50 void setTuningFrequency(float freq);
Chris@138 51 void setPropertyBoxLayout(PropertyBoxLayout layout);
Chris@136 52
Chris@136 53 private:
Chris@136 54 Preferences();
Chris@136 55 virtual ~Preferences() { }
Chris@136 56
Chris@136 57 static Preferences *m_instance;
Chris@136 58
Chris@136 59 bool m_smoothSpectrogram;
Chris@136 60 float m_tuningFrequency;
Chris@138 61 PropertyBoxLayout m_propertyBoxLayout;
Chris@136 62 };
Chris@136 63
Chris@136 64 #endif