|
|
@ -18,7 +18,10 @@ enum PinballAudio {
|
|
|
|
backgroundMusic,
|
|
|
|
backgroundMusic,
|
|
|
|
|
|
|
|
|
|
|
|
/// IO Pinball voice over
|
|
|
|
/// IO Pinball voice over
|
|
|
|
ioPinballVoiceOver
|
|
|
|
ioPinballVoiceOver,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Game over
|
|
|
|
|
|
|
|
gameOverVoiceOver,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Defines the contract of the creation of an [AudioPool].
|
|
|
|
/// Defines the contract of the creation of an [AudioPool].
|
|
|
@ -30,20 +33,16 @@ typedef CreateAudioPool = Future<AudioPool> Function(
|
|
|
|
String? prefix,
|
|
|
|
String? prefix,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/// Function that defines the contract for playing a single
|
|
|
|
/// Defines the contract for playing a single audio.
|
|
|
|
/// audio
|
|
|
|
|
|
|
|
typedef PlaySingleAudio = Future<void> Function(String);
|
|
|
|
typedef PlaySingleAudio = Future<void> Function(String);
|
|
|
|
|
|
|
|
|
|
|
|
/// Function that defines the contract for looping a single
|
|
|
|
/// Defines the contract for looping a single audio.
|
|
|
|
/// audio
|
|
|
|
|
|
|
|
typedef LoopSingleAudio = Future<void> Function(String);
|
|
|
|
typedef LoopSingleAudio = Future<void> Function(String);
|
|
|
|
|
|
|
|
|
|
|
|
/// Function that defines the contract for pre fetching an
|
|
|
|
/// Defines the contract for pre fetching an audio.
|
|
|
|
/// audio
|
|
|
|
|
|
|
|
typedef PreCacheSingleAudio = Future<void> Function(String);
|
|
|
|
typedef PreCacheSingleAudio = Future<void> Function(String);
|
|
|
|
|
|
|
|
|
|
|
|
/// Function that defines the contract for configuring
|
|
|
|
/// Defines the contract for configuring an [AudioCache] instance.
|
|
|
|
/// an [AudioCache] instance
|
|
|
|
|
|
|
|
typedef ConfigureAudioCache = void Function(AudioCache);
|
|
|
|
typedef ConfigureAudioCache = void Function(AudioCache);
|
|
|
|
|
|
|
|
|
|
|
|
abstract class _Audio {
|
|
|
|
abstract class _Audio {
|
|
|
@ -164,6 +163,11 @@ class PinballPlayer {
|
|
|
|
playSingleAudio: _playSingleAudio,
|
|
|
|
playSingleAudio: _playSingleAudio,
|
|
|
|
path: Assets.sfx.ioPinballVoiceOver,
|
|
|
|
path: Assets.sfx.ioPinballVoiceOver,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
PinballAudio.gameOverVoiceOver: _SimplePlayAudio(
|
|
|
|
|
|
|
|
preCacheSingleAudio: _preCacheSingleAudio,
|
|
|
|
|
|
|
|
playSingleAudio: _playSingleAudio,
|
|
|
|
|
|
|
|
path: Assets.sfx.gameOverVoiceOver,
|
|
|
|
|
|
|
|
),
|
|
|
|
PinballAudio.bumper: _BumperAudio(
|
|
|
|
PinballAudio.bumper: _BumperAudio(
|
|
|
|
createAudioPool: _createAudioPool,
|
|
|
|
createAudioPool: _createAudioPool,
|
|
|
|
seed: _seed,
|
|
|
|
seed: _seed,
|
|
|
|