drumstick  2.0.0
configurationdialogs.cpp
Go to the documentation of this file.
1 /*
2  Drumstick MIDI Sequencer C++ library
3  Copyright (C) 2006-2020, 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 #include "fluidsettingsdialog.h"
20 #include "networksettingsdialog.h"
22 #if defined(Q_OS_LINUX)
23 #include "sonivoxsettingsdialog.h"
24 #endif
25 #if defined(Q_OS_MACOS)
26 #include "macsynthsettingsdialog.h"
27 #endif
28 
39 namespace drumstick { namespace widgets {
40 
46 bool inputDriverIsConfigurable(const QString driver)
47 {
48  return (driver == "Network");
49 }
50 
56 bool outputDriverIsConfigurable(const QString driver)
57 {
58  return (driver == "Network")
59 #if defined(Q_OS_LINUX)
60  || (driver == "SonivoxEAS")
61 #endif
62 #if defined(Q_OS_MACOS)
63  || (driver == "DLS Synth")
64 #endif
65  || (driver == "FluidSynth");
66 }
76 bool configureInputDriver(const QString driver, QWidget* parent)
77 {
78  if (driver == "Network") {
79  NetworkSettingsDialog dlg(parent);
80  return (dlg.exec() == QDialog::Accepted);
81  }
82  return false;
83 }
84 
95 bool configureOutputDriver(const QString driver, QWidget* parent)
96 {
97  if (driver == "Network") {
98  NetworkSettingsDialog dlg(parent);
99  return (dlg.exec() == QDialog::Accepted);
100  } else if (driver == "FluidSynth") {
101  FluidSettingsDialog dlg(parent);
102  return (dlg.exec() == QDialog::Accepted);
103 #if defined(Q_OS_LINUX)
104  } else if (driver == "SonivoxEAS") {
105  SonivoxSettingsDialog dlg(parent);
106  return (dlg.exec() == QDialog::Accepted);
107 #endif
108 #if defined(Q_OS_MACOS)
109  } else if (driver == "DLS Synth") {
110  MacSynthSettingsDialog dlg(parent);
111  return (dlg.exec() == QDialog::Accepted);
112 #endif
113  }
114  return false;
115 }
116 
127 void changeSoundFont(const QString driver, const QString fileName, QWidget* parent)
128 {
129  if (driver == "FluidSynth") {
130  FluidSettingsDialog dlg(parent);
131  dlg.changeSoundFont(fileName);
132 #if defined(Q_OS_MACOS)
133  } else if (driver == "DLS Synth") {
134  MacSynthSettingsDialog dlg(parent);
135  dlg.changeSoundFont(fileName);
136 #endif
137  }
138 }
139 
144 QString libraryVersion()
145 {
146  return QStringLiteral(QT_STRINGIFY(VERSION));
147 }
148 
149 } // namespace widgets
150 } // namespace drumstick
151 
Functions providing configuration dialogs.
Declaration of the Fluidsynth configuration dialog.
Declaration of the Mac Synth configuration dialog.
bool DRUMSTICK_EXPORT inputDriverIsConfigurable(const QString driver)
inputDriverIsConfigurable
QString DRUMSTICK_EXPORT libraryVersion()
libraryVersion returns the runtime library version as a QString
bool DRUMSTICK_EXPORT outputDriverIsConfigurable(const QString driver)
outputDriverIsConfigurable
bool DRUMSTICK_EXPORT configureInputDriver(const QString driver, QWidget *parent=nullptr)
Input Driver configuration dialog Some RT input drivers can be configured.
void DRUMSTICK_EXPORT changeSoundFont(const QString driver, const QString fileName, QWidget *parent=nullptr)
Changes the sound font configuration Some RT output drivers accept soundfonts.
bool DRUMSTICK_EXPORT configureOutputDriver(const QString driver, QWidget *parent=nullptr)
Output Driver configuration dialog Some RT output drivers can be configured.
Drumstick common.
Definition: alsaclient.cpp:68
Declaration of the Network configuration dialog.
Definition of the Sonivox Synth configuration dialog.