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.

145 lines
4.0KB

  1. /*
  2. * Carla plugin host
  3. * Copyright (C) 2011-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. #pragma once
  18. #ifdef __clang__
  19. # pragma clang diagnostic push
  20. # pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy"
  21. # pragma clang diagnostic ignored "-Wdeprecated-register"
  22. #elif defined(__GNUC__) && __GNUC__ >= 8
  23. # pragma GCC diagnostic push
  24. # pragma GCC diagnostic ignored "-Wclass-memaccess"
  25. # pragma GCC diagnostic ignored "-Wdeprecated-copy"
  26. #endif
  27. #include <QtWidgets/QDialog>
  28. #ifdef __clang__
  29. # pragma clang diagnostic pop
  30. #elif defined(__GNUC__) && __GNUC__ >= 8
  31. # pragma GCC diagnostic pop
  32. #endif
  33. #include "CarlaDefines.h"
  34. static constexpr const uint PLUGIN_QUERY_API_VERSION = 12;
  35. struct HostSettings {
  36. bool showPluginBridges;
  37. bool showWineBridges;
  38. bool useSystemIcons;
  39. };
  40. struct PluginInfo {
  41. uint API;
  42. uint build;
  43. uint type;
  44. uint hints;
  45. QString category;
  46. QString filename;
  47. QString name;
  48. QString label;
  49. QString maker;
  50. uint64_t uniqueId;
  51. uint audioIns;
  52. uint audioOuts;
  53. uint cvIns;
  54. uint cvOuts;
  55. uint midiIns;
  56. uint midiOuts;
  57. uint parametersIns;
  58. uint parametersOuts;
  59. };
  60. // --------------------------------------------------------------------------------------------------------------------
  61. // Jack Application Dialog
  62. class PluginListDialog : public QDialog
  63. {
  64. struct Self;
  65. Self& self;
  66. // ----------------------------------------------------------------------------------------------------------------
  67. public:
  68. explicit PluginListDialog(QWidget* parent, const HostSettings& hostSettings);
  69. ~PluginListDialog() override;
  70. // ----------------------------------------------------------------------------------------------------------------
  71. // public methods
  72. // ----------------------------------------------------------------------------------------------------------------
  73. // protected methods
  74. protected:
  75. void showEvent(QShowEvent*) override;
  76. // ----------------------------------------------------------------------------------------------------------------
  77. // private methods
  78. void loadSettings();
  79. // ----------------------------------------------------------------------------------------------------------------
  80. // private slots
  81. private slots:
  82. void slot_cellClicked(int row, int column);
  83. void slot_cellDoubleClicked(int row, int column);
  84. void slot_focusSearchFieldAndSelectAll();
  85. void slot_addPlugin();
  86. void slot_checkPlugin(int row);
  87. void slot_checkFilters();
  88. void slot_checkFiltersCategoryAll(bool clicked);
  89. void slot_checkFiltersCategorySpecific(bool clicked);
  90. void slot_refreshPlugins();
  91. void slot_clearFilters();
  92. void slot_saveSettings();
  93. };
  94. // --------------------------------------------------------------------------------------------------------------------
  95. extern "C" {
  96. struct PluginListDialogResults {
  97. uint API;
  98. uint build;
  99. uint type;
  100. uint hints;
  101. const char* category;
  102. const char* filename;
  103. const char* name;
  104. const char* label;
  105. const char* maker;
  106. uint64_t uniqueId;
  107. uint audioIns;
  108. uint audioOuts;
  109. uint cvIns;
  110. uint cvOuts;
  111. uint midiIns;
  112. uint midiOuts;
  113. uint parametersIns;
  114. uint parametersOuts;
  115. };
  116. CARLA_API
  117. PluginListDialogResults* carla_frontend_createAndExecPluginListDialog(void* parent/*, const HostSettings& hostSettings*/);
  118. }
  119. // --------------------------------------------------------------------------------------------------------------------