MidiInOutEditor.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * MidiInOutEditor.h
  3. * -----------------
  4. * Purpose: Editor interface for the MidiInOut plugin.
  5. * Notes : (currently none)
  6. * Authors: Johannes Schultz (OpenMPT Devs)
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. #ifdef MODPLUG_TRACKER
  12. #include "../AbstractVstEditor.h"
  13. #include "../CDecimalSupport.h"
  14. OPENMPT_NAMESPACE_BEGIN
  15. class MidiInOut;
  16. class MidiInOutEditor : public CAbstractVstEditor
  17. {
  18. protected:
  19. CComboBox m_inputCombo, m_outputCombo;
  20. CNumberEdit m_latencyEdit;
  21. CSpinButtonCtrl m_latencySpin;
  22. bool m_locked = true;
  23. public:
  24. MidiInOutEditor(MidiInOut &plugin);
  25. // Refresh current input / output device in GUI
  26. void SetCurrentDevice(bool asInputDevice, MidiDevice::ID device)
  27. {
  28. CComboBox &combo = asInputDevice ? m_inputCombo : m_outputCombo;
  29. SetCurrentDevice(combo, device);
  30. }
  31. bool OpenEditor(CWnd *parent) override;
  32. bool IsResizable() const override { return false; }
  33. bool SetSize(int, int) override { return false; }
  34. protected:
  35. // Update lists of available input / output devices
  36. static void PopulateList(CComboBox &combo, RtMidi &rtDevice, MidiDevice &midiDevice, bool isInput);
  37. // Refresh current input / output device in GUI
  38. void SetCurrentDevice(CComboBox &combo, MidiDevice::ID device);
  39. void DoDataExchange(CDataExchange* pDX) override;
  40. afx_msg void OnInputChanged();
  41. afx_msg void OnOutputChanged();
  42. afx_msg void OnLatencyChanged();
  43. afx_msg void OnTimingMessagesChanged();
  44. DECLARE_MESSAGE_MAP()
  45. };
  46. OPENMPT_NAMESPACE_END
  47. #endif // MODPLUG_TRACKER