refactor: remove description property from audio effects and UI
This commit is contained in:
11 files changed
+5
-13
No files matched your search
@@ -350,7 +350,7 @@ async function cycleLoop() {
|
|||||||
type="button"
|
type="button"
|
||||||
class="btn-effect"
|
class="btn-effect"
|
||||||
:class="{ active: fx.active }"
|
:class="{ active: fx.active }"
|
||||||
:title="`${fx.name} – ${fx.description}`"
|
:title="fx.name"
|
||||||
@click="onToggleEffect(fx)"
|
@click="onToggleEffect(fx)"
|
||||||
>
|
>
|
||||||
<component :is="effectIcon(fx.icon)" :size="15" class="effect-icon" />
|
<component :is="effectIcon(fx.icon)" :size="15" class="effect-icon" />
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ export interface UploadedFile {
|
|||||||
export interface PlayerEffect {
|
export interface PlayerEffect {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
description: string
|
|
||||||
icon: string
|
icon: string
|
||||||
active: boolean
|
active: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class TestAudioEffects(unittest.TestCase):
|
|||||||
self.assertFalse(toggled)
|
self.assertFalse(toggled)
|
||||||
self.assertFalse(pipeline.is_active("distortion"))
|
self.assertFalse(pipeline.is_active("distortion"))
|
||||||
|
|
||||||
def test_effects_metadata_does_not_contain_badge(self):
|
def test_effects_metadata_does_not_contain_badge_or_description(self):
|
||||||
from zyrarbot.audio.effects.registry import get_available_effects_metadata
|
from zyrarbot.audio.effects.registry import get_available_effects_metadata
|
||||||
|
|
||||||
metadata = get_available_effects_metadata()
|
metadata = get_available_effects_metadata()
|
||||||
@@ -97,13 +97,14 @@ class TestAudioEffects(unittest.TestCase):
|
|||||||
for entry in metadata:
|
for entry in metadata:
|
||||||
self.assertIn("id", entry)
|
self.assertIn("id", entry)
|
||||||
self.assertIn("name", entry)
|
self.assertIn("name", entry)
|
||||||
self.assertIn("description", entry)
|
|
||||||
self.assertIn("icon", entry)
|
self.assertIn("icon", entry)
|
||||||
self.assertNotIn("badge", entry)
|
self.assertNotIn("badge", entry)
|
||||||
|
self.assertNotIn("description", entry)
|
||||||
|
|
||||||
def test_effect_instances_have_no_badge_attribute(self):
|
def test_effect_instances_have_no_badge_or_description_attribute(self):
|
||||||
for effect in create_default_effects():
|
for effect in create_default_effects():
|
||||||
self.assertFalse(hasattr(effect, "badge"))
|
self.assertFalse(hasattr(effect, "badge"))
|
||||||
|
self.assertFalse(hasattr(effect, "description"))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ class AudioEffect(ABC):
|
|||||||
|
|
||||||
id: str
|
id: str
|
||||||
name: str
|
name: str
|
||||||
description: str
|
|
||||||
icon: str
|
icon: str
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class DistortionEffect(AudioEffect):
|
|||||||
|
|
||||||
id = "distortion"
|
id = "distortion"
|
||||||
name = "Przester"
|
name = "Przester"
|
||||||
description = "Ekstremalne podbicie głośności (1000%) z przesterem"
|
|
||||||
icon = "zap"
|
icon = "zap"
|
||||||
|
|
||||||
def __init__(self, multiplier: float = 10.0) -> None:
|
def __init__(self, multiplier: float = 10.0) -> None:
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ class FourthDensityEffect(AudioEffect):
|
|||||||
|
|
||||||
id = "fourth_density"
|
id = "fourth_density"
|
||||||
name = "Czwarta gęstość"
|
name = "Czwarta gęstość"
|
||||||
description = "Pływający ton (sinusoidalna zmiana pitch z okresem ~1 sekundy)"
|
|
||||||
icon = "sparkles"
|
icon = "sparkles"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ class MuffledEffect(AudioEffect):
|
|||||||
|
|
||||||
id = "muffled"
|
id = "muffled"
|
||||||
name = "Pod wodą"
|
name = "Pod wodą"
|
||||||
description = "Filtr dolnoprzepustowy (dźwięk przytłumiony / zza ściany)"
|
|
||||||
icon = "waves"
|
icon = "waves"
|
||||||
|
|
||||||
def __init__(self, alpha: float = 0.085) -> None:
|
def __init__(self, alpha: float = 0.085) -> None:
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ def get_available_effects_metadata() -> list[dict[str, Any]]:
|
|||||||
{
|
{
|
||||||
"id": effect.id,
|
"id": effect.id,
|
||||||
"name": effect.name,
|
"name": effect.name,
|
||||||
"description": effect.description,
|
|
||||||
"icon": effect.icon,
|
"icon": effect.icon,
|
||||||
}
|
}
|
||||||
for effect in create_default_effects()
|
for effect in create_default_effects()
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ class RobotEffect(AudioEffect):
|
|||||||
|
|
||||||
id = "robot"
|
id = "robot"
|
||||||
name = "Robot"
|
name = "Robot"
|
||||||
description = "Metaliczny, robotyczny głos cyborga (ring modulation ~65Hz)"
|
|
||||||
icon = "bot"
|
icon = "bot"
|
||||||
|
|
||||||
def __init__(self, freq_hz: float = 65.0, mix: float = 0.85) -> None:
|
def __init__(self, freq_hz: float = 65.0, mix: float = 0.85) -> None:
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ class ToasterEffect(AudioEffect):
|
|||||||
|
|
||||||
id = "toaster"
|
id = "toaster"
|
||||||
name = "Dźwięk z tostera"
|
name = "Dźwięk z tostera"
|
||||||
description = "Memiczny dźwięk z mikrofalówki / kalkulatora (bitcrusher 5-bit, aliasing)"
|
|
||||||
icon = "radio"
|
icon = "radio"
|
||||||
|
|
||||||
def __init__(self, bit_depth: int = 5, downsample: int = 6) -> None:
|
def __init__(self, bit_depth: int = 5, downsample: int = 6) -> None:
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ class TremoloEffect(AudioEffect):
|
|||||||
|
|
||||||
id = "tremolo"
|
id = "tremolo"
|
||||||
name = "Tremolo"
|
name = "Tremolo"
|
||||||
description = "Pulsowanie amplitudy (efekt wibracji głośności)"
|
|
||||||
icon = "activity"
|
icon = "activity"
|
||||||
|
|
||||||
def __init__(self, freq_hz: float = 4.0, depth: float = 0.6) -> None:
|
def __init__(self, freq_hz: float = 4.0, depth: float = 0.6) -> None:
|
||||||
|
|||||||
Reference in new issue
Block a user