feat: Implement audio backend with subprocess support and refactor audio handling
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wolf_3d_dart/wolf_3d_data_types.dart';
|
||||
import 'package:wolf_3d_dart/wolf_3d_synth.dart';
|
||||
import 'package:wolf_3d_flutter/wolf_3d_flutter.dart';
|
||||
import 'package:wolf_3d_gui/screens/gallery_game_selector.dart';
|
||||
|
||||
@@ -142,15 +141,16 @@ class _AudioGalleryState extends State<AudioGallery> {
|
||||
}
|
||||
|
||||
final engineAudio = widget.wolf3d.audio;
|
||||
if (engineAudio is! WolfAudio) {
|
||||
if (engineAudio is! DebugMusicPlayer) {
|
||||
return;
|
||||
}
|
||||
final debugAudio = engineAudio as DebugMusicPlayer;
|
||||
|
||||
if (trackIndex < 0 || trackIndex >= _selectedGame.music.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
await engineAudio.playMusic(_selectedGame.music[trackIndex]);
|
||||
await debugAudio.playMusic(_selectedGame.music[trackIndex]);
|
||||
if (!mounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user