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.

75 lines
2.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #pragma once
  18. //==============================================================================
  19. /**
  20. Opens a Bluetooth MIDI pairing dialogue that allows the user to view and
  21. connect to Bluetooth MIDI devices that are currently found nearby.
  22. The dialogue will ignore non-MIDI Bluetooth devices.
  23. Only after a Bluetooth MIDI device has been paired will its MIDI ports
  24. be available through JUCE's MidiInput and MidiOutput classes.
  25. This dialogue is currently only available on iOS and Android. On OSX,
  26. you should instead pair Bluetooth MIDI devices using the "Audio MIDI Setup"
  27. app (located in /Applications/Utilities). On Windows, you should use
  28. the system settings. On Linux, Bluetooth MIDI devices are currently not
  29. supported.
  30. */
  31. class JUCE_API BluetoothMidiDevicePairingDialogue
  32. {
  33. public:
  34. /** Opens the Bluetooth MIDI pairing dialogue, if it is available.
  35. @param exitCallback A callback which will be called when the modal
  36. bluetooth dialog is closed.
  37. @return true if the dialogue was opened, false on error.
  38. @see ModalComponentManager::Callback
  39. */
  40. static bool open (ModalComponentManager::Callback* exitCallback = nullptr);
  41. /** Checks if a Bluetooth MIDI pairing dialogue is available on this
  42. platform.
  43. On iOS, this will be true for iOS versions 8.0 and higher.
  44. On Android, this will be true only for Android SDK versions 23 and
  45. higher, and additionally only if the device itself supports MIDI
  46. over Bluetooth.
  47. On desktop platforms, this will typically be false as the bluetooth
  48. pairing is not done inside the app but by other means.
  49. @return true if the Bluetooth MIDI pairing dialogue is available,
  50. false otherwise.
  51. */
  52. static bool isAvailable();
  53. };