drumstick  2.5.0
rtmidiinput.h
Go to the documentation of this file.
1 /*
2  Drumstick MIDI realtime input-output
3  Copyright (C) 2009-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 MIDIINPUT_H
20 #define MIDIINPUT_H
21 
22 #include <QObject>
23 #include <QString>
24 #include <QStringList>
25 #include <QtPlugin>
26 #include <QSettings>
27 
28 #include "macros.h"
29 #include "rtmidioutput.h"
30 
36 namespace drumstick { namespace rt {
37 
45  class DRUMSTICK_EXPORT MIDIInput : public QObject
46  {
47  Q_OBJECT
48 
49  public:
54  explicit MIDIInput(QObject *parent = nullptr) : QObject(parent) {}
58  virtual ~MIDIInput() = default;
63  virtual void initialize(QSettings* settings) = 0;
68  virtual QString backendName() = 0;
73  virtual QString publicName() = 0;
78  virtual void setPublicName(QString name) = 0;
84  virtual QList<MIDIConnection> connections(bool advanced = false) = 0;
89  virtual void setExcludedConnections(QStringList conns) = 0;
94  virtual void open(const MIDIConnection& conn) = 0;
98  virtual void close() = 0;
103  virtual MIDIConnection currentConnection() = 0;
108  virtual void setMIDIThruDevice(MIDIOutput* device) = 0;
113  virtual void enableMIDIThru(bool enable) = 0;
118  virtual bool isEnabledMIDIThru() = 0;
119 
120  Q_SIGNALS:
127  void midiNoteOff(const int chan, const int note, const int vel);
128 
135  void midiNoteOn(const int chan, const int note, const int vel);
136 
143  void midiKeyPressure(const int chan, const int note, const int value);
144 
151  void midiController(const int chan, const int control, const int value);
152 
158  void midiProgram(const int chan, const int program);
159 
165  void midiChannelPressure(const int chan, const int value);
166 
172  void midiPitchBend(const int chan, const int value);
173 
178  void midiSysex(const QByteArray &data);
179 
184  void midiSystemCommon(const int status);
185 
190  void midiSystemRealtime(const int status);
191  };
192 
195 }} // namespace drumstick::rt
196 
197 Q_DECLARE_INTERFACE(drumstick::rt::MIDIInput, "net.sourceforge.drumstick.rt.MIDIInput/2.0")
198 
199 #endif // MIDIINPUT_H
MIDIInput(QObject *parent=nullptr)
MIDIInput constructor.
Definition: rtmidiinput.h:54
QPair< QString, QVariant > MIDIConnection
MIDIConnection represents a connection identifier.
Definition: rtmidioutput.h:106
The QSettings class provides persistent platform-independent application settings.
MIDI IN interface.
Definition: rtmidiinput.h:45
The QObject class is the base class of all Qt objects.
Drumstick visibility macros.
Drumstick common.
Definition: alsaclient.cpp:68
Realtime MIDI output interface.
MIDI OUT interface.
Definition: rtmidioutput.h:111