00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __JackCoreMidiDriver__
00022 #define __JackCoreMidiDriver__
00023
00024 #include "JackCoreMidiPhysicalInputPort.h"
00025 #include "JackCoreMidiPhysicalOutputPort.h"
00026 #include "JackCoreMidiVirtualInputPort.h"
00027 #include "JackCoreMidiVirtualOutputPort.h"
00028 #include "JackMidiDriver.h"
00029 #include "JackThread.h"
00030
00031 namespace Jack {
00032
00033 class JackCoreMidiDriver: public JackMidiDriver, public JackRunnableInterface, public JackLockAble {
00034
00035 private:
00036
00037 static void
00038 HandleInputEvent(const MIDIPacketList *packet_list, void *driver,
00039 void *port);
00040
00041 static void
00042 HandleNotificationEvent(const MIDINotification *message, void *driver);
00043
00044 void
00045 HandleNotification(const MIDINotification *message);
00046
00047 MIDIClientRef client;
00048 MIDIPortRef internal_input;
00049 MIDIPortRef internal_output;
00050 int num_physical_inputs;
00051 int num_physical_outputs;
00052 int num_virtual_inputs;
00053 int num_virtual_outputs;
00054 JackCoreMidiPhysicalInputPort **physical_input_ports;
00055 JackCoreMidiPhysicalOutputPort **physical_output_ports;
00056 double time_ratio;
00057 JackCoreMidiVirtualInputPort **virtual_input_ports;
00058 JackCoreMidiVirtualOutputPort **virtual_output_ports;
00059
00060 bool OpenAux();
00061 int CloseAux();
00062
00063 void Restart();
00064
00065 JackThread fThread;
00067 public:
00068
00069 JackCoreMidiDriver(const char* name, const char* alias,
00070 JackLockedEngine* engine, JackSynchro* table);
00071
00072 ~JackCoreMidiDriver();
00073
00074 int
00075 Attach();
00076
00077 int
00078 Close();
00079
00080 int
00081 Open(bool capturing, bool playing, int num_inputs, int num_outputs,
00082 bool monitor, const char* capture_driver_name,
00083 const char* playback_driver_name, jack_nframes_t capture_latency,
00084 jack_nframes_t playback_latency);
00085
00086 int
00087 Read();
00088
00089 int
00090 Start();
00091
00092 int
00093 Stop();
00094
00095 int
00096 Write();
00097
00098 int ProcessRead();
00099 int ProcessWrite();
00100
00101
00102 bool Init();
00103 bool Execute();
00104
00105 };
00106
00107 }
00108
00109 #define WAIT_COUNTER 100
00110
00111 #endif