Mercurial > hg > easaier-soundaccess
comparison base/Preferences.h @ 0:fc9323a41f5a
start base : Sonic Visualiser sv1-1.0rc1
author | lbajardsilogic |
---|---|
date | Fri, 11 May 2007 09:08:14 +0000 |
parents | |
children | c5970f7af886 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:fc9323a41f5a |
---|---|
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 and QMUL. | |
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 #include "Window.h" | |
22 | |
23 class Preferences : public PropertyContainer | |
24 { | |
25 Q_OBJECT | |
26 | |
27 public: | |
28 static Preferences *getInstance(); | |
29 | |
30 virtual PropertyList getProperties() const; | |
31 virtual QString getPropertyLabel(const PropertyName &) const; | |
32 virtual PropertyType getPropertyType(const PropertyName &) const; | |
33 virtual int getPropertyRangeAndValue(const PropertyName &, int *, int *, int *) const; | |
34 virtual QString getPropertyValueLabel(const PropertyName &, int value) const; | |
35 virtual QString getPropertyContainerName() const; | |
36 virtual QString getPropertyContainerIconName() const; | |
37 | |
38 enum SpectrogramSmoothing { | |
39 NoSpectrogramSmoothing, | |
40 SpectrogramInterpolated, | |
41 SpectrogramZeroPadded, | |
42 SpectrogramZeroPaddedAndInterpolated | |
43 }; | |
44 | |
45 SpectrogramSmoothing getSpectrogramSmoothing() const { return m_spectrogramSmoothing; } | |
46 float getTuningFrequency() const { return m_tuningFrequency; } | |
47 WindowType getWindowType() const { return m_windowType; } | |
48 int getResampleQuality() const { return m_resampleQuality; } | |
49 | |
50 //!!! harmonise with PaneStack | |
51 enum PropertyBoxLayout { | |
52 VerticallyStacked, | |
53 Layered | |
54 }; | |
55 PropertyBoxLayout getPropertyBoxLayout() const { return m_propertyBoxLayout; } | |
56 | |
57 public slots: | |
58 virtual void setProperty(const PropertyName &, int); | |
59 | |
60 void setSpectrogramSmoothing(SpectrogramSmoothing smoothing); | |
61 void setTuningFrequency(float freq); | |
62 void setPropertyBoxLayout(PropertyBoxLayout layout); | |
63 void setWindowType(WindowType type); | |
64 void setResampleQuality(int quality); | |
65 | |
66 private: | |
67 Preferences(); // may throw DirectoryCreationFailed | |
68 virtual ~Preferences(); | |
69 | |
70 static Preferences *m_instance; | |
71 | |
72 SpectrogramSmoothing m_spectrogramSmoothing; | |
73 float m_tuningFrequency; | |
74 PropertyBoxLayout m_propertyBoxLayout; | |
75 WindowType m_windowType; | |
76 int m_resampleQuality; | |
77 }; | |
78 | |
79 #endif |