1 /*
2     Drumstick RT (realtime MIDI In/Out)
3     Copyright (C) 2009-2021 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 3 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
16     along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef OSSINPUT_P_H
20 #define OSSINPUT_P_H
21 
22 #include <QObject>
23 #include <QIODevice>
24 #include <QSocketNotifier>
25 #include <QStringList>
26 #include <QByteArray>
27 #include "midiparser.h"
28 
29 namespace drumstick {
30 namespace rt {
31 
32 class MIDIOutput;
33 class OSSInput;
34 
35 class OSSInputPrivate : public QObject
36 {
37     Q_OBJECT
38 public:
39     OSSInput *m_inp;
40     MIDIOutput *m_out;
41     QIODevice *m_device;
42     QSocketNotifier *m_notifier;
43     MIDIParser *m_parser;
44     bool m_thruEnabled;
45     bool m_advanced;
46     QString m_publicName;
47     MIDIConnection m_currentInput;
48     QList<MIDIConnection> m_inputDevices;
49     QStringList m_excludedNames;
50     QByteArray m_buffer;
51 
52     explicit OSSInputPrivate(QObject *parent = nullptr);
53     void reloadDeviceList(bool advanced = false);
54     void open(const MIDIConnection& portName);
55     void close();
56     //void parse();
57     void setMIDIThruDevice(MIDIOutput* device);
58 
59 public slots:
60     void processIncomingMessages(int);
61 };
62 
63 }}
64 #endif // OSSINPUT_P_H
65