drumstick  1.0.2
rtmidiinput.h
1 /*
2  Drumstick MIDI realtime input-output
3  Copyright (C) 2009-2015 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 2 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 along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef MIDIINPUT_H
21 #define MIDIINPUT_H
22 
23 #include <QObject>
24 #include <QString>
25 #include <QStringList>
26 #include <QtPlugin>
27 #include <QSettings>
28 
29 #include "rtmidioutput.h"
30 
31 namespace drumstick {
32 namespace rt {
33 
37  class MIDIInput : public QObject
38  {
39  Q_OBJECT
40 
41  public:
46  explicit MIDIInput(QObject *parent = 0) : QObject(parent) {}
50  virtual ~MIDIInput() {}
55  virtual void initialize(QSettings* settings) = 0;
60  virtual QString backendName() = 0;
65  virtual QString publicName() = 0;
70  virtual void setPublicName(QString name) = 0;
75  virtual QStringList connections(bool advanced = false) = 0;
80  virtual void setExcludedConnections(QStringList conns) = 0;
85  virtual void open(QString name) = 0;
89  virtual void close() = 0;
94  virtual QString currentConnection() = 0;
99  virtual void setMIDIThruDevice(MIDIOutput* device) = 0;
104  virtual void enableMIDIThru(bool enable) = 0;
109  virtual bool isEnabledMIDIThru() = 0;
110 
111  Q_SIGNALS:
118  void midiNoteOff(const int chan, const int note, const int vel);
119 
126  void midiNoteOn(const int chan, const int note, const int vel);
127 
134  void midiKeyPressure(const int chan, const int note, const int value);
135 
142  void midiController(const int chan, const int control, const int value);
143 
149  void midiProgram(const int chan, const int program);
150 
156  void midiChannelPressure(const int chan, const int value);
157 
163  void midiPitchBend(const int chan, const int value);
164 
169  void midiSysex(const QByteArray &data);
170 
175  void midiSystemCommon(const int status);
176 
181  void midiSystemRealtime(const int status);
182  };
183 }
184 }
185 
186 Q_DECLARE_INTERFACE(drumstick::rt::MIDIInput, "net.sourceforge.drumstick.rt.MIDIInput/1.0")
187 
188 #endif // MIDIINPUT_H
void midiNoteOn(const int chan, const int note, const int vel)
midiNoteOn 0x9
void midiPitchBend(const int chan, const int value)
midiPitchBend 0xE
void midiSysex(const QByteArray &data)
midiSysex
virtual void setExcludedConnections(QStringList conns)=0
setExcludedConnections
virtual QString publicName()=0
publicName
MIDI IN interface.
Definition: rtmidiinput.h:37
virtual void setMIDIThruDevice(MIDIOutput *device)=0
setMIDIThruDevice
virtual void enableMIDIThru(bool enable)=0
enableMIDIThru
The QObject class is the base class of all Qt objects.
virtual void open(QString name)=0
open the MIDI port by name
virtual QString currentConnection()=0
currentConnection
void midiSystemRealtime(const int status)
midiSystemRealtime
void midiSystemCommon(const int status)
midiSystemCommon
virtual void initialize(QSettings *settings)=0
initialize
virtual QString backendName()=0
backendName
virtual bool isEnabledMIDIThru()=0
isEnabledMIDIThru
void midiController(const int chan, const int control, const int value)
midiController 0xB
virtual void close()=0
close the MIDI port
void midiChannelPressure(const int chan, const int value)
midiChannelPressure 0xD
void midiKeyPressure(const int chan, const int note, const int value)
midiKeyPressure 0xA
virtual ~MIDIInput()
~MIDIInput destructor
Definition: rtmidiinput.h:50
MIDIInput(QObject *parent=0)
MIDIInput constructor.
Definition: rtmidiinput.h:46
virtual QStringList connections(bool advanced=false)=0
connections
virtual void setPublicName(QString name)=0
setPublicName
MIDI OUT interface.
Definition: rtmidioutput.h:71
void midiProgram(const int chan, const int program)
midiProgram 0xC
void midiNoteOff(const int chan, const int note, const int vel)
midiNoteOff 0x8