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.

107 lines
4.4KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla Backend code (Qt stuff)
  4. # Copyright (C) 2011-2017 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, QObject
  24. else:
  25. from PyQt4.QtCore import pyqtSignal, QObject
  26. # ------------------------------------------------------------------------------------------------------------
  27. # Imports (Custom)
  28. from carla_backend import *
  29. # ------------------------------------------------------------------------------------------------------------
  30. # Carla Host PyQt signals
  31. class CarlaHostSignals(QObject):
  32. # signals
  33. DebugCallback = pyqtSignal(int, int, int, float, str)
  34. PluginAddedCallback = pyqtSignal(int, str)
  35. PluginRemovedCallback = pyqtSignal(int)
  36. PluginRenamedCallback = pyqtSignal(int, str)
  37. PluginUnavailableCallback = pyqtSignal(int, str)
  38. ParameterValueChangedCallback = pyqtSignal(int, int, float)
  39. ParameterDefaultChangedCallback = pyqtSignal(int, int, float)
  40. ParameterMidiCcChangedCallback = pyqtSignal(int, int, int)
  41. ParameterMidiChannelChangedCallback = pyqtSignal(int, int, int)
  42. ProgramChangedCallback = pyqtSignal(int, int)
  43. MidiProgramChangedCallback = pyqtSignal(int, int)
  44. OptionChangedCallback = pyqtSignal(int, int, bool)
  45. UiStateChangedCallback = pyqtSignal(int, int)
  46. NoteOnCallback = pyqtSignal(int, int, int, int)
  47. NoteOffCallback = pyqtSignal(int, int, int)
  48. UpdateCallback = pyqtSignal(int)
  49. ReloadInfoCallback = pyqtSignal(int)
  50. ReloadParametersCallback = pyqtSignal(int)
  51. ReloadProgramsCallback = pyqtSignal(int)
  52. ReloadAllCallback = pyqtSignal(int)
  53. PatchbayClientAddedCallback = pyqtSignal(int, int, int, str)
  54. PatchbayClientRemovedCallback = pyqtSignal(int)
  55. PatchbayClientRenamedCallback = pyqtSignal(int, str)
  56. PatchbayClientDataChangedCallback = pyqtSignal(int, int, int)
  57. PatchbayPortAddedCallback = pyqtSignal(int, int, int, str)
  58. PatchbayPortRemovedCallback = pyqtSignal(int, int)
  59. PatchbayPortRenamedCallback = pyqtSignal(int, int, str)
  60. PatchbayConnectionAddedCallback = pyqtSignal(int, int, int, int, int)
  61. PatchbayConnectionRemovedCallback = pyqtSignal(int, int, int)
  62. EngineStartedCallback = pyqtSignal(int, int, str)
  63. EngineStoppedCallback = pyqtSignal()
  64. ProcessModeChangedCallback = pyqtSignal(int)
  65. TransportModeChangedCallback = pyqtSignal(int)
  66. BufferSizeChangedCallback = pyqtSignal(int)
  67. SampleRateChangedCallback = pyqtSignal(float)
  68. NSMCallback = pyqtSignal(int, int, str)
  69. InfoCallback = pyqtSignal(str)
  70. ErrorCallback = pyqtSignal(str)
  71. QuitCallback = pyqtSignal()
  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):
  82. CarlaHostSignals.__init__(self)
  83. CarlaHostDLL.__init__(self, libName)
  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. # ------------------------------------------------------------------------------------------------------------