Chris@0: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
Chris@0: 
Chris@0: /*
Chris@0:     Sonic Visualiser
Chris@0:     An audio file viewer and annotation editor.
Chris@0:     Centre for Digital Music, Queen Mary, University of London.
Chris@0:     This file copyright 2006 Chris Cannam.
Chris@0:     
Chris@0:     This program is free software; you can redistribute it and/or
Chris@0:     modify it under the terms of the GNU General Public License as
Chris@0:     published by the Free Software Foundation; either version 2 of the
Chris@0:     License, or (at your option) any later version.  See the file
Chris@0:     COPYING included with this distribution for more information.
Chris@0: */
Chris@0: 
Chris@0: #ifndef _PREFERENCES_DIALOG_H_
Chris@0: #define _PREFERENCES_DIALOG_H_
Chris@0: 
Chris@0: #include <QDialog>
Chris@436: #include <QMap>
Chris@0: 
Chris@0: #include "base/Window.h"
Chris@0: 
Chris@9: class WindowTypeSelector;
Chris@0: class QPushButton;
Chris@180: class QLineEdit;
Chris@436: class QTabWidget;
Chris@0: 
Chris@0: class PreferencesDialog : public QDialog
Chris@0: {
Chris@0:     Q_OBJECT
Chris@0: 
Chris@0: public:
Chris@528:     PreferencesDialog(QWidget *parent = 0);
Chris@9:     virtual ~PreferencesDialog();
Chris@0: 
Chris@436:     enum Tab {
Chris@436:         GeneralTab,
Chris@436:         AppearanceTab,
Chris@436:         AnalysisTab,
Chris@436:         TemplateTab
Chris@436:     };
Chris@436:     void switchToTab(Tab tab);
Chris@436: 
Chris@163: public slots:
Chris@163:     void applicationClosing(bool quickly);
Chris@163: 
Chris@0: protected slots:
Chris@9:     void windowTypeChanged(WindowType type);
Chris@115:     void spectrogramSmoothingChanged(int state);
Chris@299:     void spectrogramXSmoothingChanged(int state);
Chris@0:     void propertyLayoutChanged(int layout);
Chris@0:     void tuningFrequencyChanged(double freq);
Chris@263:     void audioDeviceChanged(int device);
Chris@32:     void resampleQualityChanged(int quality);
Chris@180:     void resampleOnLoadChanged(int state);
Chris@180:     void tempDirRootChanged(QString root);
Chris@180:     void backgroundModeChanged(int mode);
Chris@337:     void timeToTextModeChanged(int mode);
Chris@225:     void viewFontSizeChanged(int sz);
Chris@237:     void showSplashChanged(int state);
Chris@436:     void defaultTemplateChanged(int);
Chris@180: 
Chris@180:     void tempDirButtonClicked();
Chris@0: 
Chris@0:     void okClicked();
Chris@0:     void applyClicked();
Chris@0:     void cancelClicked();
Chris@0: 
Chris@0: protected:
Chris@9:     WindowTypeSelector *m_windowTypeSelector;
Chris@0:     QPushButton *m_applyButton;
Chris@180: 
Chris@436:     QTabWidget *m_tabs;
Chris@436:     QMap<Tab, int> m_tabOrdering;
Chris@436: 
Chris@180:     QLineEdit *m_tempDirRootEdit;
Chris@436: 
Chris@436:     QString m_currentTemplate;
Chris@436:     QStringList m_templates;
Chris@0:     
Chris@9:     WindowType m_windowType;
Chris@180:     int m_spectrogramSmoothing;
Chris@299:     int m_spectrogramXSmoothing;
Chris@180:     int m_propertyLayout;
Chris@0:     float m_tuningFrequency;
Chris@263:     int m_audioDevice;
Chris@180:     int m_resampleQuality;
Chris@180:     bool m_resampleOnLoad;
Chris@180:     QString m_tempDirRoot;
Chris@180:     int m_backgroundMode;
Chris@337:     int m_timeToTextMode;
Chris@225:     int m_viewFontSize;
Chris@237:     bool m_showSplash;
Chris@180: 
Chris@180:     bool m_changesOnRestart;
Chris@0: };
Chris@0: 
Chris@0: #endif