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

Contents of /linuxsampler/trunk/src/drivers/midi/MidiInputDevicePlugin.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2354 - (show annotations) (download) (as text)
Sun Jul 8 10:29:07 2012 UTC (11 years, 9 months ago) by persson
File MIME type: text/x-c++hdr
File size: 3412 byte(s)
* DSSI bugfix: it wasn't possible to change engine type. The MIDI port
  and audio channel routing for DSSI plugins are now visible.

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 #ifndef LS_MIDIINPUTDEVICEPLUGIN_H
22 #define LS_MIDIINPUTDEVICEPLUGIN_H
23
24 #include "MidiInputDevice.h"
25
26 namespace LinuxSampler {
27
28 /** Plugin MIDI input driver
29 *
30 * Implements MIDI input when LinuxSampler is running as a plugin.
31 *
32 * The plugin implementation is given access to the MidiInputPort,
33 * to which MIDI events can be dispatched.
34 */
35 class MidiInputDevicePlugin : public MidiInputDevice {
36 public:
37 MidiInputDevicePlugin(std::map<String, DeviceCreationParameter*> Parameters,
38 void* pSampler);
39 ~MidiInputDevicePlugin();
40
41 /**
42 * MIDI Port implementation for the plugin MIDI input driver.
43 */
44 class MidiInputPortPlugin : public MidiInputPort {
45 protected:
46 MidiInputPortPlugin(MidiInputDevicePlugin* pDevice, int portNumber);
47 friend class MidiInputDevicePlugin;
48 };
49
50 /**
51 * Device Parameter 'PORTS'
52 */
53 class ParameterPortsPlugin : public ParameterPorts {
54 public:
55 ParameterPortsPlugin() : ParameterPorts() { }
56 ParameterPortsPlugin(String s) : ParameterPorts(s) { }
57 virtual bool Fix() { return true; }
58 void ForceSetValue(int ports);
59 };
60
61 // derived abstract methods from class 'MidiInputDevice'
62 void Listen();
63 void StopListen();
64 String Driver();
65 bool isAutonomousDevice();
66 static String Name();
67 static String Version();
68 static String Description();
69 MidiInputPort* CreateMidiPort();
70 static bool isAutonomousDriver();
71
72 /**
73 * Returns the MIDI port to which events can be dispatched.
74 *
75 * @returns MIDI port
76 */
77 MidiInputPort* Port() {
78 return Ports[0];
79 }
80
81 void AddMidiPort();
82 void RemoveMidiPort(MidiInputPort* pPort);
83 };
84 }
85
86 #endif

  ViewVC Help
Powered by ViewVC