drumstick  1.1.0
rtmidiinput.h
Go to the documentation of this file.
1 /*
2  Drumstick MIDI realtime input-output
3  Copyright (C) 2009-2016 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 
38 namespace drumstick {
39 namespace rt {
40 
44  class MIDIInput : public QObject
45  {
46  Q_OBJECT
47 
48  public:
53  explicit MIDIInput(QObject *parent = 0) : QObject(parent) {}
57  virtual ~MIDIInput() {}
62  virtual void initialize(QSettings* settings) = 0;
67  virtual QString backendName() = 0;
72  virtual QString publicName() = 0;
77  virtual void setPublicName(QString name) = 0;
82  virtual QStringList connections(bool advanced = false) = 0;
87  virtual void setExcludedConnections(QStringList conns) = 0;
92  virtual void open(QString name) = 0;
96  virtual void close() = 0;
101  virtual QString currentConnection() = 0;
106  virtual void setMIDIThruDevice(MIDIOutput* device) = 0;
111  virtual void enableMIDIThru(bool enable) = 0;
116  virtual bool isEnabledMIDIThru() = 0;
117 
118  Q_SIGNALS:
125  void midiNoteOff(const int chan, const int note, const int vel);
126 
133  void midiNoteOn(const int chan, const int note, const int vel);
134 
141  void midiKeyPressure(const int chan, const int note, const int value);
142 
149  void midiController(const int chan, const int control, const int value);
150 
156  void midiProgram(const int chan, const int program);
157 
163  void midiChannelPressure(const int chan, const int value);
164 
170  void midiPitchBend(const int chan, const int value);
171 
176  void midiSysex(const QByteArray &data);
177 
182  void midiSystemCommon(const int status);
183 
188  void midiSystemRealtime(const int status);
189  };
190 }}
191 
192 Q_DECLARE_INTERFACE(drumstick::rt::MIDIInput, "net.sourceforge.drumstick.rt.MIDIInput/1.0")
193 
194 
196 #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:44
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
Realtime MIDI output interface.
void midiKeyPressure(const int chan, const int note, const int value)
midiKeyPressure 0xA
virtual ~MIDIInput()
~MIDIInput destructor
Definition: rtmidiinput.h:57
MIDIInput(QObject *parent=0)
MIDIInput constructor.
Definition: rtmidiinput.h:53
virtual QStringList connections(bool advanced=false)=0
connections
virtual void setPublicName(QString name)=0
setPublicName
MIDI OUT interface.
Definition: rtmidioutput.h:78
void midiProgram(const int chan, const int program)
midiProgram 0xC
void midiNoteOff(const int chan, const int note, const int vel)
midiNoteOff 0x8