| 198 | } |
| 199 | |
| 200 | void CFamiTrackerDocIO::PostLoad(CFamiTrackerModule &modfile) { |
| 201 | if (file_.GetFileVersion() <= 0x0201) |
| 202 | compat::ReorderSequences(modfile, std::move(m_vTmpSequences)); |
| 203 | |
| 204 | if (fds_adjust_arps_) { |
| 205 | if (modfile.HasExpansionChip(sound_chip_t::FDS)) { |
| 206 | modfile.VisitSongs([&] (CSongData &song) { |
| 207 | for (int p = 0; p < MAX_PATTERN; ++p) |
| 208 | for (int r = 0; r < MAX_PATTERN_LENGTH; ++r) { |
| 209 | stChanNote &Note = song.GetPatternData(fds_subindex_t::wave, p, r); // // // |
| 210 | if (is_note(Note.Note)) { |
| 211 | int Trsp = Note.ToMidiNote() + NOTE_RANGE * 2; |
| 212 | Trsp = Trsp >= NOTE_COUNT ? NOTE_COUNT - 1 : Trsp; |
| 213 | Note.Note = ft0cc::doc::pitch_from_midi(Trsp); |
| 214 | Note.Octave = ft0cc::doc::oct_from_midi(Trsp); |
| 215 | } |
| 216 | } |
| 217 | }); |
| 218 | } |
| 219 | auto *pManager = modfile.GetInstrumentManager(); |
| 220 | for (int i = 0; i < MAX_INSTRUMENTS; ++i) { |
| 221 | if (pManager->GetInstrumentType(i) == INST_FDS) { |
| 222 | auto pSeq = std::static_pointer_cast<CSeqInstrument>(pManager->GetInstrument(i))->GetSequence(sequence_t::Arpeggio); |
| 223 | if (pSeq != nullptr && pSeq->GetItemCount() > 0 && pSeq->GetSetting() == SETTING_ARP_FIXED) |
| 224 | for (unsigned int j = 0; j < pSeq->GetItemCount(); ++j) { |
| 225 | int Trsp = pSeq->GetItem(j) + NOTE_RANGE * 2; |
| 226 | pSeq->SetItem(j, Trsp >= NOTE_COUNT ? NOTE_COUNT - 1 : Trsp); |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | void CFamiTrackerDocIO::LoadParams(CFamiTrackerModule &modfile, int ver) { |
| 234 | auto &Song = *modfile.GetSong(0); |
nothing calls this directly
no test coverage detected