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.

84 lines
3.1KB

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