The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

77 lines
2.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. Opens a Bluetooth MIDI pairing dialogue that allows the user to view and
  18. connect to Bluetooth MIDI devices that are currently found nearby.
  19. The dialogue will ignore non-MIDI Bluetooth devices.
  20. Only after a Bluetooth MIDI device has been paired will its MIDI ports
  21. be available through JUCE's MidiInput and MidiOutput classes.
  22. This dialogue is currently only available on macOS targetting versions 10.11+,
  23. iOS and Android. When targeting older versions of macOS you should instead
  24. pair Bluetooth MIDI devices using the "Audio MIDI Setup" app (located in
  25. /Applications/Utilities). On Windows, you should use the system settings. On
  26. Linux, Bluetooth MIDI devices are currently not supported.
  27. @tags{Audio}
  28. */
  29. class JUCE_API BluetoothMidiDevicePairingDialogue
  30. {
  31. public:
  32. /** Opens the Bluetooth MIDI pairing dialogue, if it is available.
  33. @param exitCallback A callback which will be called when the modal
  34. bluetooth dialog is closed.
  35. @param btWindowBounds The bounds of the bluetooth window that will
  36. be opened. The dialog itself is opened by the OS so cannot
  37. be customised by JUCE.
  38. @return true if the dialogue was opened, false on error.
  39. @see ModalComponentManager::Callback
  40. */
  41. static bool open (ModalComponentManager::Callback* exitCallback = nullptr,
  42. Rectangle<int>* btWindowBounds = nullptr);
  43. /** Checks if a Bluetooth MIDI pairing dialogue is available on this
  44. platform.
  45. On iOS, this will be true for iOS versions 8.0 and higher.
  46. On Android, this will be true only for Android SDK versions 23 and
  47. higher, and additionally only if the device itself supports MIDI
  48. over Bluetooth.
  49. On desktop platforms, this will typically be false as the bluetooth
  50. pairing is not done inside the app but by other means.
  51. @return true if the Bluetooth MIDI pairing dialogue is available,
  52. false otherwise.
  53. */
  54. static bool isAvailable();
  55. };
  56. } // namespace juce