Audio plugin host https://kx.studio/carla
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.

88 lines
2.1KB

  1. /*
  2. * Carla macOS utils
  3. * Copyright (C) 2018-2022 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifndef CARLA_MAC_UTILS_HPP_INCLUDED
  18. #define CARLA_MAC_UTILS_HPP_INCLUDED
  19. #ifndef CARLA_OS_MAC
  20. # error wrong include
  21. #endif
  22. #ifdef __MAC_10_12
  23. # define Component CocoaComponent
  24. # define MemoryBlock CocoaMemoryBlock
  25. # define Point CocoaPoint
  26. #endif
  27. #import <Foundation/Foundation.h>
  28. #undef Component
  29. #undef MemoryBlock
  30. #undef Point
  31. #include "CarlaBackend.h"
  32. CARLA_BACKEND_START_NAMESPACE
  33. // --------------------------------------------------------------------------------------------------------------------
  34. /*
  35. * ...
  36. */
  37. void initStandaloneApplication();
  38. /*
  39. * ...
  40. */
  41. const char* findBinaryInBundle(const char* const bundleDir);
  42. /*
  43. * ...
  44. */
  45. bool removeFileFromQuarantine(const char* const filename);
  46. // --------------------------------------------------------------------------------------------------------------------
  47. /*
  48. * ...
  49. */
  50. class AutoNSAutoreleasePool {
  51. public:
  52. AutoNSAutoreleasePool();
  53. ~AutoNSAutoreleasePool();
  54. private:
  55. void* const pool;
  56. };
  57. // --------------------------------------------------------------------------------------------------------------------
  58. struct BundleLoader {
  59. CFBundleRef ref;
  60. CFBundleRefNum refNum;
  61. BundleLoader() noexcept;
  62. ~BundleLoader();
  63. bool load(const char* const filename);
  64. };
  65. // --------------------------------------------------------------------------------------------------------------------
  66. CARLA_BACKEND_END_NAMESPACE
  67. #endif // CARLA_MAC_UTILS_HPP_INCLUDED