hydrogen 1.2.6
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-2025 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
52 QString m_sHostAPI;
53
54public:
55 DeviceComboBox( QWidget *pParent );
56
59 m_driver = driver; }
60 void setHostAPI( QString sHostAPI ) { m_sHostAPI = sHostAPI; }
61
62 virtual void showPopup();
63};
64
68
69class HostAPIComboBox : public LCDCombo {
70
71public:
72 HostAPIComboBox( QWidget *pParent );
73 void setValue( QString sHostAPI );
74 virtual void showPopup();
75};
76
81class ColorTreeItem : public QTreeWidgetItem {
82
83public:
84 ColorTreeItem( int nId, QTreeWidgetItem* pParent, QString sLabel );
85 ColorTreeItem( int nId, QTreeWidget* pParent, QString sLabel );
86 int getId() const;
87
88private:
89 int m_nId;
90};
91
92#include "ui_PreferencesDialog_UI.h"
96
97class PreferencesDialog : public QDialog, private Ui_PreferencesDialog_UI, public H2Core::Object<PreferencesDialog>
98{
100 Q_OBJECT
101 public:
102 explicit PreferencesDialog( QWidget* parent );
104 static QString m_sColorRed;
105
106 private slots:
107 void on_okBtn_clicked();
110 void driverComboBoxActivated( int index );
111 void portaudioHostAPIComboBoxActivated( int index );
113 void bufferSizeSpinBoxValueChanged( int i );
114 void sampleRateComboBoxEditTextChanged( const QString& text );
115 void midiPortComboBoxActivated( int index );
116 void midiOutportComboBoxActivated( int index );
117 void styleComboBoxActivated( int index );
119 void onMidiDriverComboBoxIndexChanged( int index );
120 void audioDeviceTxtChanged( const QString& );
121 void toggleTrackOutsCheckBox(bool toggled);
122 void toggleOscCheckBox(bool toggled);
123 void onRejected();
124 void onApplicationFontChanged(const QFont& font);
125 void onLevel2FontChanged( const QFont& font );
126 void onLevel3FontChanged( const QFont& font );
127 void onFontSizeChanged( int nIndex );
128 void onUILayoutChanged( int nIndex );
129 void onColorNumberChanged( int nIndex );
131 void onColoringMethodChanged( int nIndex );
132 // void onCustomizePaletteClicked();
134 void colorButtonChanged();
135 void rsliderChanged(int);
136 void gsliderChanged(int);
137 void bsliderChanged(int);
138 void hsliderChanged(int);
139 void ssliderChanged(int);
140 void vsliderChanged(int);
141 void updateColors();
142 void exportTheme();
143 void importTheme();
144 void resetTheme();
145 void onIconColorChanged(int);
148
149private:
150
151 void updateDriverInfo();
153 void setDriverInfoOss();
154 void setDriverInfoAlsa();
155 void setDriverInfoJack();
160 void updateAppearanceTab( const std::shared_ptr<H2Core::Theme> pTheme );
161
163 QColor* getColorById( int nId, std::shared_ptr<H2Core::ColorTheme> uiStyle ) const;
164 void setColorById( int nId, const QColor& color, std::shared_ptr<H2Core::ColorTheme> uiStyle );
165 void updateColorTree();
172 std::shared_ptr<H2Core::Theme> m_pCurrentTheme;
173 std::shared_ptr<H2Core::Theme> m_pPreviousTheme;
177
180
183 std::vector<ColorSelectionButton*> m_colorSelectionButtons;
184
186
187};
188
189
190#endif
191
#define H2_OBJECT(name)
Definition Object.h:227
Node in the Color tree of the appearance tab.
ColorTreeItem(int nId, QTreeWidgetItem *pParent, QString sLabel)
DeviceComboBox(QWidget *pParent)
void setHostAPI(QString sHostAPI)
virtual void showPopup()
void setDriver(const H2Core::Preferences::AudioDriver &driver)
Set the driver name to use.
H2Core::Preferences::AudioDriver m_driver
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
HostAPIComboBox(QWidget *pParent)
virtual void showPopup()
void setValue(QString sHostAPI)
LCDCombo(QWidget *pParent, QSize size=QSize(0, 0), bool bModifyOnChange=false)
Definition LCDCombo.cpp:31
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