insertAll method

Future<void> insertAll(
  1. int index,
  2. List<AudioSource> children
)

(Untested) Insert multiple AudioSources at index.

Implementation

Future<void> insertAll(int index, List<AudioSource> children) async {
  this.children.insertAll(index, 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)));
  }
}