jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.6KB

  1. #ifndef __JackALSARawMidiDriver__
  2. #define __JackALSARawMidiDriver__
  3. #include <vector>
  4. #include <alsa/asoundlib.h>
  5. #include <poll.h>
  6. #include "JackALSARawMidiInputPort.h"
  7. #include "JackALSARawMidiOutputPort.h"
  8. #include "JackMidiDriver.h"
  9. #include "JackThread.h"
  10. namespace Jack {
  11. class JackALSARawMidiDriver:
  12. public JackMidiDriver, public JackRunnableInterface {
  13. private:
  14. int fds[2];
  15. JackALSARawMidiInputPort **input_ports;
  16. JackALSARawMidiOutputPort **output_ports;
  17. nfds_t poll_fd_count;
  18. struct pollfd *poll_fds;
  19. JackThread *thread;
  20. void
  21. GetDeviceInfo(snd_ctl_t *control, snd_rawmidi_info_t *info,
  22. std::vector<snd_rawmidi_info_t *> *info_list);
  23. void
  24. HandleALSAError(const char *driver_func, const char *alsa_func,
  25. int code);
  26. int
  27. Poll(const jack_time_t *wait_time);
  28. public:
  29. JackALSARawMidiDriver(const char *name, const char *alias,
  30. JackLockedEngine *engine, JackSynchro *table);
  31. ~JackALSARawMidiDriver();
  32. int
  33. Attach();
  34. int
  35. Close();
  36. bool
  37. Execute();
  38. bool
  39. Init();
  40. int
  41. Open(bool capturing, bool playing, int in_channels, int out_channels,
  42. bool monitoring, const char *capture_driver_name,
  43. const char *playback_driver_name, jack_nframes_t capture_latency,
  44. jack_nframes_t playback_latency);
  45. int
  46. Read();
  47. int
  48. Start();
  49. int
  50. Stop();
  51. int
  52. Write();
  53. };
  54. }
  55. #endif