drumstick  1.0.2
netmidiinput.h
1 /*
2  Drumstick RT (realtime MIDI In/Out)
3  Copyright (C) 2009-2015 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 2 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 along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef NETMIDIINPUT_H
21 #define NETMIDIINPUT_H
22 
23 #include <QObject>
24 #include <QHostAddress>
25 #include <QtPlugin>
26 #include "rtmidiinput.h"
27 
28 namespace drumstick {
29 namespace rt {
30 
31  const QString STR_ADDRESS(QLatin1Literal("225.0.0.37"));
32  const int MULTICAST_PORT(21928);
33  const int LAST_PORT(21948);
34 
35  class NetMIDIInputPrivate;
36 
37  class NetMIDIInput : public MIDIInput
38  {
39  Q_OBJECT
40  Q_PLUGIN_METADATA(IID "net.sourceforge.drumstick.rt.MIDIInput")
41  Q_INTERFACES(drumstick::rt::MIDIInput)
42 
43  public:
44  explicit NetMIDIInput(QObject *parent = 0);
45 
46  // MIDIInput interface
47  public:
48  virtual void initialize(QSettings* settings);
49  virtual QString backendName();
50  virtual QString publicName();
51  virtual void setPublicName(QString name);
52  virtual QStringList connections(bool advanced);
53  virtual void setExcludedConnections(QStringList conns);
54  virtual void open(QString name);
55  virtual void close();
56  virtual QString currentConnection();
57  virtual void setMIDIThruDevice(MIDIOutput *device);
58  virtual void enableMIDIThru(bool enable);
59  virtual bool isEnabledMIDIThru();
60 
61  private:
62  NetMIDIInputPrivate * const d;
63  };
64 
65 }}
66 
67 #endif // NETMIDIINPUT_H
The QObject class is the base class of all Qt objects.