shuffle method

Future<void> shuffle()

Shuffles the playlist using the ShuffleOrder passed into the constructor, and recursively shuffles each nested AudioSource according to its own ShuffleOrder.

Implementation

Future<void> shuffle() async {
  if (_disposed) return;
  if (_playlist.children.isEmpty) return;
  _playlist._shuffle(initialIndex: currentIndex);
  await _broadcastSequence(sequenceChanged: false);
  await (await _platform).setShuffleOrder(
      SetShuffleOrderRequest(audioSourceMessage: _playlist._toMessage()));
}