1 |
schoenebeck |
201 |
/*************************************************************************** |
2 |
|
|
* * |
3 |
|
|
* LinuxSampler - modular, streaming capable sampler * |
4 |
|
|
* * |
5 |
|
|
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
|
|
* Copyright (C) 2004 Grame * |
7 |
|
|
* * |
8 |
|
|
* This program is free software; you can redistribute it and/or modify * |
9 |
|
|
* it under the terms of the GNU General Public License as published by * |
10 |
|
|
* the Free Software Foundation; either version 2 of the License, or * |
11 |
|
|
* (at your option) any later version. * |
12 |
|
|
* * |
13 |
|
|
* This program is distributed in the hope that it will be useful, * |
14 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
15 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
16 |
|
|
* GNU General Public License for more details. * |
17 |
|
|
* * |
18 |
|
|
* You should have received a copy of the GNU General Public License * |
19 |
|
|
* along with this program; if not, write to the Free Software * |
20 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * |
21 |
|
|
* MA 02111-1307 USA * |
22 |
|
|
***************************************************************************/ |
23 |
|
|
|
24 |
|
|
#ifndef __LS_MIDIINPUTDEVICEMIDISHARE_H__ |
25 |
|
|
#define __LS_MIDIINPUTDEVICEMIDISHARE_H__ |
26 |
|
|
|
27 |
|
|
#include <MidiShare.h> |
28 |
|
|
|
29 |
|
|
#include "../common/global.h" |
30 |
|
|
#include "MidiInputDevice.h" |
31 |
|
|
|
32 |
|
|
namespace LinuxSampler { |
33 |
|
|
|
34 |
|
|
/** MidiShare input driver |
35 |
|
|
* |
36 |
persson |
840 |
* Implements MIDI input using MidiShare (http://midishare.sourceforge.net/) |
37 |
schoenebeck |
201 |
*/ |
38 |
|
|
class MidiInputDeviceMidiShare : public MidiInputDevice { |
39 |
|
|
public: |
40 |
schoenebeck |
361 |
MidiInputDeviceMidiShare(std::map<String,DeviceCreationParameter*> Parameters); |
41 |
schoenebeck |
201 |
~MidiInputDeviceMidiShare(); |
42 |
|
|
|
43 |
|
|
// derived abstract methods from class 'MidiInputDevice' |
44 |
|
|
void Listen(){} |
45 |
|
|
void StopListen(){} |
46 |
schoenebeck |
361 |
virtual String Driver(); |
47 |
|
|
static String Name(); |
48 |
|
|
static String Description(); |
49 |
|
|
static String Version(); |
50 |
schoenebeck |
201 |
|
51 |
|
|
// own methods |
52 |
|
|
void ConnectToCoreMidiSource(const char* MidiSource); |
53 |
schoenebeck |
361 |
|
54 |
|
|
void OpenAppl(); |
55 |
schoenebeck |
201 |
void CloseAppl(); |
56 |
schoenebeck |
361 |
void OpenDriver(); |
57 |
schoenebeck |
201 |
void CloseDriver(); |
58 |
schoenebeck |
361 |
|
59 |
schoenebeck |
201 |
// MidiShare callback |
60 |
|
|
static void ApplAlarm(short ref, long code); |
61 |
|
|
static void ReceiveEvents(short ref); |
62 |
|
|
static void KeyOffTask(long date, short ref, long a1, long a2, long a3); |
63 |
|
|
static void WakeUp(short r); |
64 |
|
|
static void Sleep(short r); |
65 |
schoenebeck |
361 |
|
66 |
schoenebeck |
201 |
private: |
67 |
|
|
short hRefnum; |
68 |
|
|
MidiFilterPtr hMidiFilter; |
69 |
|
|
SlotRefNum hSlotRef; |
70 |
|
|
}; |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
#endif // __LS_MIDIINPUTDEVICEMIDISHARE_H__ |