/[svn]/linuxsampler/trunk/src/drivers/midi/MidiInputDevicePlugin.cpp
ViewVC logotype

Annotation of /linuxsampler/trunk/src/drivers/midi/MidiInputDevicePlugin.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1934 - (hide annotations) (download)
Sun Jul 12 10:35:55 2009 UTC (14 years, 9 months ago) by schoenebeck
File size: 3369 byte(s)
* bugfix: don't allow to create or destroy audio devices and MIDI devices
  of host plugin implementations (e.g VST, AU, DSSI, LV2) on their own,
  as they only exist in the context of the plugin instance and would
  otherwise crash the application

1 persson 1777 /***************************************************************************
2     * *
3 persson 1858 * Copyright (C) 2008 - 2009 Andreas Persson *
4 persson 1777 * *
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 persson 1858 MidiInputDevicePlugin::MidiInputPortPlugin::MidiInputPortPlugin(MidiInputDevicePlugin* pDevice,
29     int portNumber) :
30     MidiInputPort(pDevice, portNumber) {
31 persson 1777 }
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 schoenebeck 1934 String s = "$Revision: 1.3 $";
68 persson 1777 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 persson 1858 return new MidiInputPortPlugin(this, Ports.size());
77 persson 1777 }
78 persson 1858
79     void MidiInputDevicePlugin::DeleteMidiPort(MidiInputPort* pPort) {
80     delete (MidiInputPortPlugin*)pPort;
81     }
82 schoenebeck 1934
83     bool MidiInputDevicePlugin::isAutonomousDevice() {
84     return false;
85     }
86    
87     bool MidiInputDevicePlugin::isAutonomousDriver() {
88     return false;
89     }
90 persson 1777 }

  ViewVC Help
Powered by ViewVC