1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* LinuxSampler - modular, streaming capable sampler * |
* Copyright (C) 2004, 2005 Grame * |
|
* * |
|
|
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
|
|
* Copyright (C) 2004 Grame * |
|
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* 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 * |
* it under the terms of the GNU General Public License as published by * |
33 |
* Implements MIDI input for MacOSX CoreMidi architecture |
* Implements MIDI input for MacOSX CoreMidi architecture |
34 |
*/ |
*/ |
35 |
class MidiInputDeviceCoreMidi : public MidiInputDevice { |
class MidiInputDeviceCoreMidi : public MidiInputDevice { |
36 |
|
|
37 |
public: |
public: |
38 |
/** |
/** |
39 |
* MIDI Port implementation for the CoreMidi input driver. |
* MIDI Port implementation for the CoreMidi input driver. |
54 |
* |
* |
55 |
* Used to connect to other Alsa sequencer clients. |
* Used to connect to other Alsa sequencer clients. |
56 |
*/ |
*/ |
57 |
|
|
58 |
class ParameterCoreMidiBindings : public DeviceRuntimeParameterStrings { |
class ParameterCoreMidiBindings : public DeviceRuntimeParameterStrings { |
59 |
public: |
public: |
60 |
ParameterCoreMidiBindings(MidiInputPortCoreMidi* pPort); |
ParameterCoreMidiBindings(MidiInputPortCoreMidi* pPort); |
65 |
protected: |
protected: |
66 |
MidiInputPortCoreMidi* pPort; |
MidiInputPortCoreMidi* pPort; |
67 |
}; |
}; |
68 |
|
|
69 |
static void ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefCon); |
static void ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefCon); |
70 |
static int pPortID; |
static int pPortID; |
71 |
|
|
72 |
protected: |
protected: |
73 |
MidiInputPortCoreMidi(MidiInputDeviceCoreMidi* pDevice) throw (MidiInputException); |
MidiInputPortCoreMidi(MidiInputDeviceCoreMidi* pDevice) throw (MidiInputException); |
74 |
~MidiInputPortCoreMidi(); |
~MidiInputPortCoreMidi(); |
80 |
friend class ParameterName; |
friend class ParameterName; |
81 |
friend class ParameterCoreMidiBindings; |
friend class ParameterCoreMidiBindings; |
82 |
}; |
}; |
83 |
|
|
84 |
MidiInputDeviceCoreMidi(std::map<String,DeviceCreationParameter*> Parameters); |
MidiInputDeviceCoreMidi(std::map<String,DeviceCreationParameter*> Parameters, void* pSampler); |
85 |
virtual ~MidiInputDeviceCoreMidi(); |
virtual ~MidiInputDeviceCoreMidi(); |
86 |
|
|
87 |
// derived abstract methods from class 'MidiInputDevice' |
// derived abstract methods from class 'MidiInputDevice' |
93 |
static String Version(); |
static String Version(); |
94 |
|
|
95 |
MidiInputPortCoreMidi* CreateMidiPort(); |
MidiInputPortCoreMidi* CreateMidiPort(); |
96 |
|
|
97 |
// CoreMidi callback |
// CoreMidi callback |
98 |
static void NotifyProc(const MIDINotification* message, void* refCon); |
static void NotifyProc(const MIDINotification* message, void* refCon); |
99 |
|
|
100 |
private: |
private: |
101 |
MIDIClientRef hCoreMidiClient; |
MIDIClientRef hCoreMidiClient; |
102 |
}; |
}; |