@@ -112,6 +112,13 @@ struct hook_handler {
112
112
bool active ; // hook is currently in progress (only 1 at a time for now)
113
113
};
114
114
115
+ // U+279C HEAVY ROUND-TIPPED RIGHTWARDS ARROW
116
+ #define ARROW "\342\236\234"
117
+ #define ARROW_SP ARROW " "
118
+
119
+ const char list_current [] = OSD_ASS_0 ARROW_SP OSD_ASS_1 ;
120
+ const char list_normal [] = OSD_ASS_0 "{\\alpha&HFF}" ARROW_SP "{\\r}" OSD_ASS_1 ;
121
+
115
122
static int edit_filters (struct MPContext * mpctx , struct mp_log * log ,
116
123
enum stream_type mediatype ,
117
124
const char * cmd , const char * arg );
@@ -870,10 +877,8 @@ static int mp_property_list_chapters(void *ctx, struct m_property *prop,
870
877
char * time = mp_format_time (t , false);
871
878
res = talloc_asprintf_append (res , "%s" , time );
872
879
talloc_free (time );
873
- char * m1 = "> " , * m2 = " <" ;
874
- if (n != cur )
875
- m1 = m2 = "" ;
876
- res = talloc_asprintf_append (res , " %s%s%s\n" , m1 , name , m2 );
880
+ const char * m = n == cur ? list_current : list_normal ;
881
+ res = talloc_asprintf_append (res , " %s%s\n" , m , name );
877
882
talloc_free (name );
878
883
}
879
884
@@ -964,16 +969,13 @@ static int property_list_editions(void *ctx, struct m_property *prop,
964
969
for (int n = 0 ; n < num_editions ; n ++ ) {
965
970
struct demux_edition * ed = & editions [n ];
966
971
967
- if ( n == current )
968
- res = talloc_asprintf_append ( res , "> " );
972
+ res = talloc_strdup_append ( res , n == current ? list_current
973
+ : list_normal );
969
974
res = talloc_asprintf_append (res , "%d: " , n );
970
975
char * title = mp_tags_get_str (ed -> metadata , "title" );
971
976
if (!title )
972
977
title = "unnamed" ;
973
- res = talloc_asprintf_append (res , "'%s' " , title );
974
- if (n == current )
975
- res = talloc_asprintf_append (res , "<" );
976
- res = talloc_asprintf_append (res , "\n" );
978
+ res = talloc_asprintf_append (res , "'%s'\n" , title );
977
979
}
978
980
979
981
* (char * * )arg = res ;
@@ -2033,17 +2035,15 @@ static int property_list_tracks(void *ctx, struct m_property *prop,
2033
2035
2034
2036
res = talloc_asprintf_append (res , "%s: " ,
2035
2037
track_type_name (track -> type ));
2036
- if ( track -> selected )
2037
- res = talloc_asprintf_append ( res , "> " );
2038
+ res = talloc_strdup_append ( res ,
2039
+ track -> selected ? list_current : list_normal );
2038
2040
res = talloc_asprintf_append (res , "(%d) " , track -> user_tid );
2039
2041
if (track -> title )
2040
2042
res = talloc_asprintf_append (res , "'%s' " , track -> title );
2041
2043
if (track -> lang )
2042
2044
res = talloc_asprintf_append (res , "(%s) " , track -> lang );
2043
2045
if (track -> is_external )
2044
2046
res = talloc_asprintf_append (res , "(external) " );
2045
- if (track -> selected )
2046
- res = talloc_asprintf_append (res , "<" );
2047
2047
res = talloc_asprintf_append (res , "\n" );
2048
2048
}
2049
2049
@@ -3145,11 +3145,9 @@ static int mp_property_playlist(void *ctx, struct m_property *prop,
3145
3145
if (s [0 ])
3146
3146
p = s ;
3147
3147
}
3148
- if (mpctx -> playlist -> current == e ) {
3149
- res = talloc_asprintf_append (res , "> %s <\n" , p );
3150
- } else {
3151
- res = talloc_asprintf_append (res , "%s\n" , p );
3152
- }
3148
+ const char * m = mpctx -> playlist -> current == e ?
3149
+ list_current : list_normal ;
3150
+ res = talloc_asprintf_append (res , "%s%s\n" , m , p );
3153
3151
}
3154
3152
3155
3153
* (char * * )arg = res ;
0 commit comments