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.

106 lines
3.0KB

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