drumstick  1.0.2
netmidiinput_p.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_P_H
00021 #define NETMIDIINPUT_P_H
00022 
00023 #include <QObject>
00024 #include <QUdpSocket>
00025 #include <QNetworkInterface>
00026 #include "midiparser.h"
00027 
00028 namespace drumstick {
00029 namespace rt {
00030 
00031 class MIDIOutput;
00032 class NetMIDIInput;
00033 
00034 class NetMIDIInputPrivate : public QObject
00035 {
00036     Q_OBJECT
00037 public:
00038     NetMIDIInput *m_inp;
00039     MIDIOutput *m_out;
00040     QUdpSocket *m_socket;
00041     MIDIParser *m_parser;
00042     int m_thruEnabled;
00043     quint16 m_port;
00044     QString m_publicName;
00045     QHostAddress m_groupAddress;
00046     QString m_currentInput;
00047     QStringList m_inputDevices;
00048     QStringList m_excludedNames;
00049     QNetworkInterface m_iface;
00050 
00051     NetMIDIInputPrivate(QObject *parent = 0);
00052 
00053     void open(QString portName);
00054     void close();
00055     void initialize(QSettings* settings);
00056     void setMIDIThruDevice(MIDIOutput* device);
00057 
00058 public slots:
00059     void processIncomingMessages();
00060 };
00061 
00062 }}
00063 #endif // NETMIDIINPUT_P_H