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.

91 lines
2.3KB

  1. /*
  2. Copyright (C) 2011 Devin Anderson
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. */
  15. #ifndef __JackWinMMEOutputPort__
  16. #define __JackWinMMEOutputPort__
  17. #include "JackMidiAsyncQueue.h"
  18. #include "JackMidiBufferReadQueue.h"
  19. #include "JackThread.h"
  20. #include "JackWinMMEPort.h"
  21. namespace Jack {
  22. class JackWinMMEOutputPort :
  23. public JackWinMMEPort, public JackRunnableInterface {
  24. private:
  25. static void CALLBACK
  26. HandleMessageEvent(HMIDIOUT handle, UINT message, DWORD_PTR port,
  27. DWORD_PTR param1, DWORD_PTR param2);
  28. void
  29. GetOutErrorString(MMRESULT error, LPTSTR text);
  30. void
  31. HandleMessage(UINT message, DWORD_PTR param1, DWORD_PTR param2);
  32. bool
  33. Signal(HANDLE semaphore);
  34. bool
  35. Wait(HANDLE semaphore);
  36. void
  37. WriteOutError(const char *jack_func, const char *mm_func,
  38. MMRESULT result);
  39. HMIDIOUT handle;
  40. JackMidiBufferReadQueue *read_queue;
  41. HANDLE sysex_semaphore;
  42. JackThread *thread;
  43. JackMidiAsyncQueue *thread_queue;
  44. HANDLE thread_queue_semaphore;
  45. HANDLE timer;
  46. public:
  47. JackWinMMEOutputPort(const char *alias_name, const char *client_name,
  48. const char *driver_name, UINT index,
  49. size_t max_bytes=4096, size_t max_messages=1024);
  50. ~JackWinMMEOutputPort();
  51. bool
  52. Execute();
  53. bool
  54. Init();
  55. void
  56. ProcessJack(JackMidiBuffer *port_buffer, jack_nframes_t frames);
  57. bool
  58. Start();
  59. bool
  60. Stop();
  61. };
  62. }
  63. #endif