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.

137 lines
4.2KB

  1. // SPDX-FileCopyrightText: 2011-2025 Filipe Coelho <falktx@falktx.com>
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "carla_frontend.h"
  4. // -------------------------------------------------------------------------------------------------------------------
  5. // common files
  6. #include "utils/qsafesettings.cpp"
  7. // --------------------------------------------------------------------------------------------------------------------
  8. // aboutdialog
  9. #include "dialogs/aboutdialog.hpp"
  10. void carla_frontend_createAndExecAboutDialog(QWidget* const parent,
  11. const CarlaHostHandle hostHandle,
  12. const bool isControl,
  13. const bool isPlugin)
  14. {
  15. AboutDialog(parent, hostHandle, isControl, isPlugin).exec();
  16. }
  17. // --------------------------------------------------------------------------------------------------------------------
  18. // jackappdialog
  19. #include "dialogs/jackappdialog.hpp"
  20. #include "distrho/extra/String.hpp"
  21. const JackAppDialogResults*
  22. carla_frontend_createAndExecJackAppDialog(QWidget* const parent, const char* const projectFilename)
  23. {
  24. JackAppDialog gui(parent, projectFilename);
  25. if (gui.exec())
  26. {
  27. static JackAppDialogResults ret = {};
  28. static String retCommand;
  29. static String retName;
  30. static String retLabelSetup;
  31. const JackAppDialog::CommandAndFlags cafs = gui.getCommandAndFlags();
  32. retCommand = cafs.command.toUtf8().constData();
  33. retName = cafs.name.toUtf8().constData();
  34. retLabelSetup = cafs.labelSetup.toUtf8().constData();
  35. ret.command = retCommand;
  36. ret.name = retName;
  37. ret.labelSetup = retLabelSetup;
  38. return &ret;
  39. }
  40. return nullptr;
  41. }
  42. // --------------------------------------------------------------------------------------------------------------------
  43. // pluginlistdialog
  44. #include "pluginlist/pluginlistdialog.hpp"
  45. #include "CarlaUtils.h"
  46. PluginListDialog*
  47. carla_frontend_createPluginListDialog(QWidget* const parent, const HostSettings* const hostSettings)
  48. {
  49. return new PluginListDialog(parent, hostSettings);
  50. }
  51. void
  52. carla_frontend_destroyPluginListDialog(PluginListDialog* const dialog)
  53. {
  54. dialog->close();
  55. delete dialog;
  56. }
  57. void
  58. carla_frontend_setPluginListDialogPath(PluginListDialog* const dialog, const int ptype, const char* const path)
  59. {
  60. dialog->setPluginPath(static_cast<PluginType>(ptype), path);
  61. }
  62. const PluginListDialogResults*
  63. carla_frontend_execPluginListDialog(PluginListDialog* const dialog)
  64. {
  65. if (dialog->exec())
  66. {
  67. static PluginListDialogResults ret;
  68. static String category;
  69. static String filename;
  70. static String name;
  71. static String label;
  72. static String maker;
  73. const PluginInfo& plugin(dialog->getSelectedPluginInfo());
  74. category = plugin.category.toUtf8();
  75. filename = plugin.filename.toUtf8();
  76. name = plugin.name.toUtf8();
  77. label = plugin.label.toUtf8();
  78. maker = plugin.maker.toUtf8();
  79. ret.build = plugin.build;
  80. ret.type = plugin.type;
  81. ret.hints = plugin.hints;
  82. ret.category = category;
  83. ret.filename = filename;
  84. ret.name = name;
  85. ret.label = label;
  86. ret.maker = maker;
  87. ret.uniqueId = plugin.uniqueId;
  88. ret.audioIns = plugin.audioIns;
  89. ret.audioOuts = plugin.audioOuts;
  90. ret.cvIns = plugin.cvIns;
  91. ret.cvOuts = plugin.cvOuts;
  92. ret.midiIns = plugin.midiIns;
  93. ret.midiOuts = plugin.midiOuts;
  94. ret.parameterIns = plugin.parameterIns;
  95. ret.parameterOuts = plugin.parameterOuts;
  96. return &ret;
  97. }
  98. return nullptr;
  99. }
  100. // --------------------------------------------------------------------------------------------------------------------
  101. // const PluginListDialogResults*
  102. // carla_frontend_createAndExecPluginListDialog(void* const parent, const HostSettings* const hostSettings)
  103. // {
  104. // PluginListDialog gui(reinterpret_cast<QWidget*>(parent), hostSettings);
  105. //
  106. // return carla_frontend_execPluginListDialog(&gui);
  107. // }
  108. // --------------------------------------------------------------------------------------------------------------------