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.

canvasportglow.py 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # PatchBay Canvas engine using QGraphicsView/Scene
  4. # Copyright (C) 2010-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.QtWidgets import QGraphicsDropShadowEffect
  20. # ------------------------------------------------------------------------------------------------------------
  21. # Imports (Custom)
  22. from . import (
  23. canvas,
  24. PORT_TYPE_AUDIO_JACK,
  25. PORT_TYPE_MIDI_ALSA,
  26. PORT_TYPE_MIDI_JACK,
  27. PORT_TYPE_PARAMETER,
  28. )
  29. # ------------------------------------------------------------------------------------------------------------
  30. class CanvasPortGlow(QGraphicsDropShadowEffect):
  31. def __init__(self, port_type, parent):
  32. QGraphicsDropShadowEffect.__init__(self, parent)
  33. self.setBlurRadius(12)
  34. self.setOffset(0, 0)
  35. if port_type == PORT_TYPE_AUDIO_JACK:
  36. self.setColor(canvas.theme.line_audio_jack_glow)
  37. elif port_type == PORT_TYPE_MIDI_JACK:
  38. self.setColor(canvas.theme.line_midi_jack_glow)
  39. elif port_type == PORT_TYPE_MIDI_ALSA:
  40. self.setColor(canvas.theme.line_midi_alsa_glow)
  41. elif port_type == PORT_TYPE_PARAMETER:
  42. self.setColor(canvas.theme.line_parameter_glow)
  43. # ------------------------------------------------------------------------------------------------------------