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

Annotation of /linuxsampler/trunk/src/drivers/midi/MidiInputDeviceCoreMidi.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1424 - (hide annotations) (download) (as text)
Sun Oct 14 22:00:17 2007 UTC (16 years, 6 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 4633 byte(s)
* code cleanup:
- global.h now only covers global definitions that are needed for the C++
  API header files, all implementation internal global definitions are now
  in global_private.h
- atomic.h is not exposed to the C++ API anymore (replaced the references
  in SynchronizedConfig.h for this with local definitions)
- no need to include config.h anymore for using LS's API header files
- DB instruments classes are not exposed to the C++ API
- POSIX callback functions of Thread.h are hidden
- the (optional) gig Engine benchmark compiles again
- updated Doxyfile.in
- fixed warnings in API doc generation
* preparations for release 0.5.0

1 schoenebeck 201 /***************************************************************************
2     * *
3 schoenebeck 551 * Copyright (C) 2004, 2005 Grame *
4 schoenebeck 1149 * Copyright (C) 2007 Christian Schoenebeck *
5 schoenebeck 201 * *
6     * This program is free software; you can redistribute it and/or modify *
7     * it under the terms of the GNU General Public License as published by *
8     * the Free Software Foundation; either version 2 of the License, or *
9     * (at your option) any later version. *
10     * *
11     * This program is distributed in the hope that it will be useful, *
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14     * GNU General Public License for more details. *
15     * *
16     * You should have received a copy of the GNU General Public License *
17     * along with this program; if not, write to the Free Software *
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
19     * MA 02111-1307 USA *
20     ***************************************************************************/
21    
22     #ifndef __LS_MIDIINPUTDEVICECOREMIDI_H__
23     #define __LS_MIDIINPUTDEVICECOREMIDI_H__
24    
25     #include <CoreMIDI/MIDIServices.h>
26    
27 schoenebeck 1424 #include "../../common/global_private.h"
28 schoenebeck 201 #include "MidiInputDevice.h"
29    
30     namespace LinuxSampler {
31    
32 letz 362 /** CoreMidi input driver
33 schoenebeck 201 *
34     * Implements MIDI input for MacOSX CoreMidi architecture
35     */
36     class MidiInputDeviceCoreMidi : public MidiInputDevice {
37 schoenebeck 551
38 letz 362 public:
39     /**
40     * MIDI Port implementation for the CoreMidi input driver.
41     */
42     class MidiInputPortCoreMidi : public MidiInputPort {
43     public:
44     /** MIDI Port Parameter 'NAME'
45     *
46     * Used to assign an arbitrary name to the MIDI port.
47     */
48     class ParameterName : public MidiInputPort::ParameterName {
49     public:
50 schoenebeck 1149 ParameterName(MidiInputPort* pPort) throw (Exception);
51     virtual void OnSetValue(String s) throw (Exception);
52 letz 362 };
53 schoenebeck 201
54 letz 362 /** MIDI Port Parameter 'CORE_MIDI_BINDINGS'
55     *
56     * Used to connect to other Alsa sequencer clients.
57     */
58 schoenebeck 551
59 letz 362 class ParameterCoreMidiBindings : public DeviceRuntimeParameterStrings {
60     public:
61     ParameterCoreMidiBindings(MidiInputPortCoreMidi* pPort);
62     virtual String Description();
63     virtual bool Fix();
64     virtual std::vector<String> PossibilitiesAsString();
65 schoenebeck 1149 virtual void OnSetValue(std::vector<String> vS) throw (Exception);
66 letz 362 protected:
67     MidiInputPortCoreMidi* pPort;
68     };
69 schoenebeck 551
70 letz 362 static void ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefCon);
71     static int pPortID;
72 schoenebeck 551
73 letz 362 protected:
74     MidiInputPortCoreMidi(MidiInputDeviceCoreMidi* pDevice) throw (MidiInputException);
75     ~MidiInputPortCoreMidi();
76     friend class MidiInputDeviceCoreMidi;
77     private:
78     MidiInputPortCoreMidi* pDevice;
79     MIDIEndpointRef pDestination;
80    
81     friend class ParameterName;
82     friend class ParameterCoreMidiBindings;
83     };
84 schoenebeck 551
85     MidiInputDeviceCoreMidi(std::map<String,DeviceCreationParameter*> Parameters, void* pSampler);
86 letz 362 virtual ~MidiInputDeviceCoreMidi();
87    
88 schoenebeck 201 // derived abstract methods from class 'MidiInputDevice'
89     void Listen(){}
90     void StopListen(){}
91 letz 362 virtual String Driver();
92     static String Name();
93     static String Description();
94     static String Version();
95 schoenebeck 201
96 letz 362 MidiInputPortCoreMidi* CreateMidiPort();
97 schoenebeck 551
98 schoenebeck 201 // CoreMidi callback
99 letz 362 static void NotifyProc(const MIDINotification* message, void* refCon);
100 schoenebeck 551
101 schoenebeck 201 private:
102     MIDIClientRef hCoreMidiClient;
103     };
104     }
105    
106     #endif // __LS_MIDIINPUTDEVICECOREMIDI_H__

  ViewVC Help
Powered by ViewVC