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.

45 lines
1.5KB

  1. #!/usr/bin/env python3
  2. # SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
  3. # SPDX-License-Identifier: GPL-2.0-or-later
  4. # ------------------------------------------------------------------------------------------------------------
  5. # Imports (Global)
  6. from qt_compat import qt_config
  7. if qt_config == 5:
  8. from PyQt5.QtWidgets import QGraphicsDropShadowEffect
  9. elif qt_config == 6:
  10. from PyQt6.QtWidgets import QGraphicsDropShadowEffect
  11. # ------------------------------------------------------------------------------------------------------------
  12. # Imports (Custom)
  13. from . import (
  14. canvas,
  15. PORT_TYPE_AUDIO_JACK,
  16. PORT_TYPE_MIDI_ALSA,
  17. PORT_TYPE_MIDI_JACK,
  18. PORT_TYPE_PARAMETER,
  19. )
  20. # ------------------------------------------------------------------------------------------------------------
  21. class CanvasPortGlow(QGraphicsDropShadowEffect):
  22. def __init__(self, port_type, parent):
  23. QGraphicsDropShadowEffect.__init__(self, parent)
  24. self.setBlurRadius(12)
  25. self.setOffset(0, 0)
  26. if port_type == PORT_TYPE_AUDIO_JACK:
  27. self.setColor(canvas.theme.line_audio_jack_glow)
  28. elif port_type == PORT_TYPE_MIDI_JACK:
  29. self.setColor(canvas.theme.line_midi_jack_glow)
  30. elif port_type == PORT_TYPE_MIDI_ALSA:
  31. self.setColor(canvas.theme.line_midi_alsa_glow)
  32. elif port_type == PORT_TYPE_PARAMETER:
  33. self.setColor(canvas.theme.line_parameter_glow)
  34. # ------------------------------------------------------------------------------------------------------------