File: PreferencesDialog.h

package info (click to toggle)
sonic-visualiser 5.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,744 kB
  • sloc: cpp: 158,888; ansic: 11,920; sh: 1,785; makefile: 517; xml: 64; perl: 31
file content (149 lines) | stat: -rw-r--r-- 3,991 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */

/*
    Sonic Visualiser
    An audio file viewer and annotation editor.
    Centre for Digital Music, Queen Mary, University of London.
    This file copyright 2006 Chris Cannam.
    
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of the
    License, or (at your option) any later version.  See the file
    COPYING included with this distribution for more information.
*/

#ifndef SV_PREFERENCES_DIALOG_H
#define SV_PREFERENCES_DIALOG_H

#include <QDialog>
#include <QMap>
#include <QColor>

#include "base/Window.h"

class QPushButton;
class QLineEdit;
class QTabWidget;
class QComboBox;

namespace sv {
class ColourComboBox;
class WindowTypeSelector;
class PluginPathConfigurator;
}

class PreferencesDialog : public QDialog
{
    Q_OBJECT

public:
    PreferencesDialog(QWidget *parent = 0);
    virtual ~PreferencesDialog();

    enum Tab {
        GeneralTab,
        AudioIOTab,
        AppearanceTab,
        AnalysisTab,
        TemplateTab,
        PluginTab
    };
    void switchToTab(Tab tab);

signals:
    void audioDeviceChanged();
    void coloursChanged();
                             
public slots:
    void applicationClosing(bool quickly);

protected slots:
    void windowTypeChanged(sv::WindowType type);
    void spectrogramSmoothingChanged(int state);
    void spectrogramGColourChanged(int state);
    void spectrogramMColourChanged(int state);
    void colour3DColourChanged(int state);
    void overviewColourChanged(int state);
    void propertyLayoutChanged(int layout);
    void tuningFrequencyChanged(double freq);
    void audioImplementationChanged(int impl);
    void audioPlaybackDeviceChanged(int device);
    void audioRecordDeviceChanged(int device);
    void resampleOnLoadChanged(int state);
    void finerTimeStretchChanged(int state);
    void gaplessModeChanged(int state);
    void vampProcessSeparationChanged(int state);
    void tempDirRootChanged(QString root);
    void backgroundModeChanged(int mode);
    void timeToTextModeChanged(int mode);
    void showHMSChanged(int state);
    void octaveSystemChanged(int system);
    void viewFontSizeChanged(int sz);
    void showSplashChanged(int state);
    void defaultTemplateChanged(int);
    void localeChanged(int);
    void networkPermissionChanged(int state);
    void retinaChanged(int state);
    void pluginPathsChanged();

    void tempDirButtonClicked();

    void okClicked();
    void applyClicked();
    void cancelClicked();

protected:
    sv::WindowTypeSelector *m_windowTypeSelector;
    QPushButton *m_applyButton;

    QTabWidget *m_tabs;
    QMap<Tab, int> m_tabOrdering;

    QLineEdit *m_tempDirRootEdit;

    sv::ColourComboBox *m_overviewColourCombo;
    QComboBox *m_audioPlaybackDeviceCombo;
    QComboBox *m_audioRecordDeviceCombo;
    void rebuildDeviceCombos();

    sv::PluginPathConfigurator *m_pluginPathConfigurator;
    
    QString m_currentTemplate;
    QStringList m_templates;

    QString m_currentLocale;
    QStringList m_locales;
    
    sv::WindowType m_windowType;
    int m_spectrogramSmoothing;
    int m_spectrogramGColour;
    int m_spectrogramMColour;
    int m_colour3DColour;
    bool m_overviewColourIsSet;
    QColor m_overviewColour;
    int m_propertyLayout;
    double m_tuningFrequency;
    int m_audioImplementation;
    int m_audioPlaybackDevice;
    int m_audioRecordDevice;
    bool m_resampleOnLoad;
    bool m_finerTimeStretch;
    bool m_gapless;
    bool m_runPluginsInProcess;
    bool m_networkPermission;
    bool m_retina;
    QString m_tempDirRoot;
    int m_backgroundMode;
    int m_timeToTextMode;
    bool m_showHMS;
    int m_octaveSystem;
    int m_viewFontSize;
    bool m_showSplash;

    bool m_audioDeviceChanged;
    bool m_coloursChanged;
    bool m_changesOnRestart;
};

#endif