drumstick
1.0.2
|
00001 /* 00002 Drumstick MIDI realtime input-output 00003 Copyright (C) 2009-2015 Pedro Lopez-Cabanillas <plcl@users.sf.net> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef MIDIINPUT_H 00021 #define MIDIINPUT_H 00022 00023 #include <QObject> 00024 #include <QString> 00025 #include <QStringList> 00026 #include <QtPlugin> 00027 #include <QSettings> 00028 00029 #include "rtmidioutput.h" 00030 00031 namespace drumstick { 00032 namespace rt { 00033 00037 class MIDIInput : public QObject 00038 { 00039 Q_OBJECT 00040 00041 public: 00046 explicit MIDIInput(QObject *parent = 0) : QObject(parent) {} 00050 virtual ~MIDIInput() {} 00055 virtual void initialize(QSettings* settings) = 0; 00060 virtual QString backendName() = 0; 00065 virtual QString publicName() = 0; 00070 virtual void setPublicName(QString name) = 0; 00075 virtual QStringList connections(bool advanced = false) = 0; 00080 virtual void setExcludedConnections(QStringList conns) = 0; 00085 virtual void open(QString name) = 0; 00089 virtual void close() = 0; 00094 virtual QString currentConnection() = 0; 00099 virtual void setMIDIThruDevice(MIDIOutput* device) = 0; 00104 virtual void enableMIDIThru(bool enable) = 0; 00109 virtual bool isEnabledMIDIThru() = 0; 00110 00111 Q_SIGNALS: 00118 void midiNoteOff(const int chan, const int note, const int vel); 00119 00126 void midiNoteOn(const int chan, const int note, const int vel); 00127 00134 void midiKeyPressure(const int chan, const int note, const int value); 00135 00142 void midiController(const int chan, const int control, const int value); 00143 00149 void midiProgram(const int chan, const int program); 00150 00156 void midiChannelPressure(const int chan, const int value); 00157 00163 void midiPitchBend(const int chan, const int value); 00164 00169 void midiSysex(const QByteArray &data); 00170 00175 void midiSystemCommon(const int status); 00176 00181 void midiSystemRealtime(const int status); 00182 }; 00183 } 00184 } 00185 00186 Q_DECLARE_INTERFACE(drumstick::rt::MIDIInput, "net.sourceforge.drumstick.rt.MIDIInput/1.0") 00187 00188 #endif // MIDIINPUT_H