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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla Backend code (Qt stuff)
  4. # Copyright (C) 2011-2019 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 *
  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, 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. ParameterMidiCcChangedCallback = pyqtSignal(int, int, int)
  35. ParameterMidiChannelChangedCallback = pyqtSignal(int, int, int)
  36. ProgramChangedCallback = pyqtSignal(int, int)
  37. MidiProgramChangedCallback = pyqtSignal(int, int)
  38. OptionChangedCallback = pyqtSignal(int, int, bool)
  39. UiStateChangedCallback = pyqtSignal(int, int)
  40. NoteOnCallback = pyqtSignal(int, int, int, int)
  41. NoteOffCallback = pyqtSignal(int, int, int)
  42. UpdateCallback = pyqtSignal(int)
  43. ReloadInfoCallback = pyqtSignal(int)
  44. ReloadParametersCallback = pyqtSignal(int)
  45. ReloadProgramsCallback = pyqtSignal(int)
  46. ReloadAllCallback = pyqtSignal(int)
  47. PatchbayClientAddedCallback = pyqtSignal(int, int, int, str)
  48. PatchbayClientRemovedCallback = pyqtSignal(int)
  49. PatchbayClientRenamedCallback = pyqtSignal(int, str)
  50. PatchbayClientDataChangedCallback = pyqtSignal(int, int, int)
  51. PatchbayPortAddedCallback = pyqtSignal(int, int, int, int, str)
  52. PatchbayPortRemovedCallback = pyqtSignal(int, int)
  53. PatchbayPortChangedCallback = pyqtSignal(int, int, int, int, str)
  54. PatchbayPortGroupAddedCallback = pyqtSignal(int, int, int, str)
  55. PatchbayPortGroupRemovedCallback = pyqtSignal(int, int)
  56. PatchbayPortGroupChangedCallback = pyqtSignal(int, int, int, str)
  57. PatchbayConnectionAddedCallback = pyqtSignal(int, int, int, int, int)
  58. PatchbayConnectionRemovedCallback = pyqtSignal(int, int, int)
  59. EngineStartedCallback = pyqtSignal(int, int, int, int, float, str)
  60. EngineStoppedCallback = pyqtSignal()
  61. ProcessModeChangedCallback = pyqtSignal(int)
  62. TransportModeChangedCallback = pyqtSignal(int, str)
  63. BufferSizeChangedCallback = pyqtSignal(int)
  64. SampleRateChangedCallback = pyqtSignal(float)
  65. CancelableActionCallback = pyqtSignal(int, bool, str)
  66. ProjectLoadFinishedCallback = pyqtSignal()
  67. NSMCallback = pyqtSignal(int, int, str)
  68. InfoCallback = pyqtSignal(str)
  69. ErrorCallback = pyqtSignal(str)
  70. QuitCallback = pyqtSignal()
  71. InlineDisplayRedrawCallback = pyqtSignal(int)
  72. # ------------------------------------------------------------------------------------------------------------
  73. # Carla Host object (dummy/null, does nothing)
  74. class CarlaHostQtNull(CarlaHostNull, CarlaHostSignals):
  75. def __init__(self):
  76. CarlaHostSignals.__init__(self)
  77. CarlaHostNull.__init__(self)
  78. # ------------------------------------------------------------------------------------------------------------
  79. # Carla Host object using a DLL
  80. class CarlaHostQtDLL(CarlaHostDLL, CarlaHostSignals):
  81. def __init__(self, libName, loadGlobal):
  82. CarlaHostSignals.__init__(self)
  83. CarlaHostDLL.__init__(self, libName, loadGlobal)
  84. # ------------------------------------------------------------------------------------------------------------
  85. # Carla Host object for plugins (using pipes)
  86. class CarlaHostQtPlugin(CarlaHostPlugin, CarlaHostSignals):
  87. def __init__(self):
  88. CarlaHostSignals.__init__(self)
  89. CarlaHostPlugin.__init__(self)
  90. # ------------------------------------------------------------------------------------------------------------