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.

88 lines
2.1KB

  1. /*
  2. Copyright (C) 2009 Grame
  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 __JackWinMMEDriver__
  16. #define __JackWinMMEDriver__
  17. #include "JackMidiDriver.h"
  18. #include "JackTime.h"
  19. namespace Jack
  20. {
  21. /*!
  22. \brief The WinMME driver.
  23. */
  24. #define kBuffSize 512
  25. struct MidiSlot {
  26. LPVOID fHandle; // MMSystem handler
  27. short fIndex; // MMSystem dev index
  28. LPMIDIHDR fHeader; // for long msg output
  29. MidiSlot():fHandle(0),fIndex(0)
  30. {}
  31. };
  32. class JackWinMMEDriver : public JackMidiDriver
  33. {
  34. private:
  35. int fRealCaptureChannels;
  36. int fRealPlaybackChannels;
  37. MidiSlot* fMidiSource;
  38. MidiSlot* fMidiDestination;
  39. void CloseInput(MidiSlot* slot);
  40. void CloseOutput(MidiSlot* slot);
  41. static void CALLBACK MidiInProc(HMIDIIN hMidiIn, UINT wMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2);
  42. public:
  43. JackWinMMEDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table);
  44. virtual ~JackWinMMEDriver();
  45. int Open(bool capturing,
  46. bool playing,
  47. int chan_in,
  48. int chan_out,
  49. bool monitor,
  50. const char* capture_driver_name,
  51. const char* playback_driver_name,
  52. jack_nframes_t capture_latency,
  53. jack_nframes_t playback_latency);
  54. int Close();
  55. int Attach();
  56. int Read();
  57. int Write();
  58. };
  59. } // end of namespace
  60. #endif