scoreCourseUseWith function

CourseUse? scoreCourseUseWith(
  1. ScoreRound round, {
  2. required String title,
  3. required ScoreCoursePass pass,
  4. List<String> extraNotes = const [],
})

Como scoreCourseUse, com o pass inteiro (pass) e as linhas extraNotes ao lado do bloco (o que a fonte sabe que não coube no formato). A etapa da leitura pela música (LP24.5) o usa: as 2 seguidas viram rounds: 2, e o andamento da etapa, speed.

Implementation

CourseUse? scoreCourseUseWith(
  ScoreRound round, {
  required String title,
  required ScoreCoursePass pass,
  List<String> extraNotes = const [],
}) {
  final ext = _scoreExtensionOf(round.fileName);
  if (ext == null) return null;
  final stem = _slug(
    round.fileName.substring(0, round.fileName.length - ext.length),
  );
  final path = 'media/$stem-${_fingerprint(round.bytes)}$ext';
  final bpm = round.bpm;
  final student = round.studentRuns.isNotEmpty;
  final notes = <String>[];
  final transpose = student ? _transposeWire(round, notes) : null;
  final block = _block([
    'id: $stem',
    'type: play-score',
    'title: $title',
    'file: $path',
    'hand: ${_handWire(round.hand)}',
    'mode: ${round.mode.wire}',
    ?(bpm == null ? null : 'bpm: $bpm'),
    ?(transpose == null ? null : 'transpose: $transpose'),
    if (student) _studentLine(round.studentRuns),
    if (student && round.measures != null) 'measures: "${round.measures}"',
    if (round.curtain) 'curtain: true',
    'pass: ${_passWire(pass, round.mode)}',
  ]);
  return CourseUse(
    text: block,
    shortText: student ? _foldedBlock(block, round.studentRuns) : null,
    files: [CourseUseFile(path, round.bytes)],
    notes: [
      'Copie o arquivo $path para a pasta media/ da lição. Compartilhar '
          'manda o arquivo junto com o texto.',
      if (student)
        'O curso toca as outras notas e mostra a sua parte em azul, como '
            'aqui.${_speedNote(pass, round.mode)}',
      if (student && round.freeNotes.isNotEmpty)
        'No app, o trinado, o mordente e o grupeto não se cobram. No curso, a '
            'nota que os leva é cobrada como as outras da parte do aluno.',
      if (round.hiddenMeasures.isNotEmpty ||
          round.hiddenNotes.isNotEmpty ||
          (!student && round.appNotes.isNotEmpty) ||
          round.listenFirst)
        'O curso não esconde notas nem toca trechos para o aluno repetir: a '
            'partitura sai inteira, como está escrita.',
      ...notes,
      ...extraNotes,
    ],
  );
}