From 339b320df0dc7ada7aaeeafe69fbbb1e54c4c6dd Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 21 Feb 2024 11:10:42 +0100 Subject: [PATCH] modules: use actual alignment values in parameter lists --- modules/codec/dvbsub.c | 12 +++++++++++- modules/codec/subsdec.c | 2 +- modules/codec/zvbi.c | 14 ++++++++++++-- modules/spu/common.h | 15 ++++++++++++++- modules/spu/logo.c | 1 - modules/spu/mosaic.c | 12 +++++++++++- 6 files changed, 49 insertions(+), 7 deletions(-) diff --git a/modules/codec/dvbsub.c b/modules/codec/dvbsub.c index c65ef84e00..3741762053 100644 --- a/modules/codec/dvbsub.c +++ b/modules/codec/dvbsub.c @@ -99,7 +99,17 @@ #define ENC_POSY_TEXT N_("Encoding Y coordinate") #define ENC_POSY_LONGTEXT N_("Y coordinate of the encoded subtitle" ) -static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; +static const int pi_pos_values[] = { + 0, + SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_RIGHT, + SUBPICTURE_ALIGN_TOP, + SUBPICTURE_ALIGN_BOTTOM, + SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT, + SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT, +}; static const char *const ppsz_pos_descriptions[] = { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") }; diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c index e812efee90..944debd46a 100644 --- a/modules/codec/subsdec.c +++ b/modules/codec/subsdec.c @@ -161,7 +161,7 @@ static const char *const ppsz_encoding_names[] = { N_("Vietnamese (Windows-1258)"), }; -static const int pi_justification[] = { -1, 0, 1, 2 }; +static const int pi_justification[] = { -1, 0, SUBPICTURE_ALIGN_LEFT, SUBPICTURE_ALIGN_RIGHT }; static const char *const ppsz_justification_text[] = { N_("Auto"),N_("Center"),N_("Left"),N_("Right") }; diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c index 0aba266d7e..1b1042275f 100644 --- a/modules/codec/zvbi.c +++ b/modules/codec/zvbi.c @@ -77,7 +77,17 @@ static void Close( vlc_object_t * ); #define LEVEL_TEXT N_("Presentation Level") -static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; +static const int pi_pos_values[] = { + 0, + SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_RIGHT, + SUBPICTURE_ALIGN_TOP, + SUBPICTURE_ALIGN_BOTTOM, + SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT, + SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT, +}; static const char *const ppsz_pos_descriptions[] = { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") }; @@ -101,7 +111,7 @@ vlc_module_begin () PAGE_TEXT, PAGE_LONGTEXT ) add_bool( "vbi-opaque", true, OPAQUE_TEXT, OPAQUE_LONGTEXT ) - add_integer( "vbi-position", 8, POS_TEXT, POS_LONGTEXT ) + add_integer( "vbi-position", SUBPICTURE_ALIGN_BOTTOM, POS_TEXT, POS_LONGTEXT ) change_integer_list( pi_pos_values, ppsz_pos_descriptions ) add_bool( "vbi-text", false, TELX_TEXT, TELX_LONGTEXT ) diff --git a/modules/spu/common.h b/modules/spu/common.h index c766f919b0..cc6060c8bc 100644 --- a/modules/spu/common.h +++ b/modules/spu/common.h @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#include + #define OPACITY_TEXT N_("Opacity") #define OPACITY_LONGTEXT N_("Opacity (inverse of transparency), " \ "from 0 for fully transparent to 255 for fully opaque." ) @@ -34,7 +36,18 @@ "also use combinations of these values, e.g. 6 = top-right).") /* Excluding absolute, these values correspond to SUBPICTURE_ALIGN_* flags */ -static const int pi_pos_values[] = { -1, 0, 1, 2, 4, 8, 5, 6, 9, 10 }; +static const int pi_pos_values[] = { + -1, + 0, + SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_RIGHT, + SUBPICTURE_ALIGN_TOP, + SUBPICTURE_ALIGN_BOTTOM, + SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT, + SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT, +}; static const char *const ppsz_pos_descriptions[] = { N_("Absolute"), N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), diff --git a/modules/spu/logo.c b/modules/spu/logo.c index f5ec488a85..a98ee67bdf 100644 --- a/modules/spu/logo.c +++ b/modules/spu/logo.c @@ -703,4 +703,3 @@ static logo_t *LogoListCurrent( logo_list_t *p_list ) { return &p_list->p_logo[p_list->i_counter]; } - diff --git a/modules/spu/mosaic.c b/modules/spu/mosaic.c index 19bf635fac..c0e3a6ff09 100644 --- a/modules/spu/mosaic.c +++ b/modules/spu/mosaic.c @@ -166,7 +166,17 @@ static const int pi_pos_values[] = { 0, 1, 2 }; static const char *const ppsz_pos_descriptions[] = { N_("auto"), N_("fixed"), N_("offsets") }; -static const int pi_align_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; +static const int pi_align_values[] = { + 0, + SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_RIGHT, + SUBPICTURE_ALIGN_TOP, + SUBPICTURE_ALIGN_BOTTOM, + SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT, + SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT, + SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT, +}; static const char *const ppsz_align_descriptions[] = { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };