1 |
/*************************************************************************** |
2 |
* * |
3 |
* Copyright (C) 2008 - 2009 Andreas Persson * |
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 * |
16 |
* along with this program; if not, write to the Free Software * |
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * |
18 |
* MA 02110-1301 USA * |
19 |
***************************************************************************/ |
20 |
|
21 |
#include "MidiInputDevicePlugin.h" |
22 |
|
23 |
namespace LinuxSampler { |
24 |
|
25 |
// *************** MidiInputPortPlugin *************** |
26 |
// * |
27 |
|
28 |
MidiInputDevicePlugin::MidiInputPortPlugin::MidiInputPortPlugin(MidiInputDevicePlugin* pDevice, |
29 |
int portNumber) : |
30 |
MidiInputPort(pDevice, portNumber) { |
31 |
} |
32 |
|
33 |
|
34 |
|
35 |
// *************** MidiInputDevicePlugin *************** |
36 |
// * |
37 |
|
38 |
MidiInputDevicePlugin::MidiInputDevicePlugin(std::map<String, DeviceCreationParameter*> Parameters, |
39 |
void* pSampler) : |
40 |
MidiInputDevice(Parameters, pSampler) { |
41 |
AcquirePorts(1); |
42 |
} |
43 |
|
44 |
MidiInputDevicePlugin::~MidiInputDevicePlugin() { |
45 |
for (std::map<int, MidiInputPort*>::iterator iter = |
46 |
Ports.begin() ; iter != Ports.end() ; iter++) { |
47 |
delete dynamic_cast<MidiInputPortPlugin*>(iter->second); |
48 |
} |
49 |
Ports.clear(); |
50 |
} |
51 |
|
52 |
void MidiInputDevicePlugin::Listen() { |
53 |
} |
54 |
|
55 |
void MidiInputDevicePlugin::StopListen() { |
56 |
} |
57 |
|
58 |
String MidiInputDevicePlugin::Driver() { |
59 |
return Name(); |
60 |
} |
61 |
|
62 |
String MidiInputDevicePlugin::Name() { |
63 |
return "Plugin"; |
64 |
} |
65 |
|
66 |
String MidiInputDevicePlugin::Version() { |
67 |
String s = "$Revision: 1.3 $"; |
68 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
69 |
} |
70 |
|
71 |
String MidiInputDevicePlugin::Description() { |
72 |
return Name(); |
73 |
} |
74 |
|
75 |
MidiInputPort* MidiInputDevicePlugin::CreateMidiPort() { |
76 |
return new MidiInputPortPlugin(this, Ports.size()); |
77 |
} |
78 |
|
79 |
void MidiInputDevicePlugin::DeleteMidiPort(MidiInputPort* pPort) { |
80 |
delete (MidiInputPortPlugin*)pPort; |
81 |
} |
82 |
|
83 |
bool MidiInputDevicePlugin::isAutonomousDevice() { |
84 |
return false; |
85 |
} |
86 |
|
87 |
bool MidiInputDevicePlugin::isAutonomousDriver() { |
88 |
return false; |
89 |
} |
90 |
} |