drumstick  1.0.2
netmidiinput.h
00001 /*
00002     Drumstick RT (realtime MIDI In/Out)
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 NETMIDIINPUT_H
00021 #define NETMIDIINPUT_H
00022 
00023 #include <QObject>
00024 #include <QHostAddress>
00025 #include <QtPlugin>
00026 #include "rtmidiinput.h"
00027 
00028 namespace drumstick {
00029 namespace rt {
00030 
00031     const QString STR_ADDRESS(QLatin1Literal("225.0.0.37"));
00032     const int MULTICAST_PORT(21928);
00033     const int LAST_PORT(21948);
00034 
00035     class NetMIDIInputPrivate;
00036 
00037     class NetMIDIInput : public MIDIInput
00038     {
00039         Q_OBJECT
00040         Q_PLUGIN_METADATA(IID "net.sourceforge.drumstick.rt.MIDIInput")
00041         Q_INTERFACES(drumstick::rt::MIDIInput)
00042 
00043     public:
00044         explicit NetMIDIInput(QObject *parent = 0);
00045 
00046         // MIDIInput interface
00047     public:
00048         virtual void initialize(QSettings* settings);
00049         virtual QString backendName();
00050         virtual QString publicName();
00051         virtual void setPublicName(QString name);
00052         virtual QStringList connections(bool advanced);
00053         virtual void setExcludedConnections(QStringList conns);
00054         virtual void open(QString name);
00055         virtual void close();
00056         virtual QString currentConnection();
00057         virtual void setMIDIThruDevice(MIDIOutput *device);
00058         virtual void enableMIDIThru(bool enable);
00059         virtual bool isEnabledMIDIThru();
00060 
00061     private:
00062         NetMIDIInputPrivate * const d;
00063     };
00064 
00065 }}
00066 
00067 #endif // NETMIDIINPUT_H