drumstick  2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
backendmanager.h
Go to the documentation of this file.
1 /*
2  Drumstick RT (realtime MIDI In/Out)
3  Copyright (C) 2009-2023 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 BACKENDMANAGER_H
20 #define BACKENDMANAGER_H
21 
22 #include <QObject>
23 #include <QScopedPointer>
24 #include "macros.h"
25 #include "rtmidiinput.h"
26 #include "rtmidioutput.h"
27 
33 #if defined(DRUMSTICK_STATIC)
34 #define DRUMSTICK_RT_EXPORT
35 #else
36 #if defined(drumstick_rt_EXPORTS)
37 #define DRUMSTICK_RT_EXPORT Q_DECL_EXPORT
38 #else
39 #define DRUMSTICK_RT_EXPORT Q_DECL_IMPORT
40 #endif
41 #endif
42 
43 namespace drumstick {
48 namespace rt {
49 
59 class DRUMSTICK_RT_EXPORT BackendManager
60 {
61 public:
65  explicit BackendManager();
66 
70  virtual ~BackendManager();
71 
75  void refresh(QSettings *settings = nullptr);
76 
80  void refresh(const QVariantMap &map);
81 
86  QList<MIDIInput *> availableInputs();
87 
92  QList<MIDIOutput *> availableOutputs();
93 
98  QStringList defaultPaths();
99 
105  MIDIInput *inputBackendByName(const QString name);
106 
112  MIDIOutput *outputBackendByName(const QString name);
113 
120  MIDIInput *findInput(QString name);
121 
128  MIDIOutput *findOutput(QString name);
129 
130  static const QString QSTR_DRUMSTICK;
131  static const QString QSTR_DRUMSTICK_VERSION;
132  static const QString QSTR_DRUMSTICKRT;
133  static const QString QSTR_DRUMSTICKRT_GROUP;
134  static const QString QSTR_DRUMSTICKRT_PUBLICNAMEIN;
135  static const QString QSTR_DRUMSTICKRT_PUBLICNAMEOUT;
136  static const QString QSTR_DRUMSTICKRT_EXCLUDED;
137  static const QString QSTR_DRUMSTICKRT_PATH;
138 
139 private:
140  class BackendManagerPrivate;
141  QScopedPointer<BackendManagerPrivate> d;
142 };
143 
144 QString DRUMSTICK_RT_EXPORT drumstickLibraryVersion();
145 
147 }} // namespace drumstick::rt
148 
149 #endif // BACKENDMANAGER_H
The QSettings class provides persistent platform-independent application settings.
The BackendManager class manages lists of dynamic and static backends for applications based on drums...
MIDI IN interface.
Definition: rtmidiinput.h:56
MIDI OUT interface.
Definition: rtmidioutput.h:122
QString DRUMSTICK_RT_EXPORT drumstickLibraryVersion()
drumstickLibraryVersion provides the Drumstick version as an edited QString
Drumstick common.
Definition: alsaclient.cpp:68
Realtime MIDI input interface.
Realtime MIDI output interface.