| 167 | } |
| 168 | |
| 169 | void CSoundDriver::PlayerTick() { |
| 170 | if (!m_pTempoCounter) |
| 171 | return; |
| 172 | m_pPlayerCursor->Tick(); |
| 173 | if (parent_) |
| 174 | parent_->OnTick(); |
| 175 | |
| 176 | int SteppedRows = 0; // // // |
| 177 | |
| 178 | // Fetch next row |
| 179 | // while (m_pTempoCounter->CanStepRow()) { |
| 180 | if (m_pTempoCounter->CanStepRow()) { |
| 181 | if (m_bDoHalt) |
| 182 | m_bHaltRequest = true; |
| 183 | else |
| 184 | ++SteppedRows; |
| 185 | m_pTempoCounter->StepRow(); // // // |
| 186 | |
| 187 | modfile_->GetChannelOrder().ForeachChannel([&] (stChannelID i) { |
| 188 | StepRow(i); |
| 189 | }); |
| 190 | |
| 191 | if (parent_) |
| 192 | parent_->OnStepRow(); |
| 193 | } |
| 194 | m_pTempoCounter->Tick(); // // // |
| 195 | |
| 196 | // Update player |
| 197 | if (parent_ && parent_->ShouldStopPlayer()) // // // |
| 198 | m_bHaltRequest = true; |
| 199 | else if (SteppedRows > 0 && !m_bDoHalt) { |
| 200 | // Jump |
| 201 | if (m_iJumpToPattern != -1) |
| 202 | m_pPlayerCursor->DoBxx(m_iJumpToPattern); |
| 203 | // Skip |
| 204 | else if (m_iSkipToRow != -1) |
| 205 | m_pPlayerCursor->DoDxx(m_iSkipToRow); |
| 206 | // or just move on |
| 207 | else |
| 208 | while (SteppedRows--) |
| 209 | m_pPlayerCursor->StepRow(); |
| 210 | |
| 211 | m_iJumpToPattern = -1; |
| 212 | m_iSkipToRow = -1; |
| 213 | |
| 214 | if (parent_) |
| 215 | parent_->OnUpdateRow(m_pPlayerCursor->GetCurrentFrame(), m_pPlayerCursor->GetCurrentRow()); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | void CSoundDriver::UpdateChannels() { |
| 220 | for (auto &chip : chips_) |
nothing calls this directly
no test coverage detected