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.

100 lines
4.3KB

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