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.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla Backend code (Qt stuff)
  4. # Copyright (C) 2011-2020 Filipe Coelho <falktx@falktx.com>
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License as
  8. # published by the Free Software Foundation; either version 2 of
  9. # the License, or any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # For a full copy of the GNU General Public License see the doc/GPL.txt file.
  17. # ------------------------------------------------------------------------------------------------------------
  18. # Imports (Global)
  19. from PyQt5.QtCore import pyqtSignal, QObject
  20. # ------------------------------------------------------------------------------------------------------------
  21. # Imports (Custom)
  22. from carla_backend import CarlaHostNull, CarlaHostDLL, CarlaHostPlugin
  23. # ------------------------------------------------------------------------------------------------------------
  24. # Carla Host PyQt signals
  25. class CarlaHostSignals(QObject):
  26. # signals
  27. DebugCallback = pyqtSignal(int, int, int, int, float, str)
  28. PluginAddedCallback = pyqtSignal(int, int, str)
  29. PluginRemovedCallback = pyqtSignal(int)
  30. PluginRenamedCallback = pyqtSignal(int, str)
  31. PluginUnavailableCallback = pyqtSignal(int, str)
  32. ParameterValueChangedCallback = pyqtSignal(int, int, float)
  33. ParameterDefaultChangedCallback = pyqtSignal(int, int, float)
  34. ParameterMappedControlIndexChangedCallback = pyqtSignal(int, int, int)
  35. ParameterMappedRangeChangedCallback = pyqtSignal(int, int, float, float)
  36. ParameterMidiChannelChangedCallback = pyqtSignal(int, int, int)
  37. ProgramChangedCallback = pyqtSignal(int, int)
  38. MidiProgramChangedCallback = pyqtSignal(int, int)
  39. OptionChangedCallback = pyqtSignal(int, int, bool)
  40. UiStateChangedCallback = pyqtSignal(int, int)
  41. NoteOnCallback = pyqtSignal(int, int, int, int)
  42. NoteOffCallback = pyqtSignal(int, int, int)
  43. UpdateCallback = pyqtSignal(int)
  44. ReloadInfoCallback = pyqtSignal(int)
  45. ReloadParametersCallback = pyqtSignal(int)
  46. ReloadProgramsCallback = pyqtSignal(int)
  47. ReloadAllCallback = pyqtSignal(int)
  48. PatchbayClientAddedCallback = pyqtSignal(int, int, int, str)
  49. PatchbayClientRemovedCallback = pyqtSignal(int)
  50. PatchbayClientRenamedCallback = pyqtSignal(int, str)
  51. PatchbayClientDataChangedCallback = pyqtSignal(int, int, int)
  52. PatchbayClientPositionChangedCallback = pyqtSignal(int, int, int, int, int)
  53. PatchbayPortAddedCallback = pyqtSignal(int, int, int, int, str)
  54. PatchbayPortRemovedCallback = pyqtSignal(int, int)
  55. PatchbayPortChangedCallback = pyqtSignal(int, int, int, int, str)
  56. PatchbayPortGroupAddedCallback = pyqtSignal(int, int, int, str)
  57. PatchbayPortGroupRemovedCallback = pyqtSignal(int, int)
  58. PatchbayPortGroupChangedCallback = pyqtSignal(int, int, int, str)
  59. PatchbayConnectionAddedCallback = pyqtSignal(int, int, int, int, int)
  60. PatchbayConnectionRemovedCallback = pyqtSignal(int, int, int)
  61. EngineStartedCallback = pyqtSignal(int, int, int, int, float, str)
  62. EngineStoppedCallback = pyqtSignal()
  63. ProcessModeChangedCallback = pyqtSignal(int)
  64. TransportModeChangedCallback = pyqtSignal(int, str)
  65. BufferSizeChangedCallback = pyqtSignal(int)
  66. SampleRateChangedCallback = pyqtSignal(float)
  67. CancelableActionCallback = pyqtSignal(int, bool, str)
  68. ProjectLoadFinishedCallback = pyqtSignal()
  69. NSMCallback = pyqtSignal(int, int, str)
  70. InfoCallback = pyqtSignal(str)
  71. ErrorCallback = pyqtSignal(str)
  72. QuitCallback = pyqtSignal()
  73. InlineDisplayRedrawCallback = pyqtSignal(int)
  74. # ------------------------------------------------------------------------------------------------------------
  75. # Carla Host object (dummy/null, does nothing)
  76. class CarlaHostQtNull(CarlaHostNull, CarlaHostSignals):
  77. def __init__(self):
  78. CarlaHostSignals.__init__(self)
  79. CarlaHostNull.__init__(self)
  80. # ------------------------------------------------------------------------------------------------------------
  81. # Carla Host object using a DLL
  82. class CarlaHostQtDLL(CarlaHostDLL, CarlaHostSignals):
  83. def __init__(self, libName, loadGlobal):
  84. CarlaHostSignals.__init__(self)
  85. CarlaHostDLL.__init__(self, libName, loadGlobal)
  86. # ------------------------------------------------------------------------------------------------------------
  87. # Carla Host object for plugins (using pipes)
  88. # pylint: disable=abstract-method
  89. class CarlaHostQtPlugin(CarlaHostPlugin, CarlaHostSignals):
  90. def __init__(self):
  91. CarlaHostSignals.__init__(self)
  92. CarlaHostPlugin.__init__(self)
  93. # pylint: enable=abstract-method
  94. # ------------------------------------------------------------------------------------------------------------