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.

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