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.

79 lines
2.9KB

  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. #ifndef JUCE_BLUETOOTHMIDIDEVICPAIRINGCOMPONENT_H_INCLUDED
  18. #define JUCE_BLUETOOTHMIDIDEVICPAIRINGCOMPONENT_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. Opens a Bluetooth MIDI pairing dialogue that allows the user to view and
  22. connect to Bluetooth MIDI devices that are currently found nearby.
  23. The dialogue will ignore non-MIDI Bluetooth devices.
  24. Only after a Bluetooth MIDI device has been paired will its MIDI ports
  25. be available through JUCE's MidiInput and MidiOutput classes.
  26. This dialogue is currently only available on iOS and Android. On OSX,
  27. you should instead pair Bluetooth MIDI devices using the "Audio MIDI Setup"
  28. app (located in /Applications/Utilities). On Windows, you should use
  29. the system settings. On Linux, Bluetooth MIDI devices are currently not
  30. supported.
  31. */
  32. class JUCE_API BluetoothMidiDevicePairingDialogue
  33. {
  34. public:
  35. /** Opens the Bluetooth MIDI pairing dialogue, if it is available.
  36. @param exitCallback A callback which will be called when the modal
  37. bluetooth dialog is closed.
  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. /** Checks if a Bluetooth MIDI pairing dialogue is available on this
  43. platform.
  44. On iOS, this will be true for iOS versions 8.0 and higher.
  45. On Android, this will be true only for Android SDK versions 23 and
  46. higher, and additionally only if the device itself supports MIDI
  47. over Bluetooth.
  48. On desktop platforms, this will typically be false as the bluetooth
  49. pairing is not done inside the app but by other means.
  50. @return true if the Bluetooth MIDI pairing dialogue is available,
  51. false otherwise.
  52. */
  53. static bool isAvailable();
  54. };
  55. #endif // JUCE_BLUETOOTHMIDIDEVICPAIRINGCOMPONENT_H_INCLUDED