2 Copyright (C) 2009 Grame
3 Copyright (C) 2011 Devin Anderson
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.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __JackCoreMidiDriver__
22 #define __JackCoreMidiDriver__
24 #include "JackCoreMidiPhysicalInputPort.h"
25 #include "JackCoreMidiPhysicalOutputPort.h"
26 #include "JackCoreMidiVirtualInputPort.h"
27 #include "JackCoreMidiVirtualOutputPort.h"
28 #include "JackMidiDriver.h"
29 #include "JackThread.h"
33 class JackCoreMidiDriver
: public JackMidiDriver
, public JackRunnableInterface
, public JackLockAble
{
38 HandleInputEvent(const MIDIPacketList
*packet_list
, void *driver
,
42 HandleNotificationEvent(const MIDINotification
*message
, void *driver
);
45 HandleNotification(const MIDINotification
*message
);
48 MIDIPortRef internal_input
;
49 MIDIPortRef internal_output
;
50 int num_physical_inputs
;
51 int num_physical_outputs
;
52 int num_virtual_inputs
;
53 int num_virtual_outputs
;
54 JackCoreMidiPhysicalInputPort
**physical_input_ports
;
55 JackCoreMidiPhysicalOutputPort
**physical_output_ports
;
57 JackCoreMidiVirtualInputPort
**virtual_input_ports
;
58 JackCoreMidiVirtualOutputPort
**virtual_output_ports
;
65 JackThread fThread
; /*! Thread to execute the Process function */
69 JackCoreMidiDriver(const char* name
, const char* alias
,
70 JackLockedEngine
* engine
, JackSynchro
* table
);
72 ~JackCoreMidiDriver();
81 Open(bool capturing
, bool playing
, int num_inputs
, int num_outputs
,
82 bool monitor
, const char* capture_driver_name
,
83 const char* playback_driver_name
, jack_nframes_t capture_latency
,
84 jack_nframes_t playback_latency
);
101 // JackRunnableInterface interface
109 #define WAIT_COUNTER 100