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

6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. 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. # ------------------------------------------------------------------------------------------------------------
  69. # Carla Host object (dummy/null, does nothing)
  70. class CarlaHostQtNull(CarlaHostNull, CarlaHostSignals):
  71. def __init__(self):
  72. CarlaHostSignals.__init__(self)
  73. CarlaHostNull.__init__(self)
  74. # ------------------------------------------------------------------------------------------------------------
  75. # Carla Host object using a DLL
  76. class CarlaHostQtDLL(CarlaHostDLL, CarlaHostSignals):
  77. def __init__(self, libName, loadGlobal):
  78. CarlaHostSignals.__init__(self)
  79. CarlaHostDLL.__init__(self, libName, loadGlobal)
  80. # ------------------------------------------------------------------------------------------------------------
  81. # Carla Host object for plugins (using pipes)
  82. class CarlaHostQtPlugin(CarlaHostPlugin, CarlaHostSignals):
  83. def __init__(self):
  84. CarlaHostSignals.__init__(self)
  85. CarlaHostPlugin.__init__(self)
  86. # ------------------------------------------------------------------------------------------------------------