drumstick  2.2.0
fluidsettingsdialog.h
Go to the documentation of this file.
1 /*
2  Virtual Piano test using the MIDI Sequencer C++ library
3  Copyright (C) 2006-2021, 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 
30 namespace drumstick {
31 
32 namespace rt {
33  class MIDIOutput;
34 }
35 
36 namespace widgets {
37 
38 namespace Ui {
39  class FluidSettingsDialog;
40 }
41 
42 class FluidSettingsDialog : public QDialog
43 {
44  Q_OBJECT
45 
46 public:
47  explicit FluidSettingsDialog(QWidget *parent = nullptr);
48  ~FluidSettingsDialog();
49  void readSettings();
50  void writeSettings();
51  void changeSoundFont(const QString& fileName);
52 
53 public slots:
54  void accept() override;
55  void showEvent(QShowEvent *event) override;
56  void restoreDefaults();
57  void showFileDialog();
58 
59 public:
60  static const QString QSTR_PREFERENCES;
61  static const QString QSTR_INSTRUMENTSDEFINITION;
62  static const QString QSTR_DATADIR;
63  static const QString QSTR_DATADIR2;
64  static const QString QSTR_SOUNDFONT;
65  static const QString QSTR_AUDIODRIVER;
66  static const QString QSTR_PERIODSIZE;
67  static const QString QSTR_PERIODS;
68  static const QString QSTR_SAMPLERATE;
69  static const QString QSTR_CHORUS;
70  static const QString QSTR_REVERB;
71  static const QString QSTR_GAIN;
72  static const QString QSTR_POLYPHONY;
73 
74  static const int DEFAULT_PERIODSIZE = 3072;
75  static const int DEFAULT_PERIODS = 1;
76  static const double DEFAULT_SAMPLERATE;
77  static const int DEFAULT_CHORUS = 0;
78  static const int DEFAULT_REVERB = 0;
79  static const double DEFAULT_GAIN;
80  static const int DEFAULT_POLYPHONY = 32;
81 
82 private:
83  QString defaultAudioDriver() const;
84 
85  Ui::FluidSettingsDialog *ui;
86  drumstick::rt::MIDIOutput *m_driver;
87 };
88 
89 }} // namespace drumstick::widgets
90 
91 #endif // FLUIDSETTINGSDIALOG_H
MIDI OUT interface.
Definition: rtmidioutput.h:112
void DRUMSTICK_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:68