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.

carla_backend_qt.py 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #!/usr/bin/env python3
  2. # SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
  3. # SPDX-License-Identifier: GPL-2.0-or-later
  4. # ------------------------------------------------------------------------------------------------------------
  5. # Imports (Global)
  6. from qt_compat import qt_config
  7. if qt_config == 5:
  8. from PyQt5.QtCore import pyqtSignal, QObject
  9. elif qt_config == 6:
  10. from PyQt6.QtCore import pyqtSignal, QObject
  11. # ------------------------------------------------------------------------------------------------------------
  12. # Imports (Custom)
  13. from carla_backend import CarlaHostNull, CarlaHostDLL, CarlaHostPlugin
  14. # ------------------------------------------------------------------------------------------------------------
  15. # Carla Host PyQt signals
  16. class CarlaHostSignals(QObject):
  17. # signals
  18. DebugCallback = pyqtSignal(int, int, int, int, float, str)
  19. PluginAddedCallback = pyqtSignal(int, int, str)
  20. PluginRemovedCallback = pyqtSignal(int)
  21. PluginRenamedCallback = pyqtSignal(int, str)
  22. PluginUnavailableCallback = pyqtSignal(int, str)
  23. ParameterValueChangedCallback = pyqtSignal(int, int, float)
  24. ParameterDefaultChangedCallback = pyqtSignal(int, int, float)
  25. ParameterMappedControlIndexChangedCallback = pyqtSignal(int, int, int)
  26. ParameterMappedRangeChangedCallback = pyqtSignal(int, int, float, float)
  27. ParameterMidiChannelChangedCallback = pyqtSignal(int, int, int)
  28. ProgramChangedCallback = pyqtSignal(int, int)
  29. MidiProgramChangedCallback = pyqtSignal(int, int)
  30. OptionChangedCallback = pyqtSignal(int, int, bool)
  31. UiStateChangedCallback = pyqtSignal(int, int)
  32. NoteOnCallback = pyqtSignal(int, int, int, int)
  33. NoteOffCallback = pyqtSignal(int, int, int)
  34. UpdateCallback = pyqtSignal(int)
  35. ReloadInfoCallback = pyqtSignal(int)
  36. ReloadParametersCallback = pyqtSignal(int)
  37. ReloadProgramsCallback = pyqtSignal(int)
  38. ReloadAllCallback = pyqtSignal(int)
  39. PatchbayClientAddedCallback = pyqtSignal(int, int, int, str)
  40. PatchbayClientRemovedCallback = pyqtSignal(int)
  41. PatchbayClientRenamedCallback = pyqtSignal(int, str)
  42. PatchbayClientDataChangedCallback = pyqtSignal(int, int, int)
  43. PatchbayClientPositionChangedCallback = pyqtSignal(int, int, int, int, int)
  44. PatchbayPortAddedCallback = pyqtSignal(int, int, int, int, str)
  45. PatchbayPortRemovedCallback = pyqtSignal(int, int)
  46. PatchbayPortChangedCallback = pyqtSignal(int, int, int, int, str)
  47. PatchbayPortGroupAddedCallback = pyqtSignal(int, int, int, str)
  48. PatchbayPortGroupRemovedCallback = pyqtSignal(int, int)
  49. PatchbayPortGroupChangedCallback = pyqtSignal(int, int, int, str)
  50. PatchbayConnectionAddedCallback = pyqtSignal(int, int, int, int, int)
  51. PatchbayConnectionRemovedCallback = pyqtSignal(int, int, int)
  52. EngineStartedCallback = pyqtSignal(int, int, int, int, float, str)
  53. EngineStoppedCallback = pyqtSignal()
  54. ProcessModeChangedCallback = pyqtSignal(int)
  55. TransportModeChangedCallback = pyqtSignal(int, str)
  56. BufferSizeChangedCallback = pyqtSignal(int)
  57. SampleRateChangedCallback = pyqtSignal(float)
  58. CancelableActionCallback = pyqtSignal(int, bool, str)
  59. ProjectLoadFinishedCallback = pyqtSignal()
  60. NSMCallback = pyqtSignal(int, int, str)
  61. InfoCallback = pyqtSignal(str)
  62. ErrorCallback = pyqtSignal(str)
  63. QuitCallback = pyqtSignal()
  64. InlineDisplayRedrawCallback = pyqtSignal(int)
  65. # ------------------------------------------------------------------------------------------------------------
  66. # Carla Host object (dummy/null, does nothing)
  67. class CarlaHostQtNull(CarlaHostNull, CarlaHostSignals):
  68. def __init__(self):
  69. CarlaHostSignals.__init__(self)
  70. CarlaHostNull.__init__(self)
  71. # ------------------------------------------------------------------------------------------------------------
  72. # Carla Host object using a DLL
  73. class CarlaHostQtDLL(CarlaHostDLL, CarlaHostSignals):
  74. def __init__(self, libName, loadGlobal):
  75. CarlaHostSignals.__init__(self)
  76. CarlaHostDLL.__init__(self, libName, loadGlobal)
  77. # ------------------------------------------------------------------------------------------------------------
  78. # Carla Host object for plugins (using pipes)
  79. # pylint: disable=abstract-method
  80. class CarlaHostQtPlugin(CarlaHostPlugin, CarlaHostSignals):
  81. def __init__(self):
  82. CarlaHostSignals.__init__(self)
  83. CarlaHostPlugin.__init__(self)
  84. # pylint: enable=abstract-method
  85. # ------------------------------------------------------------------------------------------------------------