28 lines
970 B
Dart
28 lines
970 B
Dart
part of 'runtime_audio_manager.dart';
|
|
|
|
extension _RuntimeAudioManagerDebug on RuntimeAudioManager {
|
|
Map<String, Object?> _audioRecordDebugJson({
|
|
required String? key,
|
|
required String path,
|
|
required String? preload,
|
|
required bool declared,
|
|
}) {
|
|
final record = _audios[path];
|
|
return {
|
|
if (key != null) 'key': key,
|
|
'path': path,
|
|
'type': GameResourceType.audio,
|
|
'declared': declared,
|
|
if (preload != null) 'preload': preload,
|
|
if (key != null && _package?.manifest.resources[key]?.group != null)
|
|
'group': _package?.manifest.resources[key]?.group,
|
|
'state': (record?.state ?? GameResourceState.idle).name,
|
|
if (record != null) 'generation': record.generation,
|
|
'loading': record?.inflight != null,
|
|
'ready': record?.bytes != null,
|
|
if (record?.bytes != null) 'bytes': record!.bytes!.length,
|
|
if (record?.lastError != null) 'error': record!.lastError.toString(),
|
|
};
|
|
}
|
|
}
|