Skip to content

Commit 1f9e2d6

Browse files
libretroadminLibretroAdmin
authored andcommitted
settings: migrate the microphone block frames setting to a single-source def file
Unblocked by whitespace-tolerant extraction; the last plain-grammar table outside the entangled and undecided exceptions. Performed by tools/settings_migrate_group.py with the standard battery including the platform-profile lanes and the integrated enum consolidation stage.
1 parent 60ff81d commit 1f9e2d6

7 files changed

Lines changed: 86 additions & 14 deletions

File tree

configuration.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,9 @@ static struct config_bool_setting *populate_settings_bool(
19541954
#include "settings/settings_def_video_fullscreen.h"
19551955
#define SETTINGS_DEF_CONFIG_PASS
19561956
#include "settings/settings_def_video_sync.h"
1957+
#ifdef HAVE_MICROPHONE
1958+
#include "settings/settings_def_microphone_block.h"
1959+
#endif
19571960
#include "settings/settings_def_updater_backup.h"
19581961
#include "settings/settings_def_updater_experimental.h"
19591962
#include "settings/settings_def_updater_extract.h"
@@ -2382,6 +2385,9 @@ static struct config_float_setting *populate_settings_float(
23822385
#include "settings/settings_def_video_fullscreen.h"
23832386
#define SETTINGS_DEF_CONFIG_PASS
23842387
#include "settings/settings_def_video_sync.h"
2388+
#ifdef HAVE_MICROPHONE
2389+
#include "settings/settings_def_microphone_block.h"
2390+
#endif
23852391
#include "settings/settings_def_updater_backup.h"
23862392
#include "settings/settings_def_updater_experimental.h"
23872393
#include "settings/settings_def_updater_extract.h"
@@ -2722,7 +2728,6 @@ static struct config_uint_setting *populate_settings_uint(
27222728
#ifdef HAVE_MICROPHONE
27232729
SETTING_UINT("microphone_latency", &settings->uints.microphone_latency, false, 0 /* TODO */, false);
27242730
SETTING_UINT("microphone_resampler_quality", &settings->uints.microphone_resampler_quality, true, DEFAULT_AUDIO_RESAMPLER_QUALITY_LEVEL, false);
2725-
SETTING_UINT("microphone_block_frames", &settings->uints.microphone_block_frames, true, 0, false);
27262731
SETTING_UINT("microphone_rate", &settings->uints.microphone_sample_rate, true, DEFAULT_INPUT_RATE, false);
27272732
#ifdef HAVE_WASAPI
27282733
SETTING_UINT("microphone_wasapi_sh_buffer_length", &settings->uints.microphone_wasapi_sh_buffer_length, true, DEFAULT_WASAPI_MICROPHONE_SH_BUFFER_LENGTH, false);
@@ -2770,6 +2775,9 @@ static struct config_uint_setting *populate_settings_uint(
27702775
#include "settings/settings_def_video_fullscreen.h"
27712776
#define SETTINGS_DEF_CONFIG_PASS
27722777
#include "settings/settings_def_video_sync.h"
2778+
#ifdef HAVE_MICROPHONE
2779+
#include "settings/settings_def_microphone_block.h"
2780+
#endif
27732781
#include "settings/settings_def_updater_backup.h"
27742782
#include "settings/settings_def_updater_experimental.h"
27752783
#include "settings/settings_def_updater_extract.h"
@@ -3133,6 +3141,9 @@ static struct config_int_setting *populate_settings_int(
31333141
#include "settings/settings_def_video_fullscreen.h"
31343142
#define SETTINGS_DEF_CONFIG_PASS
31353143
#include "settings/settings_def_video_sync.h"
3144+
#ifdef HAVE_MICROPHONE
3145+
#include "settings/settings_def_microphone_block.h"
3146+
#endif
31363147
#include "settings/settings_def_updater_backup.h"
31373148
#include "settings/settings_def_updater_experimental.h"
31383149
#include "settings/settings_def_updater_extract.h"

intl/msg_hash_lbl.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,6 @@ MSG_HASH(
359359
MENU_ENUM_LABEL_MICROPHONE_LATENCY,
360360
MENU_ENUM_LABEL_MICROPHONE_LATENCY_STR
361361
)
362-
MSG_HASH(
363-
MENU_ENUM_LABEL_MICROPHONE_BLOCK_FRAMES,
364-
MENU_ENUM_LABEL_MICROPHONE_BLOCK_FRAMES_STR
365-
)
366362
MSG_HASH(
367363
MENU_ENUM_LABEL_MICROPHONE_WASAPI_EXCLUSIVE_MODE,
368364
MENU_ENUM_LABEL_MICROPHONE_WASAPI_EXCLUSIVE_MODE_STR

intl/msg_hash_us.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ static const char *const msg_hash_us_lbl_strs[] = {
537537
#define S_FLOAT_NS(f, T, n, d, rnd, sd, df, c, mn, mx, st, ok, rp, us) n,
538538
#include "../settings/settings_def_video_fullscreen.h"
539539
#include "../settings/settings_def_video_sync.h"
540+
#include "../settings/settings_def_microphone_block.h"
540541
#include "../settings/settings_def_updater_backup.h"
541542
#include "../settings/settings_def_updater_experimental.h"
542543
#include "../settings/settings_def_updater_extract.h"
@@ -629,6 +630,7 @@ static const uint32_t msg_hash_us_lbl_ids[] = {
629630
#define S_FLOAT_NS(f, T, n, d, rnd, sd, df, c, mn, mx, st, ok, rp, us) (uint32_t)MENU_ENUM_LABEL_##T,
630631
#include "../settings/settings_def_video_fullscreen.h"
631632
#include "../settings/settings_def_video_sync.h"
633+
#include "../settings/settings_def_microphone_block.h"
632634
#include "../settings/settings_def_updater_backup.h"
633635
#include "../settings/settings_def_updater_experimental.h"
634636
#include "../settings/settings_def_updater_extract.h"

intl/msg_hash_us.h

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,10 +1660,38 @@ MSG_HASH(
16601660
MENU_ENUM_SUBLABEL_MICROPHONE_RESAMPLER_DRIVER,
16611661
"Microphone resampler driver to use."
16621662
)
1663-
MSG_HASH(
1664-
MENU_ENUM_LABEL_VALUE_MICROPHONE_BLOCK_FRAMES,
1665-
"Microphone Block Frames"
1666-
)
1663+
/* GENERATED REGION: microphone block frames setting (see settings_def_microphone_block.h). */
1664+
#define SETTINGS_DEF_STRINGS_PASS
1665+
#define S_BOOL(f, T, n, d, sd, df, c, us, sub) \
1666+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us) \
1667+
MSG_HASH(MENU_ENUM_SUBLABEL_##T, sub)
1668+
#define S_BOOL_NS(f, T, n, d, sd, df, c, us) \
1669+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us)
1670+
#define S_UINT(f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp, us, sub) \
1671+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us) \
1672+
MSG_HASH(MENU_ENUM_SUBLABEL_##T, sub)
1673+
#define S_UINT_NS(f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp, us) \
1674+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us)
1675+
#define S_INT(f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp, us, sub) \
1676+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us) \
1677+
MSG_HASH(MENU_ENUM_SUBLABEL_##T, sub)
1678+
#define S_INT_NS(f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp, us) \
1679+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us)
1680+
#define S_FLOAT(f, T, n, d, rnd, sd, df, c, mn, mx, st, ok, rp, us, sub) \
1681+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us) \
1682+
MSG_HASH(MENU_ENUM_SUBLABEL_##T, sub)
1683+
#define S_FLOAT_NS(f, T, n, d, rnd, sd, df, c, mn, mx, st, ok, rp, us) \
1684+
MSG_HASH(MENU_ENUM_LABEL_VALUE_##T, us)
1685+
#include "../settings/settings_def_microphone_block.h"
1686+
#undef S_BOOL
1687+
#undef S_BOOL_NS
1688+
#undef S_UINT
1689+
#undef S_UINT_NS
1690+
#undef S_INT
1691+
#undef S_INT_NS
1692+
#undef S_FLOAT
1693+
#undef S_FLOAT_NS
1694+
#undef SETTINGS_DEF_STRINGS_PASS
16671695
#endif
16681696
MSG_HASH(
16691697
MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_DRIVER,

menu/menu_setting.c

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14839,10 +14839,32 @@ static bool setting_append_list(
1483914839
#ifdef RARCH_MOBILE
1484014840
{
1484114841
static const setting_desc_t mic_block_desc[] = {
14842-
SDESC_UINT_ROW(microphone_block_frames,
14843-
MICROPHONE_BLOCK_FRAMES, 0,
14844-
SD_FLAG_ADVANCED, 0, 0,
14845-
0, 0, 0, 0, NULL, NULL)
14842+
/* GENERATED: rows come from settings_def_microphone_block.h in order. */
14843+
#define S_BOOL(f, T, n, d, sd, df, c, us, sub) \
14844+
SDESC_BOOL_ROW(f, T, d, sd, df, c),
14845+
#define S_BOOL_NS(f, T, n, d, sd, df, c, us) \
14846+
SDESC_BOOL_ROW(f, T, d, sd, df, c),
14847+
#define S_UINT(f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp, us, sub) \
14848+
SDESC_UINT_ROW(f, T, d, sd, df, c, mn, mx, st, ob, ok, rp),
14849+
#define S_UINT_NS(f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp, us) \
14850+
SDESC_UINT_ROW(f, T, d, sd, df, c, mn, mx, st, ob, ok, rp),
14851+
#define S_INT(f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp, us, sub) \
14852+
SDESC_INT_ROW(f, T, d, sd, df, c, mn, mx, st, ob, ok, rp),
14853+
#define S_INT_NS(f, T, n, d, sd, df, c, mn, mx, st, ob, ok, rp, us) \
14854+
SDESC_INT_ROW(f, T, d, sd, df, c, mn, mx, st, ob, ok, rp),
14855+
#define S_FLOAT(f, T, n, d, rnd, sd, df, c, mn, mx, st, ok, rp, us, sub) \
14856+
SDESC_FLOAT_ROW(f, T, d, rnd, sd, df, c, mn, mx, st, ok, rp),
14857+
#define S_FLOAT_NS(f, T, n, d, rnd, sd, df, c, mn, mx, st, ok, rp, us) \
14858+
SDESC_FLOAT_ROW(f, T, d, rnd, sd, df, c, mn, mx, st, ok, rp),
14859+
#include "../settings/settings_def_microphone_block.h"
14860+
#undef S_BOOL
14861+
#undef S_BOOL_NS
14862+
#undef S_UINT
14863+
#undef S_UINT_NS
14864+
#undef S_INT
14865+
#undef S_INT_NS
14866+
#undef S_FLOAT
14867+
#undef S_FLOAT_NS
1484614868
};
1484714869
settings_list_add_desc(list, list_info, settings,
1484814870
mic_block_desc, ARRAY_SIZE(mic_block_desc),

msg_hash_lbl_str.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
#define MENU_ENUM_LABEL_MICROPHONE_DRIVER_STR "microphone_driver"
100100
#define MENU_ENUM_LABEL_MICROPHONE_INPUT_RATE_STR "microphone_input_rate"
101101
#define MENU_ENUM_LABEL_MICROPHONE_LATENCY_STR "microphone_latency"
102-
#define MENU_ENUM_LABEL_MICROPHONE_BLOCK_FRAMES_STR "microphone_block_frames"
103102
#define MENU_ENUM_LABEL_MICROPHONE_WASAPI_EXCLUSIVE_MODE_STR "microphone_wasapi_exclusive_mode"
104103
#define MENU_ENUM_LABEL_MICROPHONE_WASAPI_FLOAT_FORMAT_STR "microphone_wasapi_float_format"
105104
#define MENU_ENUM_LABEL_MICROPHONE_WASAPI_SH_BUFFER_LENGTH_STR "microphone_wasapi_sh_buffer_length"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* Single-source definitions: microphone block frames setting.
2+
* Grammar identical to settings_def_video_sync.h plus S_FLOAT and
3+
* the _NS no-sublabel variants; the descriptor argument span
4+
* matches SDESC_<kind>_ROW; row order is menu display order;
5+
* h2json.py parses these rows for the Crowdin source upload. */
6+
7+
#ifdef HAVE_MICROPHONE
8+
#ifdef RARCH_MOBILE
9+
S_UINT_NS(microphone_block_frames, MICROPHONE_BLOCK_FRAMES,
10+
"microphone_block_frames",
11+
0, SD_FLAG_ADVANCED, 0, 0, 0, 0, 0, 0, NULL, NULL,
12+
"Microphone Block Frames")
13+
#endif
14+
#endif

0 commit comments

Comments
 (0)