addAll method

Future<void> addAll(
  1. List<AudioSource> children
)

(Untested) Appends multiple AudioSources.

Implementation

Future<void> addAll(List<AudioSource> children) async {
  final index = this.children.length;
  this.children.addAll(children);
  _shuffleOrder.insert(index, children.length);
  if (_player != null) {
    _player!._broadcastSequence();
    for (var child in children) {
      await child._setup(_player!);
    }
    await (await _player!._platform).concatenatingInsertAll(
        ConcatenatingInsertAllRequest(
            id: _id,
            index: index,
            children: children.map((child) => child._toMessage()).toList(),
            shuffleOrder: List.of(_shuffleOrder.indices)));
  }
}