hydrogen 1.2.3
PreferencesDialog.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#ifndef PREFERENCES_DIALOG_H
24#define PREFERENCES_DIALOG_H
25
26#include <vector>
27#include <memory>
28
30#include "../Widgets/LCDCombo.h"
31
32#include <core/Object.h>
35#include <core/IO/OssDriver.h>
40
41#include <QtWidgets>
42#include <QColorDialog>
43
48
49class DeviceComboBox : public LCDCombo {
50
51 QString m_sDriver;
52 QString m_sHostAPI;
53
54public:
55 DeviceComboBox( QWidget *pParent );
56
58 void setDriver( QString sDriver ) { m_sDriver = sDriver; }
59 void setHostAPI( QString sHostAPI ) { m_sHostAPI = sHostAPI; }
60
61 virtual void showPopup();
62};
63
67
68class HostAPIComboBox : public LCDCombo {
69
70public:
71 HostAPIComboBox( QWidget *pParent );
72 void setValue( QString sHostAPI );
73 virtual void showPopup();
74};
75
80class ColorTreeItem : public QTreeWidgetItem {
81
82public:
83 ColorTreeItem( int nId, QTreeWidgetItem* pParent, QString sLabel );
84 ColorTreeItem( int nId, QTreeWidget* pParent, QString sLabel );
85 int getId() const;
86
87private:
88 int m_nId;
89};
90
91#include "ui_PreferencesDialog_UI.h"
95
96class PreferencesDialog : public QDialog, private Ui_PreferencesDialog_UI, public H2Core::Object<PreferencesDialog>
97{
99 Q_OBJECT
100 public:
101 explicit PreferencesDialog( QWidget* parent );
103 static QString m_sColorRed;
104
105 private slots:
106 void on_okBtn_clicked();
109 void driverComboBoxActivated( int index );
110 void portaudioHostAPIComboBoxActivated( int index );
112 void bufferSizeSpinBoxValueChanged( int i );
113 void sampleRateComboBoxEditTextChanged( const QString& text );
114 void midiPortComboBoxActivated( int index );
115 void midiOutportComboBoxActivated( int index );
116 void styleComboBoxActivated( int index );
118 void onMidiDriverComboBoxIndexChanged( int index );
119 void audioDeviceTxtChanged( const QString& );
120 void toggleTrackOutsCheckBox(bool toggled);
121 void toggleOscCheckBox(bool toggled);
122 void onRejected();
123 void onApplicationFontChanged(const QFont& font);
124 void onLevel2FontChanged( const QFont& font );
125 void onLevel3FontChanged( const QFont& font );
126 void onFontSizeChanged( int nIndex );
127 void onUILayoutChanged( int nIndex );
128 void onColorNumberChanged( int nIndex );
130 void onColoringMethodChanged( int nIndex );
131 // void onCustomizePaletteClicked();
133 void colorButtonChanged();
134 void rsliderChanged(int);
135 void gsliderChanged(int);
136 void bsliderChanged(int);
137 void hsliderChanged(int);
138 void ssliderChanged(int);
139 void vsliderChanged(int);
140 void updateColors();
141 void exportTheme();
142 void importTheme();
143 void resetTheme();
144 void onIconColorChanged(int);
147
148private:
149
150 void updateDriverInfo();
152 void setDriverInfoOss();
153 void setDriverInfoAlsa();
154 void setDriverInfoJack();
159 void updateAppearanceTab( const std::shared_ptr<H2Core::Theme> pTheme );
160
162 QColor* getColorById( int nId, std::shared_ptr<H2Core::ColorTheme> uiStyle ) const;
163 void setColorById( int nId, const QColor& color, std::shared_ptr<H2Core::ColorTheme> uiStyle );
164 void updateColorTree();
171 std::shared_ptr<H2Core::Theme> m_pCurrentTheme;
172 std::shared_ptr<H2Core::Theme> m_pPreviousTheme;
176
179
182 std::vector<ColorSelectionButton*> m_colorSelectionButtons;
183
185
186};
187
188
189#endif
190
#define H2_OBJECT(name)
Definition Object.h:224
Node in the Color tree of the appearance tab.
ColorTreeItem(int nId, QTreeWidgetItem *pParent, QString sLabel)
Combo box showing a list of available devices for a given driver.
DeviceComboBox(QWidget *pParent)
void setHostAPI(QString sHostAPI)
virtual void showPopup()
void setDriver(QString sDriver)
Set the driver name to use.
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
Combo box showing a list of HostAPIs.
HostAPIComboBox(QWidget *pParent)
virtual void showPopup()
void setValue(QString sHostAPI)
Preferences Dialog.
static QString m_sColorRed
void portaudioHostAPIComboBoxActivated(int index)
void midiPortComboBoxActivated(int index)
void setColorTreeItemDirty(ColorTreeItem *pItem)
void triggerColorSliderTimer()
Introduce a temporal smoothing.
void onUILayoutChanged(int nIndex)
void toggleTrackOutsCheckBox(bool toggled)
void toggleOscCheckBox(bool toggled)
void latencyTargetSpinBoxValueChanged(int i)
void audioDeviceTxtChanged(const QString &)
void mixerFalloffComboBoxCurrentIndexChanged(int)
void onColoringMethodChanged(int nIndex)
void onLevel3FontChanged(const QFont &font)
void bufferSizeSpinBoxValueChanged(int i)
void onLevel2FontChanged(const QFont &font)
void onApplicationFontChanged(const QFont &font)
PreferencesDialog(QWidget *parent)
void onMidiDriverComboBoxIndexChanged(int index)
std::shared_ptr< H2Core::Theme > m_pCurrentTheme
void setColorById(int nId, const QColor &color, std::shared_ptr< H2Core::ColorTheme > uiStyle)
void onFontSizeChanged(int nIndex)
void updateAppearanceTab(const std::shared_ptr< H2Core::Theme > pTheme)
void driverComboBoxActivated(int index)
void uiScalingPolicyComboBoxCurrentIndexChanged(int)
std::vector< ColorSelectionButton * > m_colorSelectionButtons
H2Core::Preferences::Changes m_changes
Stores which part of the dialog was altered.
void styleComboBoxActivated(int index)
void onColorNumberChanged(int nIndex)
void midiOutportComboBoxActivated(int index)
std::shared_ptr< H2Core::Theme > m_pPreviousTheme
void sampleRateComboBoxEditTextChanged(const QString &text)
QColor * getColorById(int nId, std::shared_ptr< H2Core::ColorTheme > uiStyle) const