|
svcore
1.9
|
#include <Preferences.h>


Public Types | |
| enum | SpectrogramSmoothing { NoSpectrogramSmoothing, SpectrogramInterpolated, SpectrogramZeroPadded, SpectrogramZeroPaddedAndInterpolated } |
| enum | SpectrogramXSmoothing { NoSpectrogramXSmoothing, SpectrogramXInterpolated } |
| enum | PropertyBoxLayout { VerticallyStacked, Layered } |
| !! harmonise with PaneStack More... | |
| enum | BackgroundMode { BackgroundFromTheme, DarkBackground, LightBackground } |
| enum | TimeToTextMode { TimeToTextMs, TimeToTextUs, TimeToText24Frame, TimeToText25Frame, TimeToText30Frame, TimeToText50Frame, TimeToText60Frame } |
| enum | PropertyType { ToggleProperty, RangeProperty, ValueProperty, ColourProperty, UnitsProperty, InvalidProperty } |
| typedef QString | PropertyName |
| typedef std::vector< PropertyName > | PropertyList |
Public Slots | |
| virtual void | setProperty (const PropertyName &, int) |
| void | setSpectrogramSmoothing (SpectrogramSmoothing smoothing) |
| void | setSpectrogramXSmoothing (SpectrogramXSmoothing smoothing) |
| void | setTuningFrequency (float freq) |
| void | setPropertyBoxLayout (PropertyBoxLayout layout) |
| void | setWindowType (WindowType type) |
| void | setResampleQuality (int quality) |
| void | setOmitTempsFromRecentFiles (bool omit) |
| void | setTemporaryDirectoryRoot (QString tempDirRoot) |
| void | setFixedSampleRate (int) |
| void | setResampleOnLoad (bool) |
| void | setNormaliseAudio (bool) |
| void | setBackgroundMode (BackgroundMode mode) |
| void | setTimeToTextMode (TimeToTextMode mode) |
| void | setOctaveOfMiddleC (int oct) |
| void | setViewFontSize (int size) |
| void | setShowSplash (bool) |
| virtual Command * | getSetPropertyCommand (const PropertyName &, int value) |
| Obtain a command that sets the given property, which can be added to the command history for undo/redo. More... | |
| virtual Command * | getSetPropertyCommand (QString nameString, QString valueString) |
| As above, but returning a command. More... | |
| virtual void | setPropertyFuzzy (QString nameString, QString valueString) |
| Set a property using a fuzzy match. More... | |
Signals | |
| void | propertyChanged (PropertyContainer::PropertyName) |
Public Member Functions | |
| virtual PropertyList | getProperties () const |
| Get a list of the names of all the supported properties on this container. More... | |
| virtual QString | getPropertyLabel (const PropertyName &) const |
| Return the human-readable (and i18n'ised) name of a property. More... | |
| virtual PropertyType | getPropertyType (const PropertyName &) const |
| Return the type of the given property, or InvalidProperty if the property is not supported on this container. More... | |
| virtual int | getPropertyRangeAndValue (const PropertyName &, int *, int *, int *) const |
| Return the minimum and maximum values for the given property and its current value in this container. More... | |
| virtual QString | getPropertyValueLabel (const PropertyName &, int value) const |
| If the given property is a ValueProperty, return the display label to be used for the given value for that property. More... | |
| virtual QString | getPropertyContainerName () const |
| virtual QString | getPropertyContainerIconName () const |
| SpectrogramSmoothing | getSpectrogramSmoothing () const |
| SpectrogramXSmoothing | getSpectrogramXSmoothing () const |
| float | getTuningFrequency () const |
| WindowType | getWindowType () const |
| int | getResampleQuality () const |
| PropertyBoxLayout | getPropertyBoxLayout () const |
| int | getViewFontSize () const |
| bool | getOmitTempsFromRecentFiles () const |
| QString | getTemporaryDirectoryRoot () const |
| int | getFixedSampleRate () const |
| If we should always resample audio to the same rate, return it; otherwise (the normal case) return 0. More... | |
| bool | getResampleOnLoad () const |
| True if we should resample second or subsequent audio file to match first audio file's rate. More... | |
| bool | getNormaliseAudio () const |
| True if audio files should be loaded with normalisation (max == 1) More... | |
| BackgroundMode | getBackgroundMode () const |
| TimeToTextMode | getTimeToTextMode () const |
| int | getOctaveOfMiddleC () const |
| int | getOctaveOfLowestMIDINote () const |
| bool | getShowSplash () const |
| virtual QString | getPropertyIconName (const PropertyName &) const |
| Return an icon for the property, if any. More... | |
| virtual QString | getPropertyGroupName (const PropertyName &) const |
| If this property has something in common with other properties on this container, return a name that can be used to group them (in order to save screen space, for example). More... | |
| virtual RangeMapper * | getNewPropertyRangeMapper (const PropertyName &) const |
| If the given property is a RangeProperty, return a new RangeMapper object mapping its integer range onto an underlying floating point value range for human-intelligible display, if appropriate. More... | |
| virtual PlayParameters * | getPlayParameters () |
Static Public Member Functions | |
| static Preferences * | getInstance () |
Protected Member Functions | |
| virtual bool | convertPropertyStrings (QString nameString, QString valueString, PropertyName &name, int &value) |
Private Types | |
| enum | OctaveNumberingSystem { C0_Centre, C3_Logic, C4_ASA, C5_Sonar } |
Private Member Functions | |
| Preferences () | |
| virtual | ~Preferences () |
Static Private Member Functions | |
| static int | getOctaveOfMiddleCInSystem (OctaveNumberingSystem s) |
| static OctaveNumberingSystem | getSystemWithMiddleCInOctave (int o) |
Private Attributes | |
| SpectrogramSmoothing | m_spectrogramSmoothing |
| SpectrogramXSmoothing | m_spectrogramXSmoothing |
| float | m_tuningFrequency |
| PropertyBoxLayout | m_propertyBoxLayout |
| WindowType | m_windowType |
| int | m_resampleQuality |
| bool | m_omitRecentTemps |
| QString | m_tempDirRoot |
| int | m_fixedSampleRate |
| bool | m_resampleOnLoad |
| bool | m_normaliseAudio |
| int | m_viewFontSize |
| BackgroundMode | m_backgroundMode |
| TimeToTextMode | m_timeToTextMode |
| int | m_octave |
| bool | m_showSplash |
Static Private Attributes | |
| static Preferences * | m_instance = 0 |
Definition at line 23 of file Preferences.h.
|
inherited |
Definition at line 35 of file PropertyContainer.h.
|
inherited |
Definition at line 36 of file PropertyContainer.h.
| Enumerator | |
|---|---|
| NoSpectrogramSmoothing | |
| SpectrogramInterpolated | |
| SpectrogramZeroPadded | |
| SpectrogramZeroPaddedAndInterpolated | |
Definition at line 38 of file Preferences.h.
| Enumerator | |
|---|---|
| NoSpectrogramXSmoothing | |
| SpectrogramXInterpolated | |
Definition at line 45 of file Preferences.h.
!! harmonise with PaneStack
| Enumerator | |
|---|---|
| VerticallyStacked | |
| Layered | |
Definition at line 57 of file Preferences.h.
| Enumerator | |
|---|---|
| BackgroundFromTheme | |
| DarkBackground | |
| LightBackground | |
Definition at line 78 of file Preferences.h.
| Enumerator | |
|---|---|
| TimeToTextMs | |
| TimeToTextUs | |
| TimeToText24Frame | |
| TimeToText25Frame | |
| TimeToText30Frame | |
| TimeToText50Frame | |
| TimeToText60Frame | |
Definition at line 85 of file Preferences.h.
|
private |
| Enumerator | |
|---|---|
| C0_Centre | |
| C3_Logic | |
| C4_ASA | |
| C5_Sonar | |
Definition at line 136 of file Preferences.h.
|
inherited |
| Enumerator | |
|---|---|
| ToggleProperty | |
| RangeProperty | |
| ValueProperty | |
| ColourProperty | |
| UnitsProperty | |
| InvalidProperty | |
Definition at line 38 of file PropertyContainer.h.
|
private |
Definition at line 37 of file Preferences.cpp.
References BackgroundFromTheme, HanningWindow, m_backgroundMode, m_fixedSampleRate, m_normaliseAudio, m_octave, m_propertyBoxLayout, m_resampleOnLoad, m_resampleQuality, m_showSplash, m_spectrogramSmoothing, m_spectrogramXSmoothing, m_tempDirRoot, m_timeToTextMode, m_tuningFrequency, m_viewFontSize, m_windowType, TimeToTextMs, and VerticallyStacked.
Referenced by getInstance().
|
privatevirtual |
Definition at line 84 of file Preferences.cpp.
|
static |
Definition at line 31 of file Preferences.cpp.
References m_instance, and Preferences().
Referenced by RecentFiles::addFile(), Pitch::getFrequencyForPitch(), Pitch::getPitchForFrequency(), Pitch::getPitchForFrequencyDifference(), Pitch::getPitchLabel(), Pitch::getPitchLabelForFrequency(), LADSPAPluginFactory::getPortDefault(), RealTime::toText(), and WaveFileModel::WaveFileModel().
|
virtual |
Get a list of the names of all the supported properties on this container.
These should be fixed (i.e. not internationalized).
Reimplemented from PropertyContainer.
Definition at line 89 of file Preferences.cpp.
|
virtual |
Return the human-readable (and i18n'ised) name of a property.
Implements PropertyContainer.
Definition at line 112 of file Preferences.cpp.
|
virtual |
Return the type of the given property, or InvalidProperty if the property is not supported on this container.
Reimplemented from PropertyContainer.
Definition at line 166 of file Preferences.cpp.
References PropertyContainer::InvalidProperty, PropertyContainer::RangeProperty, PropertyContainer::ToggleProperty, and PropertyContainer::ValueProperty.
|
virtual |
Return the minimum and maximum values for the given property and its current value in this container.
Min and/or max may be passed as NULL if their values are not required.
!! freq mapping
Reimplemented from PropertyContainer.
Definition at line 221 of file Preferences.cpp.
References BlackmanHarrisWindow, getSystemWithMiddleCInOctave(), HanningWindow, Layered, m_backgroundMode, m_octave, m_propertyBoxLayout, m_resampleQuality, m_spectrogramSmoothing, m_spectrogramXSmoothing, m_timeToTextMode, m_viewFontSize, m_windowType, RectangularWindow, SpectrogramInterpolated, and SpectrogramXInterpolated.
|
virtual |
If the given property is a ValueProperty, return the display label to be used for the given value for that property.
Reimplemented from PropertyContainer.
Definition at line 303 of file Preferences.cpp.
References BackgroundFromTheme, BartlettWindow, BlackmanHarrisWindow, BlackmanWindow, C0_Centre, C3_Logic, C4_ASA, C5_Sonar, DarkBackground, GaussianWindow, HammingWindow, HanningWindow, LightBackground, NoSpectrogramSmoothing, NoSpectrogramXSmoothing, NuttallWindow, ParzenWindow, RectangularWindow, SpectrogramInterpolated, SpectrogramXInterpolated, SpectrogramZeroPadded, SpectrogramZeroPaddedAndInterpolated, TimeToText24Frame, TimeToText25Frame, TimeToText30Frame, TimeToText50Frame, TimeToText60Frame, TimeToTextMs, and TimeToTextUs.
|
virtual |
Implements PropertyContainer.
Definition at line 375 of file Preferences.cpp.
|
virtual |
Implements PropertyContainer.
Definition at line 381 of file Preferences.cpp.
|
inline |
Definition at line 50 of file Preferences.h.
References m_spectrogramSmoothing.
|
inline |
Definition at line 51 of file Preferences.h.
References m_spectrogramXSmoothing.
|
inline |
Definition at line 52 of file Preferences.h.
References m_tuningFrequency.
Referenced by Pitch::getFrequencyForPitch(), Pitch::getPitchForFrequency(), Pitch::getPitchForFrequencyDifference(), Pitch::getPitchLabelForFrequency(), and LADSPAPluginFactory::getPortDefault().
|
inline |
Definition at line 53 of file Preferences.h.
References m_windowType.
|
inline |
Definition at line 54 of file Preferences.h.
References m_resampleQuality.
|
inline |
Definition at line 61 of file Preferences.h.
References m_propertyBoxLayout.
|
inline |
Definition at line 63 of file Preferences.h.
References m_viewFontSize.
|
inline |
Definition at line 65 of file Preferences.h.
References m_omitRecentTemps.
Referenced by RecentFiles::addFile().
|
inline |
Definition at line 67 of file Preferences.h.
References m_tempDirRoot.
|
inline |
If we should always resample audio to the same rate, return it; otherwise (the normal case) return 0.
Definition at line 70 of file Preferences.h.
References m_fixedSampleRate.
|
inline |
True if we should resample second or subsequent audio file to match first audio file's rate.
Definition at line 73 of file Preferences.h.
References m_resampleOnLoad.
|
inline |
True if audio files should be loaded with normalisation (max == 1)
Definition at line 76 of file Preferences.h.
References m_normaliseAudio.
Referenced by WaveFileModel::WaveFileModel().
|
inline |
Definition at line 83 of file Preferences.h.
References m_backgroundMode.
|
inline |
Definition at line 94 of file Preferences.h.
References m_timeToTextMode.
Referenced by RealTime::toText().
|
inline |
Definition at line 96 of file Preferences.h.
References getOctaveOfMiddleCInSystem(), getSystemWithMiddleCInOctave(), and m_octave.
Referenced by getOctaveOfLowestMIDINote().
|
inline |
Definition at line 100 of file Preferences.h.
References getOctaveOfMiddleC().
Referenced by Pitch::getPitchLabel().
|
inline |
Definition at line 104 of file Preferences.h.
References m_showSplash.
|
virtualslot |
!!
Definition at line 387 of file Preferences.cpp.
References getOctaveOfMiddleCInSystem(), Layered, setBackgroundMode(), setOctaveOfMiddleC(), setOmitTempsFromRecentFiles(), setPropertyBoxLayout(), setResampleQuality(), setShowSplash(), setSpectrogramSmoothing(), setSpectrogramXSmoothing(), setTimeToTextMode(), setViewFontSize(), setWindowType(), and VerticallyStacked.
|
slot |
Definition at line 418 of file Preferences.cpp.
References m_spectrogramSmoothing, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 435 of file Preferences.cpp.
References m_spectrogramXSmoothing, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 452 of file Preferences.cpp.
References m_tuningFrequency, and PropertyContainer::propertyChanged().
|
slot |
Definition at line 465 of file Preferences.cpp.
References m_propertyBoxLayout, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 478 of file Preferences.cpp.
References m_windowType, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 491 of file Preferences.cpp.
References m_resampleQuality, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 504 of file Preferences.cpp.
References m_omitRecentTemps, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 517 of file Preferences.cpp.
References m_tempDirRoot, and PropertyContainer::propertyChanged().
|
slot |
Definition at line 546 of file Preferences.cpp.
References m_fixedSampleRate, and PropertyContainer::propertyChanged().
|
slot |
Definition at line 533 of file Preferences.cpp.
References m_resampleOnLoad, and PropertyContainer::propertyChanged().
|
slot |
Definition at line 559 of file Preferences.cpp.
References m_normaliseAudio, and PropertyContainer::propertyChanged().
|
slot |
Definition at line 572 of file Preferences.cpp.
References m_backgroundMode, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 587 of file Preferences.cpp.
References m_timeToTextMode, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 602 of file Preferences.cpp.
References m_octave, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 641 of file Preferences.cpp.
References m_viewFontSize, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
slot |
Definition at line 656 of file Preferences.cpp.
References m_showSplash, and PropertyContainer::propertyChanged().
Referenced by setProperty().
|
staticprivate |
Definition at line 617 of file Preferences.cpp.
References C0_Centre, C3_Logic, C4_ASA, and C5_Sonar.
Referenced by getOctaveOfMiddleC(), and setProperty().
|
staticprivate |
Definition at line 629 of file Preferences.cpp.
References C0_Centre, C3_Logic, C4_ASA, and C5_Sonar.
Referenced by getOctaveOfMiddleC(), and getPropertyRangeAndValue().
|
virtualinherited |
Return an icon for the property, if any.
Definition at line 35 of file PropertyContainer.cpp.
|
virtualinherited |
If this property has something in common with other properties on this container, return a name that can be used to group them (in order to save screen space, for example).
e.g. "Window Type" and "Window Size" might both have a group name of "Window". If this property is not groupable, return the empty string.
Definition at line 41 of file PropertyContainer.cpp.
|
virtualinherited |
If the given property is a RangeProperty, return a new RangeMapper object mapping its integer range onto an underlying floating point value range for human-intelligible display, if appropriate.
The RangeMapper should be allocated with new, and the caller takes responsibility for deleting it. Return NULL (as in the default implementation) if there is no such mapping.
Definition at line 63 of file PropertyContainer.cpp.
Referenced by PropertyContainer::convertPropertyStrings().
|
inlinevirtualinherited |
Definition at line 106 of file PropertyContainer.h.
|
signalinherited |
Referenced by setBackgroundMode(), setFixedSampleRate(), setNormaliseAudio(), setOctaveOfMiddleC(), setOmitTempsFromRecentFiles(), setPropertyBoxLayout(), setResampleOnLoad(), setResampleQuality(), setShowSplash(), setSpectrogramSmoothing(), setSpectrogramXSmoothing(), setTemporaryDirectoryRoot(), setTimeToTextMode(), setTuningFrequency(), setViewFontSize(), and setWindowType().
|
virtualslotinherited |
Obtain a command that sets the given property, which can be added to the command history for undo/redo.
Returns NULL if the property is already set to the given value.
Definition at line 75 of file PropertyContainer.cpp.
References PropertyContainer::getPropertyRangeAndValue().
Referenced by PropertyContainer::getSetPropertyCommand().
|
virtualslotinherited |
As above, but returning a command.
Definition at line 98 of file PropertyContainer.cpp.
References PropertyContainer::convertPropertyStrings(), and PropertyContainer::getSetPropertyCommand().
|
virtualslotinherited |
Set a property using a fuzzy match.
Compare nameString with the property labels and underlying names, and if it matches one (with preference given to labels), try to convert valueString appropriately and set it. The valueString should contain a value label for value properties, a mapped value for range properties, "on" or "off" for toggle properties, a colour or unit name, or the underlying integer value for the property.
Note that as property and value labels may be translatable, the results of this function may vary by locale. It is intended for handling user-originated strings, not persistent storage.
The default implementation should work for most subclasses.
Definition at line 83 of file PropertyContainer.cpp.
References PropertyContainer::convertPropertyStrings(), and PropertyContainer::setProperty().
|
protectedvirtualinherited |
Definition at line 113 of file PropertyContainer.cpp.
References PropertyContainer::ColourProperty, UnitDatabase::getInstance(), PropertyContainer::getNewPropertyRangeMapper(), RangeMapper::getPositionForValue(), PropertyContainer::getProperties(), PropertyContainer::getPropertyLabel(), PropertyContainer::getPropertyRangeAndValue(), PropertyContainer::getPropertyType(), PropertyContainer::getPropertyValueLabel(), UnitDatabase::getUnitId(), PropertyContainer::InvalidProperty, PropertyContainer::RangeProperty, SVDEBUG, PropertyContainer::ToggleProperty, PropertyContainer::UnitsProperty, and PropertyContainer::ValueProperty.
Referenced by PropertyContainer::getSetPropertyCommand(), and PropertyContainer::setPropertyFuzzy().
|
staticprivate |
Definition at line 130 of file Preferences.h.
Referenced by getInstance().
|
private |
Definition at line 145 of file Preferences.h.
Referenced by getPropertyRangeAndValue(), getSpectrogramSmoothing(), Preferences(), and setSpectrogramSmoothing().
|
private |
Definition at line 146 of file Preferences.h.
Referenced by getPropertyRangeAndValue(), getSpectrogramXSmoothing(), Preferences(), and setSpectrogramXSmoothing().
|
private |
Definition at line 147 of file Preferences.h.
Referenced by getTuningFrequency(), Preferences(), and setTuningFrequency().
|
private |
Definition at line 148 of file Preferences.h.
Referenced by getPropertyBoxLayout(), getPropertyRangeAndValue(), Preferences(), and setPropertyBoxLayout().
|
private |
Definition at line 149 of file Preferences.h.
Referenced by getPropertyRangeAndValue(), getWindowType(), Preferences(), and setWindowType().
|
private |
Definition at line 150 of file Preferences.h.
Referenced by getPropertyRangeAndValue(), getResampleQuality(), Preferences(), and setResampleQuality().
|
private |
Definition at line 151 of file Preferences.h.
Referenced by getOmitTempsFromRecentFiles(), and setOmitTempsFromRecentFiles().
|
private |
Definition at line 152 of file Preferences.h.
Referenced by getTemporaryDirectoryRoot(), Preferences(), and setTemporaryDirectoryRoot().
|
private |
Definition at line 153 of file Preferences.h.
Referenced by getFixedSampleRate(), Preferences(), and setFixedSampleRate().
|
private |
Definition at line 154 of file Preferences.h.
Referenced by getResampleOnLoad(), Preferences(), and setResampleOnLoad().
|
private |
Definition at line 155 of file Preferences.h.
Referenced by getNormaliseAudio(), Preferences(), and setNormaliseAudio().
|
private |
Definition at line 156 of file Preferences.h.
Referenced by getPropertyRangeAndValue(), getViewFontSize(), Preferences(), and setViewFontSize().
|
private |
Definition at line 157 of file Preferences.h.
Referenced by getBackgroundMode(), getPropertyRangeAndValue(), Preferences(), and setBackgroundMode().
|
private |
Definition at line 158 of file Preferences.h.
Referenced by getPropertyRangeAndValue(), getTimeToTextMode(), Preferences(), and setTimeToTextMode().
|
private |
Definition at line 159 of file Preferences.h.
Referenced by getOctaveOfMiddleC(), getPropertyRangeAndValue(), Preferences(), and setOctaveOfMiddleC().
|
private |
Definition at line 160 of file Preferences.h.
Referenced by getShowSplash(), Preferences(), and setShowSplash().