mirror of
https://github.com/amigan/calls.git
synced 2024-11-21 20:39:47 -05:00
queue kind of works
This commit is contained in:
parent
d52c8310a3
commit
74cc279069
1 changed files with 6 additions and 2 deletions
|
@ -26,6 +26,7 @@ class _MainRadioState extends State<MainRadio> {
|
||||||
Color _ledColor = Colors.black;
|
Color _ledColor = Colors.black;
|
||||||
Timer? _lcdTimer;
|
Timer? _lcdTimer;
|
||||||
SBCall? _call;
|
SBCall? _call;
|
||||||
|
Completer _completer = Completer();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
@ -34,6 +35,7 @@ class _MainRadioState extends State<MainRadio> {
|
||||||
player.player.playerStateStream.listen((event) async {
|
player.player.playerStateStream.listen((event) async {
|
||||||
if (!event.playing &&
|
if (!event.playing &&
|
||||||
event.processingState == ProcessingState.completed) {
|
event.processingState == ProcessingState.completed) {
|
||||||
|
_completer.complete();
|
||||||
setState(() {
|
setState(() {
|
||||||
_ledColor = Colors.black;
|
_ledColor = Colors.black;
|
||||||
});
|
});
|
||||||
|
@ -50,9 +52,11 @@ class _MainRadioState extends State<MainRadio> {
|
||||||
_call = call;
|
_call = call;
|
||||||
sb.queueLen--;
|
sb.queueLen--;
|
||||||
});
|
});
|
||||||
print("bef");
|
print("bef" + DateTime.now().toString());
|
||||||
|
_completer = Completer();
|
||||||
await player.play(call.call);
|
await player.play(call.call);
|
||||||
print("aft");
|
await _completer.future;
|
||||||
|
print("aft" + DateTime.now().toString());
|
||||||
lcdOff();
|
lcdOff();
|
||||||
} //);
|
} //);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue