00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackALSARawMidiPort__
00021 #define __JackALSARawMidiPort__
00022
00023 #include <alsa/asoundlib.h>
00024 #include <poll.h>
00025
00026 #include "JackConstants.h"
00027
00028 namespace Jack {
00029
00030 class JackALSARawMidiPort {
00031
00032 private:
00033
00034 char alias[REAL_JACK_PORT_NAME_SIZE];
00035 struct pollfd *alsa_poll_fds;
00036 int alsa_poll_fd_count;
00037 int fds[2];
00038 unsigned short io_mask;
00039 char name[REAL_JACK_PORT_NAME_SIZE];
00040 struct pollfd *queue_poll_fd;
00041
00042 protected:
00043
00044 snd_rawmidi_t *rawmidi;
00045
00046 int
00047 GetIOPollEvent();
00048
00049 int
00050 GetQueuePollEvent();
00051
00052 void
00053 SetIOEventsEnabled(bool enabled);
00054
00055 void
00056 SetQueueEventsEnabled(bool enabled);
00057
00058 bool
00059 TriggerQueueEvent();
00060
00061 public:
00062
00063 JackALSARawMidiPort(snd_rawmidi_info_t *info, size_t index,
00064 unsigned short io_mask);
00065
00066 virtual
00067 ~JackALSARawMidiPort();
00068
00069 const char *
00070 GetAlias();
00071
00072 const char *
00073 GetName();
00074
00075 int
00076 GetPollDescriptorCount();
00077
00078 void
00079 PopulatePollDescriptors(struct pollfd *poll_fd);
00080
00081 };
00082
00083 }
00084
00085 #endif