refactor(core/audio): helper stealCurrentIntoOutgoing (DUP-04)
fadeOutMusic i crossfadeMusic repetien el bloc "destruir outgoing anterior + preFillOutgoing + robar stream + reset state+vorbis". Es treu a stealCurrentIntoOutgoing(duration_ms) i els dos callers deleguen. Com a efecte secundari, homogeneïtza la neteja: abans fadeOutMusic no posava outgoing.fade.active = false en destruir l'anterior i crossfadeMusic sí. L'helper fa sempre les dues coses. El comportament observable no canvia perquè la fade s'assigna completament just després, però elimina una inconsistència latent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ee34638c89
commit
dee00a8de7
2 files changed
+35
-50
No files matched your search
@@ -33,7 +33,7 @@ Los IDs se mantienen estables una vez asignados. Cada entrada apunta al(los) fic
|
||||
| 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 | DONE | `effectiveVolume(volume, channel_enabled)` privat; els dos setters deleguen |
|
||||
| DUP-03 | `jail_audio.hpp:196-222` | `updateOutgoingFade`/`updateIncomingFade` comparten la curva lineal | Menor | DONE | `fadeProgress(FadeState&)` concentra la corba en un sol lloc; també cobreix `duration_ms <= 0` com a 1.0 |
|
||||
| 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-04 | `jail_audio.hpp:391-471` | `fadeOutMusic`/`crossfadeMusic` repiten "destruir outgoing + pre-fill + robar stream + reset vorbis" | Importante | DONE | `stealCurrentIntoOutgoing(duration_ms)` concentra el robatori; `fadeOutMusic` i `crossfadeMusic` hi deleguen. També homogeneïtza `outgoing.fade.active = false` en la destrucció (abans era inconsistent) |
|
||||
| DUP-05 | `jail_audio.hpp:575-631` | `pauseChannel`/`resumeChannel`/`stopChannel` repiten dispatch `channel==-1 / [0,MAX)` | Menor | PENDING | Helper `forEachTargetChannel(int, fn)` |
|
||||
|
||||
## 2. Hardcoding
|
||||
|
||||
Reference in new issue
Block a user