drumstick  1.0.2
ossinput.cpp
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 #include "ossinput.h"
21 
22 namespace drumstick {
23 namespace rt {
24 
25 OSSInput::OSSInput(QObject *parent) : MIDIInput(parent),
26  d(new OSSInputPrivate(this))
27 { }
28 
29 OSSInput::~OSSInput()
30 {
31  delete d;
32 }
33 
34 void OSSInput::initialize(QSettings *settings)
35 {
36  Q_UNUSED(settings)
37 }
38 
39 QString OSSInput::backendName()
40 {
41  return "OSS";
42 }
43 
44 QString OSSInput::publicName()
45 {
46  return d->m_publicName;
47 }
48 
49 void OSSInput::setPublicName(QString name)
50 {
51  d->m_publicName = name;
52 }
53 
54 QStringList OSSInput::connections(bool advanced)
55 {
56  d->reloadDeviceList(advanced);
57  return d->m_inputDevices;
58 }
59 
60 void OSSInput::setExcludedConnections(QStringList conns)
61 {
62  Q_UNUSED(conns)
63 }
64 
65 QString OSSInput::currentConnection()
66 {
67  return d->m_currentInput;
68 }
69 
70 void OSSInput::open(QString name)
71 {
72  d->open(name);
73 }
74 
75 void OSSInput::close()
76 {
77  d->close();
78 }
79 
80 void OSSInput::setMIDIThruDevice(MIDIOutput *device)
81 {
82  d->setMIDIThruDevice(device);
83  //d->m_out = device;
84 }
85 
86 void OSSInput::enableMIDIThru(bool enable)
87 {
88  d->m_thruEnabled = enable;
89 }
90 
91 bool OSSInput::isEnabledMIDIThru()
92 {
93  return d->m_thruEnabled && (d->m_out != 0);
94 }
95 
96 }}
The QObject class is the base class of all Qt objects.