comparison base/Preferences.h @ 136:e4acb520ad2a

* fledgling preferences stuff
author Chris Cannam
date Mon, 10 Jul 2006 13:54:49 +0000
parents
children 6332e41c1619
comparison
equal deleted inserted replaced
135:fb8422cf4326 136:e4acb520ad2a
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006 Chris Cannam.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
15
16 #ifndef _PREFERENCES_H_
17 #define _PREFERENCES_H_
18
19 #include "PropertyContainer.h"
20
21 class Preferences : public PropertyContainer
22 {
23 Q_OBJECT
24
25 public:
26 static Preferences *getInstance() { return m_instance; }
27
28 virtual PropertyList getProperties() const;
29 virtual QString getPropertyLabel(const PropertyName &) const;
30 virtual PropertyType getPropertyType(const PropertyName &) const;
31 virtual int getPropertyRangeAndValue(const PropertyName &, int *, int *) const;
32 virtual QString getPropertyValueLabel(const PropertyName &, int value) const;
33 virtual QString getPropertyContainerName() const;
34 virtual QString getPropertyContainerIconName() const;
35
36 bool getSmoothSpectrogram() const { return m_smoothSpectrogram; }
37 float getTuningFrequency() const { return m_tuningFrequency; }
38
39 public slots:
40 virtual void setProperty(const PropertyName &, int);
41
42 void setSmoothSpectrogram(bool smooth);
43 void setTuningFrequency(float freq);
44
45 private:
46 Preferences();
47 virtual ~Preferences() { }
48
49 static Preferences *m_instance;
50
51 bool m_smoothSpectrogram;
52 float m_tuningFrequency;
53 };
54
55 #endif