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.

176 lines
6.8KB

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