Add playback of background/title music in game list (#1033)

* add playback of background/title music

* clang_format

* add windows multimedia build instructions

* fix typo accidentally made to arm

* address comments

* loop music

* feedback

* fix CI

* add newline

* playBGM off by default

---------

Co-authored-by: Charles <charles@superfocus.ai>
This commit is contained in:
tGecko 2024-09-26 08:12:41 +02:00 committed by GitHub
parent ddb82a690b
commit 54e2179337
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 181 additions and 17 deletions

View file

@ -68,6 +68,15 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get, QWidg
});
}
void GameListFrame::PlayBackgroundMusic(QTableWidgetItem* item) {
if (!item) {
BackgroundMusicPlayer::getInstance().stopMusic();
return;
}
const auto snd0path = QString::fromStdString(m_game_info->m_games[item->row()].snd0_path);
BackgroundMusicPlayer::getInstance().playMusic(snd0path);
}
void GameListFrame::PopulateGameList() {
this->setRowCount(m_game_info->m_games.size());
ResizeIcons(icon_size);