drumstick  2.5.0
configurationdialogs.cpp
Go to the documentation of this file.
1 /*
2  Drumstick 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 #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(true, parent);
80  return (dlg.exec() == QDialog::Accepted);
81  }
82  return false;
83 }
84 
95 bool configureOutputDriver(const QString driver, QWidget* parent)
96 {
97  bool result = false;
98  if (driver == "Network") {
99  NetworkSettingsDialog dlg(false, parent);
100  result = (dlg.exec() == QDialog::Accepted);
101  } else if (driver == "FluidSynth") {
102  FluidSettingsDialog dlg(parent);
103  result = (dlg.exec() == QDialog::Accepted);
104 #if defined(Q_OS_LINUX)
105  } else if (driver == "SonivoxEAS") {
106  SonivoxSettingsDialog dlg(parent);
107  result = (dlg.exec() == QDialog::Accepted);
108 #endif
109 #if defined(Q_OS_MACOS)
110  } else if (driver == "DLS Synth") {
111  MacSynthSettingsDialog dlg(parent);
112  return (dlg.exec() == QDialog::Accepted);
113 #endif
114  }
115  return result;
116 }
117 
128 void changeSoundFont(const QString driver, const QString fileName, QWidget* parent)
129 {
130  if (driver == "FluidSynth") {
131  FluidSettingsDialog dlg(parent);
132  dlg.changeSoundFont(fileName);
133 #if defined(Q_OS_MACOS)
134  } else if (driver == "DLS Synth") {
135  MacSynthSettingsDialog dlg(parent);
136  dlg.changeSoundFont(fileName);
137 #endif
138  }
139 }
140 
145 QString libraryVersion()
146 {
147  return QStringLiteral(QT_STRINGIFY(VERSION));
148 }
149 
150 } // namespace widgets
151 } // namespace drumstick
152 
bool DRUMSTICK_EXPORT configureInputDriver(const QString driver, QWidget *parent=nullptr)
Input Driver configuration dialog Some RT input drivers can be configured.
bool DRUMSTICK_EXPORT configureOutputDriver(const QString driver, QWidget *parent=nullptr)
Output Driver configuration dialog Some RT output 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.
Drumstick common.
Definition: alsaclient.cpp:68
Definition of the Sonivox Synth configuration dialog.
Functions providing configuration dialogs.
Declaration of the Fluidsynth configuration dialog.
QString DRUMSTICK_EXPORT libraryVersion()
libraryVersion returns the runtime library version as a QString
Declaration of the Mac Synth configuration dialog.
Declaration of the Network configuration dialog.
bool DRUMSTICK_EXPORT outputDriverIsConfigurable(const QString driver)
outputDriverIsConfigurable
bool DRUMSTICK_EXPORT inputDriverIsConfigurable(const QString driver)
inputDriverIsConfigurable