1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-13 22:16:45 +00:00
nxdumptool/source/views/titles_tab.cpp

181 lines
7.3 KiB
C++
Raw Normal View History

/*
* titles_tab.cpp
*
2024-04-12 10:47:36 +01:00
* Copyright (c) 2020-2024, DarkMatterCore <pabloacurielz@gmail.com>.
*
* This file is part of nxdumptool (https://github.com/DarkMatterCore/nxdumptool).
*
* nxdumptool is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* nxdumptool is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <views/titles_tab.hpp>
using namespace brls::i18n::literals; /* For _i18n. */
namespace nxdt::views
{
2021-06-24 16:53:36 +01:00
TitlesTabPopup::TitlesTabPopup(const TitleApplicationMetadata *app_metadata, bool is_system) : brls::TabFrame(), app_metadata(app_metadata), is_system(is_system)
{
u64 title_id = this->app_metadata->title_id;
bool user_ret = false;
2021-06-24 16:53:36 +01:00
if (!this->is_system)
{
/* Get user application data. */
user_ret = titleGetUserApplicationData(title_id, &(this->user_app_data));
} else {
/* Get system title info. */
this->system_title_info = titleGetInfoFromStorageByTitleId(NcmStorageId_BuiltInSystem, title_id);
}
/* Make sure we got title information. This should never get triggered. */
2021-06-24 16:53:36 +01:00
if ((!this->is_system && !user_ret) || (this->is_system && !this->system_title_info)) throw fmt::format("Failed to retrieve title information for {:016X}.", title_id);
2021-06-24 16:53:36 +01:00
/* Add tabs. */
this->addTab("Red", new brls::Rectangle(nvgRGB(255, 0, 0)));
this->addTab("Green", new brls::Rectangle(nvgRGB(0, 255, 0)));
this->addTab("Blue", new brls::Rectangle(nvgRGB(0, 0, 255)));
}
TitlesTabPopup::~TitlesTabPopup()
2021-06-24 16:53:36 +01:00
{
/* Free title information. */
if (!this->is_system)
{
titleFreeUserApplicationData(&(this->user_app_data));
} else {
titleFreeTitleInfo(&(this->system_title_info));
}
}
TitlesTabItem::TitlesTabItem(const TitleApplicationMetadata *app_metadata, bool is_system, bool click_anim) : brls::ListItem(std::string(app_metadata->lang_entry.name), "", ""), \
app_metadata(app_metadata), \
is_system(is_system), \
click_anim(click_anim)
{
/* Set sublabel. */
if (!this->is_system) this->setSubLabel(std::string(app_metadata->lang_entry.author));
2021-06-24 16:53:36 +01:00
/* Set thumbnail (if needed). */
if (app_metadata->icon && app_metadata->icon_size) this->setThumbnail(app_metadata->icon, app_metadata->icon_size);
/* Set value. */
this->setValue(fmt::format("{:016X}", this->app_metadata->title_id), false, false);
}
void TitlesTabItem::playClickAnimation(void)
{
if (this->click_anim) brls::View::playClickAnimation();
}
TitlesTab::TitlesTab(RootView *root_view, bool is_system) : LayeredErrorFrame("titles_tab/no_titles_available"_i18n), root_view(root_view), is_system(is_system)
{
/* Populate list. */
this->PopulateList(this->root_view->GetApplicationMetadataInfo(this->is_system));
2021-06-24 16:53:36 +01:00
/* Subscribe to the title event if this is the user titles tab. */
if (!this->is_system)
{
this->title_task_sub = this->root_view->RegisterTitleMetadataTaskListener([this](const nxdt::tasks::TitleApplicationMetadataInfo& app_metadata_info) {
/* Update list. */
this->PopulateList(app_metadata_info);
});
}
}
TitlesTab::~TitlesTab()
{
/* Unregister task listener if this is the user titles tab. */
if (!this->is_system) this->root_view->UnregisterTitleMetadataTaskListener(this->title_task_sub);
}
void TitlesTab::PopulateList(const nxdt::tasks::TitleApplicationMetadataInfo& app_metadata_info)
{
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
/* Block user inputs. */
brls::Application::blockInputs();
/* Populate variables. */
TitleApplicationMetadata **app_metadata = app_metadata_info.app_metadata;
const u32 app_metadata_count = app_metadata_info.app_metadata_count;
bool update_focused_view = this->IsListItemFocused();
int focus_stack_index = this->GetFocusStackViewIndex();
/* If needed, switch to the error frame *before* cleaning up our list. */
if (!app_metadata_count) this->SwitchLayerView(true);
/* Clear list. */
this->list->clear();
this->list->invalidate(true);
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
/* Return immediately if we have no application metadata. */
if (!app_metadata_count)
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
{
brls::Application::unblockInputs();
return;
}
/* Populate list. */
for(u32 i = 0; i < app_metadata_count; i++)
2021-06-24 16:53:36 +01:00
{
/* Create list item. */
TitlesTabItem *item = new TitlesTabItem(app_metadata[i], this->is_system);
2021-06-24 16:53:36 +01:00
/* Register click event. */
item->getClickEvent()->subscribe([](brls::View *view) {
2021-06-24 16:53:36 +01:00
TitlesTabItem *item = static_cast<TitlesTabItem*>(view);
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
const TitleApplicationMetadata *item_app_metadata = item->GetApplicationMetadata();
2021-06-24 16:53:36 +01:00
bool is_system = item->IsSystemTitle();
2021-06-24 16:53:36 +01:00
/* Create popup. */
TitlesTabPopup *popup = nullptr;
2021-06-24 16:53:36 +01:00
try {
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
popup = new TitlesTabPopup(item_app_metadata, is_system);
2021-06-24 16:53:36 +01:00
} catch(const std::string& msg) {
LOG_MSG_DEBUG("%s", msg.c_str());
2021-06-24 16:53:36 +01:00
if (popup) delete popup;
return;
}
2021-06-24 16:53:36 +01:00
/* Display popup. */
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
std::string name = std::string(item_app_metadata->lang_entry.name);
std::string tid = fmt::format("{:016X}", item_app_metadata->title_id);
std::string sub_left = (!is_system ? std::string(item_app_metadata->lang_entry.author) : tid);
2021-06-24 16:53:36 +01:00
std::string sub_right = (!is_system ? tid : "");
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
if (item_app_metadata->icon && item_app_metadata->icon_size)
2021-06-24 16:53:36 +01:00
{
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
brls::PopupFrame::open(name, item_app_metadata->icon, item_app_metadata->icon_size, popup, sub_left, sub_right);
2021-06-24 16:53:36 +01:00
} else {
brls::PopupFrame::open(name, popup, sub_left, sub_right);
}
});
2021-06-24 16:53:36 +01:00
/* Add list item to our view. */
this->list->addView(item);
2021-06-24 16:53:36 +01:00
}
/* Update focus stack, if needed. */
if (focus_stack_index > -1) this->UpdateFocusStackViewAtIndex(focus_stack_index, this->GetListFirstFocusableChild());
/* Switch to the list. */
this->list->invalidate(true);
this->SwitchLayerView(false, update_focused_view, focus_stack_index < 0);
title: migrate application metadata filtering logic to background thread titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions. Other changes include: * title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata. * title: add `has_patch` field to TitleGameCardApplicationMetadata struct. * title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata. * title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata. * title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray(). * title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray(). * title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString(). * title: add extra debug log messages to some functions. * title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays. * title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo(). * title: update titleGetDisplayVersionString() to also support base application titles. * title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array. * GameCardStatusTask: add GetGameCardStatus() method. * GameCardTab: fix callback argument type in class constructor. * GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status. * RootView: add GetGameCardStatus() method. * StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method. * TitleMetadataTask: turn GetApplicationMetadata() into an inline method. * TitleMetadataTask: move debug log messages around. * TitlesTab: update PopulateList() to block user inputs while updating the titles list. * UmsTask: turn GetUmsDevices() into an inline method. * UsbHostTask: turn GetUsbHostSpeed() into an inline method.
2024-05-05 20:42:32 +01:00
/* Unblock user inputs. */
brls::Application::unblockInputs();
}
}