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.

102 lines
3.0KB

  1. // SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "CarlaFrontend.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 <QtWidgets/QDialog>
  15. #include "ui_pluginlistdialog.h"
  16. #ifdef __clang__
  17. # pragma clang diagnostic pop
  18. #elif defined(__GNUC__) && __GNUC__ >= 8
  19. # pragma GCC diagnostic pop
  20. #endif
  21. class QSafeSettings;
  22. typedef struct _CarlaPluginDiscoveryInfo CarlaPluginDiscoveryInfo;
  23. typedef struct _HostSettings HostSettings;
  24. struct PluginInfo;
  25. // --------------------------------------------------------------------------------------------------------------------
  26. // Plugin List Dialog
  27. class PluginListDialog : public QDialog
  28. {
  29. enum TableIndex {
  30. TW_FAVORITE,
  31. TW_NAME,
  32. TW_LABEL,
  33. TW_MAKER,
  34. TW_BINARY,
  35. };
  36. enum UserRoles {
  37. UR_PLUGIN_INFO = 1,
  38. UR_SEARCH_TEXT,
  39. };
  40. struct PrivateData;
  41. PrivateData *const p;
  42. Ui_PluginListDialog ui;
  43. // ----------------------------------------------------------------------------------------------------------------
  44. // public methods
  45. public:
  46. explicit PluginListDialog(QWidget* parent, const HostSettings* hostSettings);
  47. ~PluginListDialog() override;
  48. const PluginInfo& getSelectedPluginInfo() const;
  49. void addPluginInfo(const CarlaPluginDiscoveryInfo* info, const char* sha1sum);
  50. bool checkPluginCache(const char* filename, const char* sha1sum);
  51. void setPluginPath(PluginType ptype, const char* path);
  52. // ----------------------------------------------------------------------------------------------------------------
  53. // protected methods
  54. protected:
  55. void done(int) override;
  56. void showEvent(QShowEvent*) override;
  57. void timerEvent(QTimerEvent*) override;
  58. // ----------------------------------------------------------------------------------------------------------------
  59. // private methods
  60. private:
  61. void addPluginsToTable();
  62. void loadSettings();
  63. // ----------------------------------------------------------------------------------------------------------------
  64. // private slots
  65. private Q_SLOTS:
  66. void cellClicked(int row, int column);
  67. void cellDoubleClicked(int row, int column);
  68. void focusSearchFieldAndSelectAll();
  69. void checkFilters();
  70. void checkFiltersCategoryAll(bool clicked);
  71. void checkFiltersCategorySpecific(bool clicked);
  72. void clearFilters();
  73. void checkPlugin(int row);
  74. void refreshPlugins();
  75. void refreshPluginsStart();
  76. void refreshPluginsStop();
  77. void refreshPluginsSkip();
  78. void saveSettings();
  79. };
  80. // --------------------------------------------------------------------------------------------------------------------