refactor(core): 핵심 서비스 로직 개선
- audio_service: 오디오 처리 로직 수정 - ad_service: 광고 서비스 개선 - character_roll_service: 캐릭터 롤 로직 수정 - iap_service: 인앱 결제 로직 개선 - progress_loop: 진행 루프 업데이트 - return_rewards_service: 복귀 보상 로직 개선 - settings_repository: 설정 저장소 수정
This commit is contained in:
@@ -85,6 +85,9 @@ class AudioService {
|
||||
// 오디오 일시정지 상태 (앱 백그라운드 시)
|
||||
bool _isPaused = false;
|
||||
|
||||
// 일시정지 전 재생 중이던 BGM (복귀 시 재개용)
|
||||
String? _pausedBgm;
|
||||
|
||||
// BGM 작업 진행 중 여부 (동시 호출 방지)
|
||||
bool _isBgmBusy = false;
|
||||
|
||||
@@ -357,17 +360,24 @@ class AudioService {
|
||||
/// 전체 오디오 일시정지 (앱 백그라운드 시)
|
||||
Future<void> pauseAll() async {
|
||||
_isPaused = true;
|
||||
_pausedBgm = _currentBgm; // 복귀 시 재개를 위해 저장
|
||||
try {
|
||||
await _staticBgmPlayer?.stop();
|
||||
} catch (_) {}
|
||||
_currentBgm = null;
|
||||
debugPrint('[AudioService] All audio paused');
|
||||
debugPrint('[AudioService] All audio paused (was playing: $_pausedBgm)');
|
||||
}
|
||||
|
||||
/// 전체 오디오 재개 (앱 포그라운드 복귀 시)
|
||||
Future<void> resumeAll() async {
|
||||
_isPaused = false;
|
||||
debugPrint('[AudioService] Audio resumed');
|
||||
// 일시정지 전 재생 중이던 BGM 재개
|
||||
if (_pausedBgm != null) {
|
||||
final bgmToResume = _pausedBgm!;
|
||||
_pausedBgm = null;
|
||||
await playBgm(bgmToResume);
|
||||
}
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user