| 456 | } |
| 457 | |
| 458 | static void |
| 459 | ScanSidTuneInfo(const SidTuneInfo &info, unsigned track, unsigned n_tracks, |
| 460 | TagHandler &handler) noexcept |
| 461 | { |
| 462 | /* album */ |
| 463 | const auto album = GetInfoString(info, 0); |
| 464 | |
| 465 | handler.OnTag(TAG_ALBUM, album.c_str()); |
| 466 | |
| 467 | if (n_tracks > 1) { |
| 468 | const auto tag_title = |
| 469 | fmt::format("{} ({}/{})", |
| 470 | album.c_str(), track, n_tracks); |
| 471 | handler.OnTag(TAG_TITLE, tag_title.c_str()); |
| 472 | } else |
| 473 | handler.OnTag(TAG_TITLE, album.c_str()); |
| 474 | |
| 475 | /* artist */ |
| 476 | const auto artist = GetInfoString(info, 1); |
| 477 | if (!artist.empty()) |
| 478 | handler.OnTag(TAG_ARTIST, artist.c_str()); |
| 479 | |
| 480 | /* genre */ |
| 481 | if (!sidplay_global->default_genre.empty()) |
| 482 | handler.OnTag(TAG_GENRE, |
| 483 | sidplay_global->default_genre.c_str()); |
| 484 | |
| 485 | /* date */ |
| 486 | const auto date = GetDateString(info); |
| 487 | if (!date.empty()) |
| 488 | handler.OnTag(TAG_DATE, date.c_str()); |
| 489 | |
| 490 | /* track */ |
| 491 | handler.OnTag(TAG_TRACK, fmt::format_int{track}.c_str()); |
| 492 | } |
| 493 | |
| 494 | static bool |
| 495 | sidplay_scan_file(Path path_fs, TagHandler &handler) noexcept |
no test coverage detected