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.

116 lines
5.0KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla Backend code (Qt stuff)
  4. # Copyright (C) 2011-2014 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 (Config)
  19. from carla_config import *
  20. # ------------------------------------------------------------------------------------------------------------
  21. # Imports (Global)
  22. if config_UseQt5:
  23. from PyQt5.QtCore import pyqtSignal, pyqtWrapperType, QObject
  24. else:
  25. from PyQt4.QtCore import pyqtSignal, pyqtWrapperType, QObject
  26. # ------------------------------------------------------------------------------------------------------------
  27. # Imports (Custom)
  28. from carla_backend import *
  29. # ------------------------------------------------------------------------------------------------------------
  30. # An empty class used to resolve metaclass conflicts between ABC and PyQt modules
  31. class PyQtMetaClass(pyqtWrapperType, ABCMeta):
  32. pass
  33. # ------------------------------------------------------------------------------------------------------------
  34. # Carla Host PyQt signals
  35. class CarlaHostSignals(QObject):
  36. # signals
  37. DebugCallback = pyqtSignal(int, int, int, float, str)
  38. PluginAddedCallback = pyqtSignal(int, str)
  39. PluginRemovedCallback = pyqtSignal(int)
  40. PluginRenamedCallback = pyqtSignal(int, str)
  41. PluginUnavailableCallback = pyqtSignal(int, str)
  42. ParameterValueChangedCallback = pyqtSignal(int, int, float)
  43. ParameterDefaultChangedCallback = pyqtSignal(int, int, float)
  44. ParameterMidiCcChangedCallback = pyqtSignal(int, int, int)
  45. ParameterMidiChannelChangedCallback = pyqtSignal(int, int, int)
  46. ProgramChangedCallback = pyqtSignal(int, int)
  47. MidiProgramChangedCallback = pyqtSignal(int, int)
  48. OptionChangedCallback = pyqtSignal(int, int, bool)
  49. UiStateChangedCallback = pyqtSignal(int, int)
  50. NoteOnCallback = pyqtSignal(int, int, int, int)
  51. NoteOffCallback = pyqtSignal(int, int, int)
  52. UpdateCallback = pyqtSignal(int)
  53. ReloadInfoCallback = pyqtSignal(int)
  54. ReloadParametersCallback = pyqtSignal(int)
  55. ReloadProgramsCallback = pyqtSignal(int)
  56. ReloadAllCallback = pyqtSignal(int)
  57. PatchbayClientAddedCallback = pyqtSignal(int, int, int, str)
  58. PatchbayClientRemovedCallback = pyqtSignal(int)
  59. PatchbayClientRenamedCallback = pyqtSignal(int, str)
  60. PatchbayClientDataChangedCallback = pyqtSignal(int, int, int)
  61. PatchbayPortAddedCallback = pyqtSignal(int, int, int, str)
  62. PatchbayPortRemovedCallback = pyqtSignal(int, int)
  63. PatchbayPortRenamedCallback = pyqtSignal(int, int, str)
  64. PatchbayConnectionAddedCallback = pyqtSignal(int, int, int, int, int)
  65. PatchbayConnectionRemovedCallback = pyqtSignal(int, int, int)
  66. EngineStartedCallback = pyqtSignal(int, int, str)
  67. EngineStoppedCallback = pyqtSignal()
  68. ProcessModeChangedCallback = pyqtSignal(int)
  69. TransportModeChangedCallback = pyqtSignal(int)
  70. BufferSizeChangedCallback = pyqtSignal(int)
  71. SampleRateChangedCallback = pyqtSignal(float)
  72. NSMCallback = pyqtSignal(int, int, str)
  73. InfoCallback = pyqtSignal(str)
  74. ErrorCallback = pyqtSignal(str)
  75. QuitCallback = pyqtSignal()
  76. # ------------------------------------------------------------------------------------------------------------
  77. # Carla Host object (dummy/null, does nothing)
  78. class CarlaHostQtNull(CarlaHostSignals, CarlaHostNull):
  79. #class CarlaHostQtDLL(CarlaHostSignals, CarlaHostNull, metaclass=PyQtMetaClass):
  80. def __init__(self):
  81. CarlaHostSignals.__init__(self)
  82. CarlaHostNull.__init__(self)
  83. # ------------------------------------------------------------------------------------------------------------
  84. # Carla Host object using a DLL
  85. class CarlaHostQtDLL(CarlaHostSignals, CarlaHostDLL):
  86. #class CarlaHostQtDLL(CarlaHostSignals, CarlaHostDLL, metaclass=PyQtMetaClass):
  87. def __init__(self, libName):
  88. CarlaHostSignals.__init__(self)
  89. CarlaHostDLL.__init__(self, libName)
  90. # ------------------------------------------------------------------------------------------------------------
  91. # Carla Host object for plugins (using pipes)
  92. class CarlaHostQtPlugin(CarlaHostSignals, CarlaHostPlugin):
  93. #class CarlaHostQtPlugin(CarlaHostSignals, CarlaHostPlugin, metaclass=PyQtMetaClass):
  94. def __init__(self):
  95. CarlaHostSignals.__init__(self)
  96. CarlaHostPlugin.__init__(self)
  97. # ------------------------------------------------------------------------------------------------------------