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.

106 lines
4.7KB

  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. 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. PatchbayPortAddedCallback = pyqtSignal(int, int, int, int, str)
  53. PatchbayPortRemovedCallback = pyqtSignal(int, int)
  54. PatchbayPortChangedCallback = pyqtSignal(int, int, int, int, str)
  55. PatchbayPortGroupAddedCallback = pyqtSignal(int, int, int, str)
  56. PatchbayPortGroupRemovedCallback = pyqtSignal(int, int)
  57. PatchbayPortGroupChangedCallback = pyqtSignal(int, int, int, str)
  58. PatchbayConnectionAddedCallback = pyqtSignal(int, int, int, int, int)
  59. PatchbayConnectionRemovedCallback = pyqtSignal(int, int, int)
  60. EngineStartedCallback = pyqtSignal(int, int, int, int, float, str)
  61. EngineStoppedCallback = pyqtSignal()
  62. ProcessModeChangedCallback = pyqtSignal(int)
  63. TransportModeChangedCallback = pyqtSignal(int, str)
  64. BufferSizeChangedCallback = pyqtSignal(int)
  65. SampleRateChangedCallback = pyqtSignal(float)
  66. CancelableActionCallback = pyqtSignal(int, bool, str)
  67. ProjectLoadFinishedCallback = pyqtSignal()
  68. NSMCallback = pyqtSignal(int, int, str)
  69. InfoCallback = pyqtSignal(str)
  70. ErrorCallback = pyqtSignal(str)
  71. QuitCallback = pyqtSignal()
  72. InlineDisplayRedrawCallback = pyqtSignal(int)
  73. # ------------------------------------------------------------------------------------------------------------
  74. # Carla Host object (dummy/null, does nothing)
  75. class CarlaHostQtNull(CarlaHostNull, CarlaHostSignals):
  76. def __init__(self):
  77. CarlaHostSignals.__init__(self)
  78. CarlaHostNull.__init__(self)
  79. # ------------------------------------------------------------------------------------------------------------
  80. # Carla Host object using a DLL
  81. class CarlaHostQtDLL(CarlaHostDLL, CarlaHostSignals):
  82. def __init__(self, libName, loadGlobal):
  83. CarlaHostSignals.__init__(self)
  84. CarlaHostDLL.__init__(self, libName, loadGlobal)
  85. # ------------------------------------------------------------------------------------------------------------
  86. # Carla Host object for plugins (using pipes)
  87. class CarlaHostQtPlugin(CarlaHostPlugin, CarlaHostSignals):
  88. def __init__(self):
  89. CarlaHostSignals.__init__(self)
  90. CarlaHostPlugin.__init__(self)
  91. # ------------------------------------------------------------------------------------------------------------