drumstick  1.0.2
ossinput.cpp
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 #include "ossinput.h"
00021 
00022 namespace drumstick {
00023 namespace rt {
00024 
00025 OSSInput::OSSInput(QObject *parent) : MIDIInput(parent),
00026     d(new OSSInputPrivate(this))
00027 { }
00028 
00029 OSSInput::~OSSInput()
00030 {
00031     delete d;
00032 }
00033 
00034 void OSSInput::initialize(QSettings *settings)
00035 {
00036     Q_UNUSED(settings)
00037 }
00038 
00039 QString OSSInput::backendName()
00040 {
00041     return "OSS";
00042 }
00043 
00044 QString OSSInput::publicName()
00045 {
00046     return d->m_publicName;
00047 }
00048 
00049 void OSSInput::setPublicName(QString name)
00050 {
00051     d->m_publicName = name;
00052 }
00053 
00054 QStringList OSSInput::connections(bool advanced)
00055 {
00056     d->reloadDeviceList(advanced);
00057     return d->m_inputDevices;
00058 }
00059 
00060 void OSSInput::setExcludedConnections(QStringList conns)
00061 {
00062     Q_UNUSED(conns)
00063 }
00064 
00065 QString OSSInput::currentConnection()
00066 {
00067     return d->m_currentInput;
00068 }
00069 
00070 void OSSInput::open(QString name)
00071 {
00072     d->open(name);
00073 }
00074 
00075 void OSSInput::close()
00076 {
00077     d->close();
00078 }
00079 
00080 void OSSInput::setMIDIThruDevice(MIDIOutput *device)
00081 {
00082     d->setMIDIThruDevice(device);
00083     //d->m_out = device;
00084 }
00085 
00086 void OSSInput::enableMIDIThru(bool enable)
00087 {
00088     d->m_thruEnabled = enable;
00089 }
00090 
00091 bool OSSInput::isEnabledMIDIThru()
00092 {
00093     return d->m_thruEnabled && (d->m_out != 0);
00094 }
00095 
00096 }}