| 345 | } |
| 346 | |
| 347 | std::string CSongState::GetChannelStateString(const CFamiTrackerModule &modfile, stChannelID chan) const { |
| 348 | if (State.empty()) |
| 349 | return "State is not ready"; |
| 350 | |
| 351 | std::string str = State.find(chan)->second.GetStateString(); |
| 352 | if (Tempo >= 0) |
| 353 | str += " Tempo: " + std::to_string(Tempo); |
| 354 | if (Speed >= 0) { |
| 355 | if (const auto pGroove = modfile.GetGroove(Speed); pGroove && GroovePos >= 0) { |
| 356 | str += " Groove: "; |
| 357 | str += {conv::to_digit<char>(Speed >> 4), conv::to_digit<char>(Speed), ' ', '<', '-'}; |
| 358 | unsigned Size = pGroove->size(); |
| 359 | for (unsigned i = 0; i < Size; ++i) |
| 360 | str += ' ' + std::to_string(pGroove->entry((i + GroovePos) % Size)); |
| 361 | } |
| 362 | else |
| 363 | str += " Speed: " + std::to_string(Speed); |
| 364 | } |
| 365 | |
| 366 | return str; |
| 367 | } |
no test coverage detected