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.

carla_shared.hpp 6.9KB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * Common Carla code
  3. * Copyright (C) 2011-2014 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 FRONTEND_CARLA_SHARED_HPP_INCLUDED
  18. #define FRONTEND_CARLA_SHARED_HPP_INCLUDED
  19. // ------------------------------------------------------------------------------------------------------------
  20. // Imports (Global)
  21. #include <QtGui/QIcon>
  22. #include <QtWidgets/QMessageBox>
  23. class QLineEdit;
  24. // ------------------------------------------------------------------------------------------------------------
  25. // Imports (Custom)
  26. #include "CarlaBackendUtils.hpp"
  27. // ------------------------------------------------------------------------------------------------------------
  28. // Set Version
  29. #define VERSION "1.9.4 (2.0-beta2)"
  30. // ------------------------------------------------------------------------------------------------------------
  31. // Set TMP
  32. extern QString TMP;
  33. // ------------------------------------------------------------------------------------------------------------
  34. // Set HOME
  35. extern QString HOME;
  36. // ------------------------------------------------------------------------------------------------------------
  37. // Set PATH
  38. extern QStringList PATH;
  39. // ------------------------------------------------------------------------------------------------------------
  40. // Static MIDI CC list
  41. extern QStringList MIDI_CC_LIST;
  42. // ------------------------------------------------------------------------------------------------------------
  43. // Carla Settings keys
  44. #define CARLA_KEY_MAIN_PROJECT_FOLDER "Main/ProjectFolder" // str
  45. #define CARLA_KEY_MAIN_USE_PRO_THEME "Main/UseProTheme" // bool
  46. #define CARLA_KEY_MAIN_PRO_THEME_COLOR "Main/ProThemeColor" // str
  47. #define CARLA_KEY_MAIN_REFRESH_INTERVAL "Main/RefreshInterval" // int
  48. #define CARLA_KEY_CANVAS_THEME "Canvas/Theme" // str
  49. #define CARLA_KEY_CANVAS_SIZE "Canvas/Size" // str "NxN"
  50. #define CARLA_KEY_CANVAS_USE_BEZIER_LINES "Canvas/UseBezierLines" // bool
  51. #define CARLA_KEY_CANVAS_AUTO_HIDE_GROUPS "Canvas/AutoHideGroups" // bool
  52. #define CARLA_KEY_CANVAS_EYE_CANDY "Canvas/EyeCandy" // enum
  53. #define CARLA_KEY_CANVAS_USE_OPENGL "Canvas/UseOpenGL" // bool
  54. #define CARLA_KEY_CANVAS_ANTIALIASING "Canvas/Antialiasing" // enum
  55. #define CARLA_KEY_CANVAS_HQ_ANTIALIASING "Canvas/HQAntialiasing" // bool
  56. #define CARLA_KEY_CUSTOM_PAINTING "UseCustomPainting" // bool
  57. #define CARLA_KEY_ENGINE_DRIVER_PREFIX "Engine/Driver-"
  58. #define CARLA_KEY_ENGINE_AUDIO_DRIVER "Engine/AudioDriver" // str
  59. #define CARLA_KEY_ENGINE_PROCESS_MODE "Engine/ProcessMode" // enum
  60. #define CARLA_KEY_ENGINE_TRANSPORT_MODE "Engine/TransportMode" // enum
  61. #define CARLA_KEY_ENGINE_FORCE_STEREO "Engine/ForceStereo" // bool
  62. #define CARLA_KEY_ENGINE_PREFER_PLUGIN_BRIDGES "Engine/PreferPluginBridges" // bool
  63. #define CARLA_KEY_ENGINE_PREFER_UI_BRIDGES "Engine/PreferUiBridges" // bool
  64. #define CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP "Engine/UIsAlwaysOnTop" // bool
  65. #define CARLA_KEY_ENGINE_MAX_PARAMETERS "Engine/MaxParameters" // int
  66. #define CARLA_KEY_ENGINE_UI_BRIDGES_TIMEOUT "Engine/UiBridgesTimeout" // int
  67. #define CARLA_KEY_PATHS_LADSPA "Paths/LADSPA"
  68. #define CARLA_KEY_PATHS_DSSI "Paths/DSSI"
  69. #define CARLA_KEY_PATHS_LV2 "Paths/LV2"
  70. #define CARLA_KEY_PATHS_VST "Paths/VST"
  71. #define CARLA_KEY_PATHS_VST3 "Paths/VST3"
  72. #define CARLA_KEY_PATHS_AU "Paths/AU"
  73. #define CARLA_KEY_PATHS_GIG "Paths/GIG"
  74. #define CARLA_KEY_PATHS_SF2 "Paths/SF2"
  75. #define CARLA_KEY_PATHS_SFZ "Paths/SFZ"
  76. // ------------------------------------------------------------------------------------------------------------
  77. // Global Carla object
  78. struct CarlaObject {
  79. // Host library object
  80. void* host;
  81. // Host Window
  82. void* gui;
  83. // is controller
  84. bool isControl;
  85. // is running local
  86. bool isLocal;
  87. // is plugin
  88. bool isPlugin;
  89. // current buffer size
  90. uint32_t bufferSize;
  91. // current sample rate
  92. double sampleRate;
  93. // current process mode
  94. EngineProcessMode processMode;
  95. // check if process mode is forced (rack/patchbay)
  96. bool processModeForced;
  97. // current transport mode
  98. EngineTransportMode transportMode;
  99. // current max parameters
  100. uint maxParameters;
  101. // binary dir
  102. QString pathBinaries;
  103. // resources dir
  104. QString pathResources;
  105. // default paths
  106. QStringList DEFAULT_LADSPA_PATH;
  107. QStringList DEFAULT_DSSI_PATH;
  108. QStringList DEFAULT_LV2_PATH;
  109. QStringList DEFAULT_VST_PATH;
  110. QStringList DEFAULT_VST3_PATH;
  111. QStringList DEFAULT_AU_PATH;
  112. QStringList DEFAULT_GIG_PATH;
  113. QStringList DEFAULT_SF2_PATH;
  114. QStringList DEFAULT_SFZ_PATH;
  115. };
  116. extern CarlaObject gCarla;
  117. // ------------------------------------------------------------------------------------------------------------
  118. // find tool
  119. QString findTool(const QString& toolName);
  120. // ------------------------------------------------------------------------------------------------------------
  121. // Init host
  122. void initHost(const char* const initName, const char* const libPrefix = nullptr, bool failError = true);
  123. // ------------------------------------------------------------------------------------------------------------
  124. // Get Icon from user theme, using our own as backup (Oxygen)
  125. QIcon getIcon(const QString& icon, const int size = 16);
  126. // ------------------------------------------------------------------------------------------------------------
  127. // Signal handler
  128. void setUpSignals();
  129. // ------------------------------------------------------------------------------------------------------------
  130. // QLineEdit and QPushButton combo
  131. QString getAndSetPath(QWidget* const parent, const QString& currentPath, QLineEdit* const lineEdit);
  132. // ------------------------------------------------------------------------------------------------------------
  133. // Custom MessageBox
  134. int CustomMessageBox(QWidget* const parent, const QMessageBox::Icon icon, const QString& title, const QString& text, const QString& extraText = "",
  135. const QMessageBox::StandardButtons buttons = QMessageBox::Yes|QMessageBox::No,
  136. const QMessageBox::StandardButton defButton = QMessageBox::No);
  137. // ------------------------------------------------------------------------------------------------------------
  138. #endif // FRONTEND_CARLA_SHARED_HPP_INCLUDED