From 33f8deffbe004046d12b61e96831376aaa1a55a6 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 20 Mar 2026 01:01:40 +0100 Subject: [PATCH] Qt: add setting for disabling hover music --- rpcs3/rpcs3qt/game_list_base.h | 3 ++- rpcs3/rpcs3qt/game_list_frame.cpp | 29 ++++++++++++++++++++------ rpcs3/rpcs3qt/game_list_frame.h | 2 ++ rpcs3/rpcs3qt/game_list_grid.cpp | 34 +++++++++++++++---------------- rpcs3/rpcs3qt/game_list_grid.h | 3 ++- rpcs3/rpcs3qt/game_list_table.cpp | 34 +++++++++++++++---------------- rpcs3/rpcs3qt/game_list_table.h | 3 ++- rpcs3/rpcs3qt/gui_settings.h | 1 + rpcs3/rpcs3qt/main_window.cpp | 2 ++ rpcs3/rpcs3qt/main_window.ui | 12 +++++++++++ 10 files changed, 78 insertions(+), 45 deletions(-) diff --git a/rpcs3/rpcs3qt/game_list_base.h b/rpcs3/rpcs3qt/game_list_base.h index 2af79b0b01..6997594070 100644 --- a/rpcs3/rpcs3qt/game_list_base.h +++ b/rpcs3/rpcs3qt/game_list_base.h @@ -16,7 +16,8 @@ public: [[maybe_unused]] const std::map& notes_map, [[maybe_unused]] const std::map& title_map, [[maybe_unused]] const std::set& selected_item_ids, - [[maybe_unused]] bool play_hover_movies){}; + [[maybe_unused]] bool play_hover_movies, + [[maybe_unused]] bool play_hover_music){}; void set_icon_size(QSize size) { m_icon_size = std::move(size); } void set_icon_color(QColor color) { m_icon_color = std::move(color); } diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 592bb88673..7ef27ea0f9 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -215,6 +215,7 @@ void game_list_frame::LoadSettings() m_prefer_game_data_icons = m_gui_settings->GetValue(gui::gl_pref_gd_icon).toBool(); m_show_custom_icons = m_gui_settings->GetValue(gui::gl_custom_icon).toBool(); m_play_hover_movies = m_gui_settings->GetValue(gui::gl_hover_gifs).toBool(); + m_play_hover_music = m_gui_settings->GetValue(gui::gl_hover_music).toBool(); m_game_list->sync_header_actions(m_column_acts, [this](int col) { return m_gui_settings->GetGamelistColVisibility(static_cast(col)); }); } @@ -482,7 +483,7 @@ void game_list_frame::Refresh(const bool from_drive, const std::vectorclear_list(); const int scroll_position = m_game_list->verticalScrollBar()->value(); - m_game_list->populate(matching_apps, m_notes, m_titles, selected_items, m_play_hover_movies); + m_game_list->populate(matching_apps, m_notes, m_titles, selected_items, m_play_hover_movies, m_play_hover_music); m_game_list->sort(m_game_data.size(), m_sort_column, m_col_sort_order); RepaintIcons(); @@ -498,7 +499,7 @@ void game_list_frame::Refresh(const bool from_drive, const std::vectorclear_list(); - m_game_grid->populate(matching_apps, m_notes, m_titles, selected_items, m_play_hover_movies); + m_game_grid->populate(matching_apps, m_notes, m_titles, selected_items, m_play_hover_movies, m_play_hover_music); RepaintIcons(); } } @@ -521,7 +522,10 @@ void game_list_frame::OnParsingFinished() const std::string localized_icon = fmt::format("ICON0_%02d.PNG", language_index); const std::string localized_movie = fmt::format("ICON1_%02d.PAM", language_index); - const auto add_game = [this, localized_title, localized_icon, localized_movie, dev_flash, cat_unknown_localized = localized.category.unknown.toStdString(), cat_unknown = cat::cat_unknown.toStdString(), game_icon_path, _hdd, play_hover_movies = m_play_hover_movies, show_custom_icons = m_show_custom_icons](const std::string& dir_or_elf) + const auto add_game = [this, localized_title, localized_icon, localized_movie, dev_flash, game_icon_path, _hdd, + cat_unknown_localized = localized.category.unknown.toStdString(), cat_unknown = cat::cat_unknown.toStdString(), + play_hover_movies = m_play_hover_movies, play_hover_music = m_play_hover_music, show_custom_icons = m_show_custom_icons] + (const std::string& dir_or_elf) { std::unique_ptr archive; if (is_file_iso(dir_or_elf)) @@ -640,10 +644,13 @@ void game_list_frame::OnParsingFinished() } } - if (std::string audio_path = sfo_dir + "/SND0.AT3"; file_exists(audio_path)) + if (play_hover_music) { - game.info.audio_path = std::move(audio_path); - game.has_audio_file = true; + if (std::string audio_path = sfo_dir + "/SND0.AT3"; file_exists(audio_path)) + { + game.info.audio_path = std::move(audio_path); + game.has_audio_file = true; + } } const QString serial = QString::fromStdString(game.info.serial); @@ -1394,6 +1401,16 @@ void game_list_frame::SetPlayHoverGifs(bool play) } } +void game_list_frame::SetPlayHoverMusic(bool play) +{ + if (m_play_hover_music != play) + { + m_play_hover_music = play; + m_gui_settings->SetValue(gui::gl_hover_music, play); + Refresh(true); + } +} + void game_list_frame::WaitAndAbortRepaintThreads() { for (const game_info& game : m_game_data) diff --git a/rpcs3/rpcs3qt/game_list_frame.h b/rpcs3/rpcs3qt/game_list_frame.h index b8148630f9..637229bf60 100644 --- a/rpcs3/rpcs3qt/game_list_frame.h +++ b/rpcs3/rpcs3qt/game_list_frame.h @@ -88,6 +88,7 @@ public Q_SLOTS: void SetPreferGameDataIcons(bool enabled); void SetShowCustomIcons(bool show); void SetPlayHoverGifs(bool play); + void SetPlayHoverMusic(bool play); void FocusAndSelectFirstEntryIfNoneIs(); private Q_SLOTS: @@ -204,5 +205,6 @@ private: bool m_prefer_game_data_icons = false; bool m_show_custom_icons = true; bool m_play_hover_movies = true; + bool m_play_hover_music = true; std::optional> m_refresh_funcs_manage_type{std::in_place}; }; diff --git a/rpcs3/rpcs3qt/game_list_grid.cpp b/rpcs3/rpcs3qt/game_list_grid.cpp index 4daf241f5e..94fa571f7e 100644 --- a/rpcs3/rpcs3qt/game_list_grid.cpp +++ b/rpcs3/rpcs3qt/game_list_grid.cpp @@ -45,7 +45,8 @@ void game_list_grid::populate( const std::map& notes_map, const std::map& title_map, const std::set& selected_item_ids, - bool play_hover_movies) + bool play_hover_movies, + bool play_hover_music) { clear_list(); @@ -109,26 +110,23 @@ void game_list_grid::populate( } }); - if (play_hover_movies && (game->has_hover_gif || game->has_hover_pam || game->has_audio_file)) + bool check_iso = false; + + if (play_hover_movies && (game->has_hover_gif || game->has_hover_pam)) { - bool check_iso = false; + item->set_video_path(game->info.movie_path); + check_iso |= !fs::exists(game->info.movie_path); + } - if (game->has_hover_gif || game->has_hover_pam) - { - item->set_video_path(game->info.movie_path); - check_iso |= !fs::exists(game->info.movie_path); - } + if (play_hover_music && game->has_audio_file) + { + item->set_audio_path(game->info.audio_path); + check_iso |= !fs::exists(game->info.audio_path); + } - if (game->has_audio_file) - { - item->set_audio_path(game->info.audio_path); - check_iso |= !fs::exists(game->info.audio_path); - } - - if (check_iso && is_file_iso(game->info.path)) - { - item->set_iso_path(game->info.path); - } + if (check_iso && is_file_iso(game->info.path)) + { + item->set_iso_path(game->info.path); } if (selected_item_ids.contains(game->info.path + game->info.icon_path)) diff --git a/rpcs3/rpcs3qt/game_list_grid.h b/rpcs3/rpcs3qt/game_list_grid.h index e9e5890e81..0aebbe0547 100644 --- a/rpcs3/rpcs3qt/game_list_grid.h +++ b/rpcs3/rpcs3qt/game_list_grid.h @@ -19,7 +19,8 @@ public: const std::map& notes_map, const std::map& title_map, const std::set& selected_item_ids, - bool play_hover_movies) override; + bool play_hover_movies, + bool play_hover_music) override; void repaint_icons(std::vector& game_data, const QColor& icon_color, const QSize& icon_size, qreal device_pixel_ratio) override; diff --git a/rpcs3/rpcs3qt/game_list_table.cpp b/rpcs3/rpcs3qt/game_list_table.cpp index 5a5e183cd1..53d0754bce 100644 --- a/rpcs3/rpcs3qt/game_list_table.cpp +++ b/rpcs3/rpcs3qt/game_list_table.cpp @@ -207,7 +207,8 @@ void game_list_table::populate( const std::map& notes_map, const std::map& title_map, const std::set& selected_item_ids, - bool play_hover_movies) + bool play_hover_movies, + bool play_hover_music) { clear_list(); @@ -299,26 +300,23 @@ void game_list_table::populate( } }); - if (play_hover_movies && (game->has_hover_gif || game->has_hover_pam || game->has_audio_file)) + bool check_iso = false; + + if (play_hover_movies && (game->has_hover_gif || game->has_hover_pam)) { - bool check_iso = false; + icon_item->set_video_path(game->info.movie_path); + check_iso |= !fs::exists(game->info.movie_path); + } - if (game->has_hover_gif || game->has_hover_pam) - { - icon_item->set_video_path(game->info.movie_path); - check_iso |= !fs::exists(game->info.movie_path); - } + if (play_hover_music && game->has_audio_file) + { + icon_item->set_audio_path(game->info.audio_path); + check_iso |= !fs::exists(game->info.audio_path); + } - if (game->has_audio_file) - { - icon_item->set_audio_path(game->info.audio_path); - check_iso |= !fs::exists(game->info.audio_path); - } - - if (check_iso && is_file_iso(game->info.path)) - { - icon_item->set_iso_path(game->info.path); - } + if (check_iso && is_file_iso(game->info.path)) + { + icon_item->set_iso_path(game->info.path); } icon_item->setData(Qt::UserRole, index, true); diff --git a/rpcs3/rpcs3qt/game_list_table.h b/rpcs3/rpcs3qt/game_list_table.h index ac9bff64e5..24949e6baa 100644 --- a/rpcs3/rpcs3qt/game_list_table.h +++ b/rpcs3/rpcs3qt/game_list_table.h @@ -29,7 +29,8 @@ public: const std::map& notes_map, const std::map& title_map, const std::set& selected_item_ids, - bool play_hover_movies) override; + bool play_hover_movies, + bool play_hover_music) override; void repaint_icons(std::vector& game_data, const QColor& icon_color, const QSize& icon_size, qreal device_pixel_ratio) override; diff --git a/rpcs3/rpcs3qt/gui_settings.h b/rpcs3/rpcs3qt/gui_settings.h index bdc6401031..561b07a9c4 100644 --- a/rpcs3/rpcs3qt/gui_settings.h +++ b/rpcs3/rpcs3qt/gui_settings.h @@ -217,6 +217,7 @@ namespace gui const gui_save gl_pref_gd_icon = gui_save(game_list, "pref_gd_icon", false); const gui_save gl_custom_icon = gui_save(game_list, "custom_icon", true); const gui_save gl_hover_gifs = gui_save(game_list, "hover_gifs", true); + const gui_save gl_hover_music = gui_save(game_list, "hover_music", true); const gui_save fs_emulator_dir_list = gui_save(fs, "emulator_dir_list", QStringList()); const gui_save fs_dev_hdd0_list = gui_save(fs, "dev_hdd0_list", QStringList()); diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index d586ac55e4..b7900ce4d8 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -3412,6 +3412,7 @@ void main_window::CreateConnects() connect(ui->actionPreferGameDataIcons, &QAction::triggered, m_game_list_frame, &game_list_frame::SetPreferGameDataIcons); connect(ui->showCustomIconsAct, &QAction::triggered, m_game_list_frame, &game_list_frame::SetShowCustomIcons); connect(ui->playHoverGifsAct, &QAction::triggered, m_game_list_frame, &game_list_frame::SetPlayHoverGifs); + connect(ui->playHoverMusicAct, &QAction::triggered, m_game_list_frame, &game_list_frame::SetPlayHoverMusic); connect(m_game_list_frame, &game_list_frame::RequestIconSizeChange, this, [this](int val) { @@ -3718,6 +3719,7 @@ void main_window::ConfigureGuiFromSettings() ui->actionPreferGameDataIcons->setChecked(m_gui_settings->GetValue(gui::gl_pref_gd_icon).toBool()); ui->showCustomIconsAct->setChecked(m_gui_settings->GetValue(gui::gl_custom_icon).toBool()); ui->playHoverGifsAct->setChecked(m_gui_settings->GetValue(gui::gl_hover_gifs).toBool()); + ui->playHoverMusicAct->setChecked(m_gui_settings->GetValue(gui::gl_hover_music).toBool()); m_is_list_mode = m_gui_settings->GetValue(gui::gl_listMode).toBool(); diff --git a/rpcs3/rpcs3qt/main_window.ui b/rpcs3/rpcs3qt/main_window.ui index ba72c86a1e..8fcf4ac610 100644 --- a/rpcs3/rpcs3qt/main_window.ui +++ b/rpcs3/rpcs3qt/main_window.ui @@ -372,6 +372,7 @@ + @@ -1524,6 +1525,17 @@ Boot ISO + + + true + + + true + + + Play Hover Music + +