Add menu setting 'Audio Resampler Quality'

This commit is contained in:
twinaphex 2018-01-01 06:53:31 +01:00
parent 3145708106
commit 6ccde2b907
21 changed files with 135 additions and 0 deletions

View File

@ -3215,3 +3215,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3209,3 +3209,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3325,3 +3325,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3078,3 +3078,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3247,3 +3247,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3305,3 +3305,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Esegue automaticamente la scansione dei contenuti caricati in modo che vengano visualizzati all'interno delle playlist.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scansione del file completata")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3273,3 +3273,7 @@ MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_OPACITY,
"ウィンドウの不透明性")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3210,3 +3210,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -1385,3 +1385,5 @@ MSG_HASH(MENU_ENUM_LABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"automatically_add_content_to_playlist")
MSG_HASH(MENU_ENUM_LABEL_VIDEO_WINDOW_OPACITY,
"video_window_opacity")
MSG_HASH(MENU_ENUM_LABEL_AUDIO_RESAMPLER_QUALITY,
"audio_resampler_quality")

View File

@ -3080,3 +3080,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3345,3 +3345,7 @@ MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Skanowanie pliku zakończone")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_OPACITY,
"Przezroczystość okna")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -4190,3 +4190,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3185,3 +3185,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3268,3 +3268,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3353,3 +3353,7 @@ MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_OPACITY,
"Window Opacity")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -3233,3 +3233,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST,
"Automatically scans loaded content so they appear inside playlists.")
MSG_HASH(MSG_SCANNING_OF_FILE_FINISHED,
"Scanning of file finished")
MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
"Audio Resampler Quality")
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY,
"Lower this value to favor performance/lower latency over audio quality, increase if you want better audio quality at the expense of performance/lower latency.")

View File

@ -17,6 +17,7 @@
#include <compat/strl.h>
#include <string/stdstring.h>
#include <lists/string_list.h>
#include <audio/audio_resampler.h>
#ifdef HAVE_CONFIG_H
#include "../../config.h"
@ -182,6 +183,52 @@ static void menu_action_setting_disp_set_label_shader_filter_pass(
}
}
static void menu_action_setting_disp_set_label_audio_resampler_quality(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
*s = '\0';
*w = 19;
strlcpy(s2, path, len2);
if (settings)
{
switch (settings->uints.audio_resampler_quality)
{
case RESAMPLER_QUALITY_DONTCARE:
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DONT_CARE),
len);
break;
case RESAMPLER_QUALITY_LOWEST:
strlcpy(s, "Lowest",
len);
break;
case RESAMPLER_QUALITY_LOWER:
strlcpy(s, "Lower",
len);
break;
case RESAMPLER_QUALITY_HIGHER:
strlcpy(s, "Higher",
len);
break;
case RESAMPLER_QUALITY_HIGHEST:
strlcpy(s, "Highest",
len);
break;
case RESAMPLER_QUALITY_NORMAL:
strlcpy(s, "Normal",
len);
break;
}
}
}
static void menu_action_setting_disp_set_label_filter(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
@ -1726,6 +1773,10 @@ static int menu_cbs_init_bind_get_string_representation_compare_label(
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_remap_file_load);
break;
case MENU_ENUM_LABEL_AUDIO_RESAMPLER_QUALITY:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_audio_resampler_quality);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_FILTER_PASS:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_shader_filter_pass);

View File

@ -220,6 +220,7 @@ default_sublabel_macro(action_bind_sublabel_thumbnails, MENU_
default_sublabel_macro(action_bind_sublabel_timedate_enable, MENU_ENUM_SUBLABEL_TIMEDATE_ENABLE)
default_sublabel_macro(action_bind_sublabel_battery_level_enable, MENU_ENUM_SUBLABEL_BATTERY_LEVEL_ENABLE)
default_sublabel_macro(action_bind_sublabel_navigation_wraparound, MENU_ENUM_SUBLABEL_NAVIGATION_WRAPAROUND)
default_sublabel_macro(action_bind_sublabel_audio_resampler_quality, MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY)
default_sublabel_macro(action_bind_sublabel_netplay_enable_host, MENU_ENUM_SUBLABEL_NETPLAY_ENABLE_HOST)
default_sublabel_macro(action_bind_sublabel_netplay_enable_client, MENU_ENUM_SUBLABEL_NETPLAY_ENABLE_CLIENT)
default_sublabel_macro(action_bind_sublabel_netplay_disconnect, MENU_ENUM_SUBLABEL_NETPLAY_DISCONNECT)
@ -455,6 +456,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
{
switch (cbs->enum_idx)
{
case MENU_ENUM_LABEL_AUDIO_RESAMPLER_QUALITY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_resampler_quality);
break;
case MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_icons_enable);
break;

View File

@ -5893,6 +5893,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_AUDIO_LATENCY,
PARSE_ONLY_UINT, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_AUDIO_RESAMPLER_QUALITY,
PARSE_ONLY_UINT, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_AUDIO_RATE_CONTROL_DELTA,
PARSE_ONLY_FLOAT, false);

View File

@ -28,6 +28,7 @@
#include <string/stdstring.h>
#include <lists/string_list.h>
#include <streams/file_stream.h>
#include <audio/audio_resampler.h>
#include <compat/strl.h>
@ -4081,6 +4082,19 @@ static bool setting_append_list(
menu_settings_list_current_add_range(list, list_info, 0, 512, 1.0, true, true);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
CONFIG_UINT(
list, list_info,
&settings->uints.audio_resampler_quality,
MENU_ENUM_LABEL_AUDIO_RESAMPLER_QUALITY,
MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_QUALITY,
audio_resampler_quality_level,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, RESAMPLER_QUALITY_DONTCARE, RESAMPLER_QUALITY_HIGHEST, 1.0, true, true);
CONFIG_FLOAT(
list, list_info,
audio_get_float_ptr(AUDIO_ACTION_RATE_CONTROL_DELTA),

View File

@ -1093,6 +1093,7 @@ enum msg_hash_enums
MENU_LABEL(AUDIO_MIXER_VOLUME),
MENU_LABEL(AUDIO_RATE_CONTROL_DELTA),
MENU_LABEL(AUDIO_LATENCY),
MENU_LABEL(AUDIO_RESAMPLER_QUALITY),
MENU_LABEL(AUDIO_WASAPI_EXCLUSIVE_MODE),
MENU_LABEL(AUDIO_WASAPI_FLOAT_FORMAT),
MENU_LABEL(AUDIO_WASAPI_SH_BUFFER_LENGTH),