Refacto, enum, utils, WIP
This commit is contained in:
@@ -3,7 +3,7 @@ from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
|
||||
|
||||
from config.config_manager import ConfigManager, VOLUME_KEY
|
||||
|
||||
from constants import RESOURCES_MP3
|
||||
from constants import Resources
|
||||
|
||||
class AudioController:
|
||||
# Encapsule toute la logique audio : lecture, volume, mute.
|
||||
@@ -20,7 +20,7 @@ class AudioController:
|
||||
self._player.setLoops(-1)
|
||||
|
||||
# Chargement du MP3 depuis les ressources Qt
|
||||
mp3file = QFile(RESOURCES_MP3)
|
||||
mp3file = QFile(Resources.MP3.value)
|
||||
mp3file.open(QFile.ReadOnly)
|
||||
mp3data = mp3file.readAll()
|
||||
mp3file.close()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from PySide6.QtCore import QPropertyAnimation, QEasingCurve
|
||||
from PySide6.QtWidgets import QGraphicsDropShadowEffect
|
||||
|
||||
from constants import GLOW_COLOR, GLOW_BLUR_BASE, GLOW_BLUR_PEAK, GLOW_ANIM_DURATION
|
||||
from constants import Glow
|
||||
|
||||
|
||||
class GlowAnimator:
|
||||
@@ -11,15 +11,15 @@ class GlowAnimator:
|
||||
self._widget = widget
|
||||
|
||||
self._effect = QGraphicsDropShadowEffect(widget)
|
||||
self._effect.setBlurRadius(GLOW_BLUR_BASE)
|
||||
self._effect.setBlurRadius(Glow.BLUR_BASE.value)
|
||||
self._effect.setOffset(0, 0)
|
||||
self._effect.setColor(GLOW_COLOR)
|
||||
self._effect.setColor(Glow.COLOR.value)
|
||||
|
||||
self._anim = QPropertyAnimation(self._effect, b"blurRadius")
|
||||
self._anim.setDuration(GLOW_ANIM_DURATION)
|
||||
self._anim.setStartValue(GLOW_BLUR_BASE)
|
||||
self._anim.setKeyValueAt(0.5, GLOW_BLUR_PEAK)
|
||||
self._anim.setEndValue(GLOW_BLUR_BASE)
|
||||
self._anim.setDuration(Glow.ANIM_DURATION.value)
|
||||
self._anim.setStartValue(Glow.BLUR_BASE.value)
|
||||
self._anim.setKeyValueAt(0.5, Glow.BLUR_PEAK.value)
|
||||
self._anim.setEndValue(Glow.BLUR_BASE.value)
|
||||
self._anim.setEasingCurve(QEasingCurve.InOutQuad)
|
||||
self._anim.setLoopCount(-1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user