refactor(core/audio): helper effectiveVolume compartit (DUP-02)
setSoundVolume i setMusicVolume repetien la mateixa lògica de clamp + gate (enabled_ && channel_enabled_) + multiplicació pel master config_.volume. S'extreu effectiveVolume(volume, channel_enabled) privat i els dos setters es limiten a la crida Ja::*. Any canvi futur a la política (p.ex. una corba logarítmica) queda en un sol lloc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
256a232a95
commit
893e5b27e4
3 files changed
+15
-12
No files matched your search
@@ -31,7 +31,7 @@ Los IDs se mantienen estables una vez asignados. Cada entrada apunta al(los) fic
|
||||
| ID | Fichero:línea | Hallazgo | Severidad | Estado | Notas |
|
||||
|----|---------------|----------|-----------|--------|-------|
|
||||
| DUP-01 | `audio.cpp:58-101` | Dos `playMusic` (nombre/puntero) repiten el bloque crossfade/stop+play | Menor | DONE | `playMusicInternal(Ja::Music*, loop, crossfade_ms)` privat; els dos overloads fan gating + name-handling i deleguen el dispatch |
|
||||
| DUP-02 | `audio.cpp:172-185` | `setSoundVolume`/`setMusicVolume` idéntica estructura de clamp+gate+producto | Menor | PENDING | Helper `effectiveVolume(bool, float)` |
|
||||
| DUP-02 | `audio.cpp:172-185` | `setSoundVolume`/`setMusicVolume` idéntica estructura de clamp+gate+producto | Menor | DONE | `effectiveVolume(volume, channel_enabled)` privat; els dos setters deleguen |
|
||||
| DUP-03 | `jail_audio.hpp:196-222` | `updateOutgoingFade`/`updateIncomingFade` comparten la curva lineal | Menor | PENDING | Helper `fadeProgress(FadeState&) -> float` |
|
||||
| DUP-04 | `jail_audio.hpp:391-471` | `fadeOutMusic`/`crossfadeMusic` repiten "destruir outgoing + pre-fill + robar stream + reset vorbis" | Importante | PENDING | Función privada `stealCurrentIntoOutgoing(int ms)` |
|
||||
| DUP-05 | `jail_audio.hpp:575-631` | `pauseChannel`/`resumeChannel`/`stopChannel` repiten dispatch `channel==-1 / [0,MAX)` | Menor | PENDING | Helper `forEachTargetChannel(int, fn)` |
|
||||
|
||||
Reference in new issue
Block a user