drumstick 2.10.0
C++ MIDI libraries using Qt objects, idioms, and style.
fluidsettingsdialog.h
Go to the documentation of this file.
1/*
2 Virtual Piano test using the MIDI Sequencer C++ library
3 Copyright (C) 2006-2024, Pedro Lopez-Cabanillas <plcl@users.sf.net>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef FLUIDSETTINGSDIALOG_H
20#define FLUIDSETTINGSDIALOG_H
21
22#include <QDialog>
23#include <QShowEvent>
24#include <QSettings>
25
31namespace drumstick {
32
33namespace rt {
34 class MIDIOutput;
35}
36
37namespace widgets {
38
39namespace Ui {
40 class FluidSettingsDialog;
41}
42
43class FluidSettingsDialog : public QDialog
44{
45 Q_OBJECT
46
47public:
48 explicit FluidSettingsDialog(QWidget *parent = nullptr);
49 ~FluidSettingsDialog();
50 void readSettings();
51 void writeSettings();
52 void changeSoundFont(const QString& fileName);
53 void chkDriverProperties(QSettings* settings);
54 void setWidgetTip(QWidget *w, const QString &tip);
55
56public Q_SLOTS:
57 void accept() override;
58 void showEvent(QShowEvent *event) override;
59 void restoreDefaults();
60 void showFileDialog();
61 void audioDriverChanged(const QString &text);
62 void bufferTimeChanged(int value);
63 void bufferSizeChanged();
64
65public:
66 static const QString QSTR_PREFERENCES;
67 static const QString QSTR_INSTRUMENTSDEFINITION;
68 static const QString QSTR_DATADIR;
69 static const QString QSTR_DATADIR2;
70 static const QString QSTR_AUDIODRIVER;
71 static const QString QSTR_PERIODSIZE;
72 static const QString QSTR_PERIODS;
73 static const QString QSTR_SAMPLERATE;
74 static const QString QSTR_CHORUS;
75 static const QString QSTR_REVERB;
76 static const QString QSTR_GAIN;
77 static const QString QSTR_POLYPHONY;
78 static const QString QSTR_BUFFERTIME;
79
80 static const QString QSTR_CHORUS_DEPTH;
81 static const QString QSTR_CHORUS_LEVEL;
82 static const QString QSTR_CHORUS_NR;
83 static const QString QSTR_CHORUS_SPEED;
84 static const QString QSTR_REVERB_DAMP;
85 static const QString QSTR_REVERB_LEVEL;
86 static const QString QSTR_REVERB_SIZE;
87 static const QString QSTR_REVERB_WIDTH;
88
89 static const int DEFAULT_BUFFERTIME = 50;
90 static const int DEFAULT_PERIODSIZE = 512;
91 static const int DEFAULT_PERIODS = 8;
92 static constexpr double DEFAULT_SAMPLERATE = 44100.0;
93 static const int DEFAULT_CHORUS = 1;
94 static const int DEFAULT_REVERB = 1;
95 static constexpr double DEFAULT_GAIN = 1.0;
96 static const int DEFAULT_POLYPHONY = 256;
97 static const QString QSTR_PULSEAUDIO;
98
99 static constexpr qreal DEFAULT_CHORUS_DEPTH = 4.25;
100 static constexpr qreal DEFAULT_CHORUS_LEVEL = 0.60;
101 static constexpr int DEFAULT_CHORUS_NR = 3;
102 static constexpr qreal DEFAULT_CHORUS_SPEED = 0.20;
103
104 static constexpr qreal DEFAULT_REVERB_DAMP = 0.30;
105 static constexpr qreal DEFAULT_REVERB_LEVEL = 0.70;
106 static constexpr qreal DEFAULT_REVERB_SIZE = 0.50;
107 static constexpr qreal DEFAULT_REVERB_WIDTH = 0.80;
108
109 static constexpr qreal CHORUS_REVERB_VALUE_SCALE = 100.0;
110
111private:
112 QString defaultAudioDriver() const;
113 bool checkRanges() const;
114 void initBuffer();
115 QString driverVersion() const;
116 bool driverVersionLessThan_2_2_8();
117
118 Ui::FluidSettingsDialog *ui;
120 QString m_defSoundFont;
121};
122
123}} // namespace drumstick::widgets
124
125#endif // FLUIDSETTINGSDIALOG_H
The QSettings class provides persistent platform-independent application settings.
MIDI OUT interface.
Definition: rtmidioutput.h:122
void DRUMSTICK_WIDGETS_EXPORT changeSoundFont(const QString driver, const QString fileName, QWidget *parent=nullptr)
Changes the sound font configuration Some RT output drivers accept soundfonts.
Drumstick common.
Definition: alsaclient.cpp:71