PSF: move resolution flags to enum

This commit is contained in:
Megamouse 2022-06-01 20:20:08 +02:00
parent 60d80fd5fc
commit 4f03cf7e1e
4 changed files with 30 additions and 15 deletions

View File

@ -21,6 +21,16 @@ namespace psf
dts = 1 << 9, // DTS 5.1 Ch.
};
enum resolution_flag : s32
{
_480p = 1 << 0,
_576p = 1 << 1,
_720p = 1 << 2,
_1080p = 1 << 3,
_480p_16_9 = 1 << 4,
_576p_16_9 = 1 << 5,
};
enum class format : u16
{
array = 0x0004, // claimed to be a non-NTS string (char array)

View File

@ -47,6 +47,18 @@ QString Localized::GetVerboseTimeByMs(quint64 elapsed_ms, bool show_days) const
return str_seconds;
}
Localized::resolution::resolution()
: mode({
{ psf::resolution_flag::_480p, tr("480p") },
{ psf::resolution_flag::_576p, tr("576p") },
{ psf::resolution_flag::_720p, tr("720p") },
{ psf::resolution_flag::_1080p, tr("1080p") },
{ psf::resolution_flag::_480p_16_9, tr("480p 16:9") },
{ psf::resolution_flag::_576p_16_9, tr("576p 16:9") },
})
{
}
Localized::sound::sound()
: format({
{ psf::sound_format_flag::lpcm_2, tr("LPCM 2.0") },

View File

@ -111,15 +111,8 @@ public:
const struct resolution
{
// there might be different values for other categories
const std::map<u32, QString> mode
{
{ 1 << 0, tr("480p") },
{ 1 << 1, tr("576p") },
{ 1 << 2, tr("720p") },
{ 1 << 3, tr("1080p") },
{ 1 << 4, tr("480p 16:9") },
{ 1 << 5, tr("576p 16:9") },
};
resolution();
const std::map<u32, QString> mode;
} resolution;
const struct sound

View File

@ -451,12 +451,12 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
{
const std::map<u32, std::string> resolutions
{
{ 1 << 0, fmt::format("%s", video_resolution::_480) },
{ 1 << 1, fmt::format("%s", video_resolution::_576) },
{ 1 << 2, fmt::format("%s", video_resolution::_720) },
{ 1 << 3, fmt::format("%s", video_resolution::_1080) },
// { 1 << 4, fmt::format("%s", video_resolution::_480p_16:9) },
// { 1 << 5, fmt::format("%s", video_resolution::_576p_16:9) },
{ psf::resolution_flag::_480p, fmt::format("%s", video_resolution::_480) },
{ psf::resolution_flag::_576p, fmt::format("%s", video_resolution::_576) },
{ psf::resolution_flag::_720p, fmt::format("%s", video_resolution::_720) },
{ psf::resolution_flag::_1080p, fmt::format("%s", video_resolution::_1080) },
// { psf::resolution_flag::_480p_16_9, fmt::format("%s", video_resolution::_480p_16:9) },
// { psf::resolution_flag::_576p_16_9, fmt::format("%s", video_resolution::_576p_16:9) },
};
const int saved_index = ui->resBox->currentIndex();