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.

95 lines
2.5KB

  1. /*
  2. Copyright (C) 2009 Grame
  3. Copyright (C) 2011 Devin Anderson
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16. #ifndef __JackCoreMidiDriver__
  17. #define __JackCoreMidiDriver__
  18. #include "JackCoreMidiPhysicalInputPort.h"
  19. #include "JackCoreMidiPhysicalOutputPort.h"
  20. #include "JackCoreMidiVirtualInputPort.h"
  21. #include "JackCoreMidiVirtualOutputPort.h"
  22. #include "JackMidiDriver.h"
  23. namespace Jack {
  24. class JackCoreMidiDriver: public JackMidiDriver {
  25. private:
  26. static void
  27. HandleInputEvent(const MIDIPacketList *packet_list, void *driver,
  28. void *port);
  29. static void
  30. HandleNotificationEvent(const MIDINotification *message, void *driver);
  31. void
  32. HandleNotification(const MIDINotification *message);
  33. MIDIClientRef client;
  34. MIDIPortRef internal_input;
  35. MIDIPortRef internal_output;
  36. int num_physical_inputs;
  37. int num_physical_outputs;
  38. int num_virtual_inputs;
  39. int num_virtual_outputs;
  40. JackCoreMidiPhysicalInputPort **physical_input_ports;
  41. JackCoreMidiPhysicalOutputPort **physical_output_ports;
  42. double time_ratio;
  43. JackCoreMidiVirtualInputPort **virtual_input_ports;
  44. JackCoreMidiVirtualOutputPort **virtual_output_ports;
  45. public:
  46. JackCoreMidiDriver(const char* name, const char* alias,
  47. JackLockedEngine* engine, JackSynchro* table);
  48. ~JackCoreMidiDriver();
  49. int
  50. Attach();
  51. int
  52. Close();
  53. int
  54. Open(bool capturing, bool playing, int num_inputs, int num_outputs,
  55. bool monitor, const char* capture_driver_name,
  56. const char* playback_driver_name, jack_nframes_t capture_latency,
  57. jack_nframes_t playback_latency);
  58. int
  59. Read();
  60. int
  61. Start();
  62. int
  63. Stop();
  64. int
  65. Write();
  66. };
  67. }
  68. #endif