mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-24 19:36:17 +00:00
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:
parent
ddb82a690b
commit
54e2179337
17 changed files with 181 additions and 17 deletions
|
@ -501,9 +501,29 @@ void MainWindow::CreateConnects() {
|
|||
isIconBlack = false;
|
||||
}
|
||||
});
|
||||
|
||||
connect(m_game_grid_frame.get(), &QTableWidget::cellClicked, this,
|
||||
&MainWindow::PlayBackgroundMusic);
|
||||
connect(m_game_list_frame.get(), &QTableWidget::cellClicked, this,
|
||||
&MainWindow::PlayBackgroundMusic);
|
||||
}
|
||||
|
||||
void MainWindow::PlayBackgroundMusic() {
|
||||
if (isGameRunning || !Config::getPlayBGM()) {
|
||||
BackgroundMusicPlayer::getInstance().stopMusic();
|
||||
return;
|
||||
}
|
||||
int itemID = isTableList ? m_game_list_frame->currentItem()->row()
|
||||
: m_game_grid_frame->crtRow * m_game_grid_frame->columnCnt +
|
||||
m_game_grid_frame->crtColumn;
|
||||
|
||||
const auto snd0path = QString::fromStdString(m_game_info->m_games[itemID].snd0_path);
|
||||
BackgroundMusicPlayer::getInstance().playMusic(snd0path);
|
||||
}
|
||||
|
||||
void MainWindow::StartGame() {
|
||||
isGameRunning = true;
|
||||
BackgroundMusicPlayer::getInstance().stopMusic();
|
||||
QString gamePath = "";
|
||||
int table_mode = Config::getTableMode();
|
||||
if (table_mode == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue