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.

163 lines
4.5KB

  1. /*
  2. * Carla plugin database code
  3. * Copyright (C) 2011-2019 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. #ifndef CARLA_DATABASE_HPP_INCLUDED
  18. #define CARLA_DATABASE_HPP_INCLUDED
  19. //---------------------------------------------------------------------------------------------------------------------
  20. // Imports (Global)
  21. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  22. # pragma GCC diagnostic push
  23. # pragma GCC diagnostic ignored "-Wconversion"
  24. # pragma GCC diagnostic ignored "-Weffc++"
  25. # pragma GCC diagnostic ignored "-Wsign-conversion"
  26. #endif
  27. #include <QtCore/QThread>
  28. #include <QtWidgets/QDialog>
  29. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  30. # pragma GCC diagnostic pop
  31. #endif
  32. //---------------------------------------------------------------------------------------------------------------------
  33. // Imports (Custom)
  34. #include "CarlaJuceUtils.hpp"
  35. class CarlaHost;
  36. // --------------------------------------------------------------------------------------------------------------------
  37. // Separate Thread for Plugin Search
  38. class SearchPluginsThread : public QThread
  39. {
  40. Q_OBJECT
  41. signals:
  42. void pluginLook(float percent, QString plugin);
  43. public:
  44. SearchPluginsThread(QObject* parent, QString pathBinaries);
  45. ~SearchPluginsThread() override;
  46. private:
  47. struct PrivateData;
  48. PrivateData* const self;
  49. protected:
  50. void run() override;
  51. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SearchPluginsThread)
  52. };
  53. // --------------------------------------------------------------------------------------------------------------------
  54. // Plugin Refresh Dialog
  55. class PluginRefreshW : public QDialog
  56. {
  57. Q_OBJECT
  58. public:
  59. PluginRefreshW(QWidget* parent, const CarlaHost& host);
  60. ~PluginRefreshW() override;
  61. void getValues(QString& audioDevice, uint& bufferSize, double& sampleRate);
  62. private:
  63. struct PrivateData;
  64. PrivateData* const self;
  65. protected:
  66. void closeEvent(QCloseEvent* event) override;
  67. private slots:
  68. void slot_saveSettings();
  69. void slot_start();
  70. void slot_skip();
  71. void slot_checkTools();
  72. void slot_handlePluginLook(float percent, QString plugin);
  73. void slot_handlePluginThreadFinished();
  74. private:
  75. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginRefreshW)
  76. };
  77. // --------------------------------------------------------------------------------------------------------------------
  78. // Plugin Database Dialog
  79. class PluginDatabaseW : public QDialog
  80. {
  81. Q_OBJECT
  82. public:
  83. PluginDatabaseW(QWidget* parent, const CarlaHost& host, bool hasCanvas, bool hasCanvasGL);
  84. ~PluginDatabaseW() override;
  85. private:
  86. struct PrivateData;
  87. PrivateData* const self;
  88. protected:
  89. void showEvent(QShowEvent* event) override;
  90. private slots:
  91. void slot_cellClicked(int row, int column);
  92. void slot_cellDoubleClicked(int row, int column);
  93. void slot_addPlugin();
  94. void slot_checkPlugin(int row);
  95. void slot_checkFilters();
  96. void slot_refreshPlugins();
  97. void slot_clearFilters();
  98. void slot_saveSettings();
  99. private:
  100. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginDatabaseW)
  101. };
  102. // --------------------------------------------------------------------------------------------------------------------
  103. // Jack Application Dialog
  104. class JackApplicationW : public QDialog
  105. {
  106. Q_OBJECT
  107. public:
  108. JackApplicationW(QWidget* parent, const QString& projectFilename);
  109. ~JackApplicationW() override;
  110. void getCommandAndFlags(QString& command, QString& name, QString& labelSetup);
  111. private:
  112. struct PrivateData;
  113. PrivateData* const self;
  114. private slots:
  115. void slot_commandChanged(QString text);
  116. void slot_sessionManagerChanged(int index);
  117. void slot_saveSettings();
  118. private:
  119. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(JackApplicationW)
  120. };
  121. //---------------------------------------------------------------------------------------------------------------------
  122. #endif // CARLA_DATABASE_HPP_INCLUDED