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.

102 lines
4.4KB

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