drumstick  1.0.2
synthoutput.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 "synthoutput.h"
21 
22 namespace drumstick {
23 namespace rt {
24 
25 SynthOutput::SynthOutput(QObject *parent) : MIDIOutput(parent),
26  m_synth(new SynthEngine(this))
27 { }
28 
29 SynthOutput::~SynthOutput()
30 { }
31 
32 void SynthOutput::initialize(QSettings *settings)
33 {
34  m_synth->readSettings(settings);
35  m_synth->initialize(settings);
36 }
37 
38 QString SynthOutput::backendName()
39 {
40  return QSTR_FLUIDSYNTH;
41 }
42 
43 QString SynthOutput::publicName()
44 {
45  return QSTR_FLUIDSYNTH;
46 }
47 
48 void SynthOutput::setPublicName(QString name)
49 {
50  Q_UNUSED(name)
51 }
52 
53 QStringList SynthOutput::connections(bool advanced)
54 {
55  Q_UNUSED(advanced)
56  return QStringList(QSTR_FLUIDSYNTH);
57 }
58 
59 void SynthOutput::setExcludedConnections(QStringList conns)
60 {
61  Q_UNUSED(conns)
62 }
63 
64 void SynthOutput::open(QString name)
65 {
66  Q_UNUSED(name)
67  m_synth->open();
68 }
69 
70 void SynthOutput::close()
71 {
72  m_synth->close();
73 }
74 
75 QString SynthOutput::currentConnection()
76 {
77  return m_synth->currentConnection();
78 }
79 
80 void SynthOutput::sendNoteOff(int chan, int note, int vel)
81 {
82  m_synth->noteOff(chan, note, vel);
83 }
84 
85 void SynthOutput::sendNoteOn(int chan, int note, int vel)
86 {
87  m_synth->noteOn(chan, note, vel);
88 }
89 
90 void SynthOutput::sendKeyPressure(int chan, int note, int value)
91 {
92  Q_UNUSED(chan)
93  Q_UNUSED(note)
94  Q_UNUSED(value)
95 }
96 
97 void SynthOutput::sendController(int chan, int control, int value)
98 {
99  m_synth->controlChange(chan, control, value);
100 }
101 
102 void SynthOutput::sendProgram(int chan, int program)
103 {
104  m_synth->setInstrument(chan, program);
105 }
106 
107 void SynthOutput::sendChannelPressure(int chan, int value)
108 {
109  Q_UNUSED(chan)
110  Q_UNUSED(value)
111 }
112 
113 void SynthOutput::sendPitchBend(int chan, int value)
114 {
115  m_synth->bender(chan, value);
116 }
117 
118 void SynthOutput::sendSysex(const QByteArray &data)
119 {
120  Q_UNUSED(data)
121 }
122 
123 void SynthOutput::sendSystemMsg(const int status)
124 {
125  Q_UNUSED(status)
126 }
127 
128 }}
The QObject class is the base class of all Qt objects.