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.

126 lines
3.6KB

  1. // SPDX-FileCopyrightText: 2011-2025 Filipe Coelho <falktx@falktx.com>
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "carla_frontend.h"
  5. #ifdef __clang__
  6. # pragma clang diagnostic push
  7. # pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy"
  8. # pragma clang diagnostic ignored "-Wdeprecated-register"
  9. #elif defined(__GNUC__) && __GNUC__ >= 8
  10. # pragma GCC diagnostic push
  11. # pragma GCC diagnostic ignored "-Wclass-memaccess"
  12. # pragma GCC diagnostic ignored "-Wdeprecated-copy"
  13. #endif
  14. #include "ui_pluginlistdialog.h"
  15. #ifdef __clang__
  16. # pragma clang diagnostic pop
  17. #elif defined(__GNUC__) && __GNUC__ >= 8
  18. # pragma GCC diagnostic pop
  19. #endif
  20. typedef struct _CarlaPluginDiscoveryInfo CarlaPluginDiscoveryInfo;
  21. typedef struct _HostSettings HostSettings;
  22. // --------------------------------------------------------------------------------------------------------------------
  23. // base details, nicely packed and POD-only so we can directly use as binary
  24. struct PluginInfoHeader {
  25. uint16_t build;
  26. uint16_t type;
  27. uint32_t hints;
  28. uint64_t uniqueId;
  29. uint16_t audioIns;
  30. uint16_t audioOuts;
  31. uint16_t cvIns;
  32. uint16_t cvOuts;
  33. uint16_t midiIns;
  34. uint16_t midiOuts;
  35. uint16_t parameterIns;
  36. uint16_t parameterOuts;
  37. };
  38. // full details, now with non-POD types
  39. struct PluginInfo : PluginInfoHeader {
  40. QString category;
  41. QString filename;
  42. QString name;
  43. QString label;
  44. QString maker;
  45. };
  46. // --------------------------------------------------------------------------------------------------------------------
  47. // Plugin List Dialog
  48. class PluginListDialog : public QDialog
  49. {
  50. enum TableIndex {
  51. TW_FAVORITE,
  52. TW_NAME,
  53. TW_LABEL,
  54. TW_MAKER,
  55. TW_BINARY,
  56. };
  57. enum UserRoles {
  58. UR_PLUGIN_INFO = 1,
  59. UR_SEARCH_TEXT,
  60. };
  61. struct PrivateData;
  62. PrivateData *const p;
  63. Ui_PluginListDialog ui;
  64. // ----------------------------------------------------------------------------------------------------------------
  65. // public methods
  66. public:
  67. explicit PluginListDialog(QWidget* parent, const HostSettings* hostSettings);
  68. ~PluginListDialog() override;
  69. const PluginInfo& getSelectedPluginInfo() const;
  70. void addPluginInfo(const CarlaPluginDiscoveryInfo* info, const char* sha1sum);
  71. bool checkPluginCache(const char* filename, const char* sha1sum);
  72. void setPluginPath(PluginType ptype, const char* path);
  73. // ----------------------------------------------------------------------------------------------------------------
  74. // protected methods
  75. protected:
  76. void done(int) override;
  77. void showEvent(QShowEvent*) override;
  78. void timerEvent(QTimerEvent*) override;
  79. // ----------------------------------------------------------------------------------------------------------------
  80. // private methods
  81. private:
  82. void addPluginsToTable();
  83. void loadSettings();
  84. // ----------------------------------------------------------------------------------------------------------------
  85. // private slots
  86. private Q_SLOTS:
  87. void cellClicked(int row, int column);
  88. void cellDoubleClicked(int row, int column);
  89. void focusSearchFieldAndSelectAll();
  90. void checkFilters();
  91. void checkFiltersCategoryAll(bool clicked);
  92. void checkFiltersCategorySpecific(bool clicked);
  93. void clearFilters();
  94. void checkPlugin(int row);
  95. void refreshPlugins();
  96. void refreshPluginsStart();
  97. void refreshPluginsStop();
  98. void refreshPluginsSkip();
  99. void saveSettings();
  100. };
  101. // --------------------------------------------------------------------------------------------------------------------