drumstick  1.0.2
ossinput_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 OSSINPUT_P_H
00021 #define OSSINPUT_P_H
00022 
00023 #include <QObject>
00024 #include <QIODevice>
00025 #include <QSocketNotifier>
00026 #include <QStringList>
00027 #include <QByteArray>
00028 #include "midiparser.h"
00029 
00030 namespace drumstick {
00031 namespace rt {
00032 
00033 class MIDIOutput;
00034 class OSSInput;
00035 
00036 class OSSInputPrivate : public QObject
00037 {
00038     Q_OBJECT
00039 public:
00040     OSSInput *m_inp;
00041     MIDIOutput *m_out;
00042     QIODevice *m_device;
00043     QSocketNotifier *m_notifier;
00044     MIDIParser *m_parser;
00045     bool m_thruEnabled;
00046     bool m_advanced;
00047     QString m_publicName;
00048     QString m_currentInput;
00049     QStringList m_inputDevices;
00050     QStringList m_excludedNames;
00051     QByteArray m_buffer;
00052 
00053     OSSInputPrivate(QObject *parent = 0);
00054     void reloadDeviceList(bool advanced = false);
00055     void open(QString portName);
00056     void close();
00057     //void parse();
00058     void setMIDIThruDevice(MIDIOutput* device);
00059 
00060 public slots:
00061     void processIncomingMessages(int);
00062 };
00063 
00064 }}
00065 #endif // OSSINPUT_P_H