Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
7658d8e4
Commit
7658d8e4
authored
Apr 24, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: improve title display
parent
492b2bc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
43 deletions
+44
-43
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+11
-9
src/libvlc-module.c
src/libvlc-module.c
+1
-1
src/text/strings.c
src/text/strings.c
+32
-33
No files found.
modules/gui/qt4/input_manager.cpp
View file @
7658d8e4
...
@@ -456,29 +456,31 @@ void InputManager::UpdateRate()
...
@@ -456,29 +456,31 @@ void InputManager::UpdateRate()
void
InputManager
::
UpdateName
()
void
InputManager
::
UpdateName
()
{
{
/* Update text, name and nowplaying */
/* Update text, name and nowplaying */
QString
text
;
QString
name
;
/* Try to get the nowplaying */
/* Try to get the nowplaying */
char
*
format
=
var_InheritString
(
p_intf
,
"input-title-format"
);
char
*
format
=
var_InheritString
(
p_intf
,
"input-title-format"
);
char
*
formated
=
str_format_meta
(
p_input
,
format
);
char
*
formated
=
str_format_meta
(
p_input
,
format
);
text
=
formated
;
name
=
formated
;
/* Free everything */
/* Free everything */
free
(
format
);
free
(
format
);
free
(
formated
);
free
(
formated
);
/* If we have Nothing */
/* If we have Nothing */
if
(
text
.
isEmpty
()
)
if
(
name
.
isEmpty
()
)
{
{
char
*
psz_name
=
input_item_GetURI
(
input_GetItem
(
p_input
)
);
char
*
psz_name
=
make_path
(
input_item_GetURI
(
input_GetItem
(
p_input
)
)
);
text
.
sprintf
(
"%s"
,
psz_name
)
;
name
=
psz_name
;
text
=
text
.
remove
(
0
,
text
.
lastIndexOf
(
DIR_SEP
)
+
1
);
name
=
name
.
remove
(
0
,
name
.
lastIndexOf
(
DIR_SEP
)
+
1
);
free
(
psz_name
);
free
(
psz_name
);
}
}
if
(
oldName
!=
text
)
name
=
name
.
trimmed
();
if
(
oldName
!=
name
)
{
{
emit
nameChanged
(
text
);
emit
nameChanged
(
name
);
oldName
=
text
;
oldName
=
name
;
}
}
}
}
...
...
src/libvlc-module.c
View file @
7658d8e4
...
@@ -1958,7 +1958,7 @@ vlc_module_begin ()
...
@@ -1958,7 +1958,7 @@ vlc_module_begin ()
add_integer
(
"input-timeshift-granularity"
,
-
1
,
INPUT_TIMESHIFT_GRANULARITY_TEXT
,
add_integer
(
"input-timeshift-granularity"
,
-
1
,
INPUT_TIMESHIFT_GRANULARITY_TEXT
,
INPUT_TIMESHIFT_GRANULARITY_LONGTEXT
,
true
)
INPUT_TIMESHIFT_GRANULARITY_LONGTEXT
,
true
)
add_string
(
"input-title-format"
,
"$
a - $t
"
,
INPUT_TITLE_FORMAT_TEXT
,
INPUT_TITLE_FORMAT_LONGTEXT
,
false
);
add_string
(
"input-title-format"
,
"$
Z
"
,
INPUT_TITLE_FORMAT_TEXT
,
INPUT_TITLE_FORMAT_LONGTEXT
,
false
);
/* Decoder options */
/* Decoder options */
add_category_hint
(
N_
(
"Decoders"
),
CODEC_CAT_LONGTEXT
,
true
)
add_category_hint
(
N_
(
"Decoders"
),
CODEC_CAT_LONGTEXT
,
true
)
...
...
src/text/strings.c
View file @
7658d8e4
...
@@ -618,11 +618,6 @@ static void format_duration (char *buf, size_t len, int64_t duration)
...
@@ -618,11 +618,6 @@ static void format_duration (char *buf, size_t len, int64_t duration)
d += len; \
d += len; \
free( string ); \
free( string ); \
} \
} \
else if( !b_empty_if_na ) \
{ \
*(dst+d) = '-'; \
d++; \
} \
/* same than INSERT_STRING, except that string won't be freed */
/* same than INSERT_STRING, except that string won't be freed */
#define INSERT_STRING_NO_FREE( string ) \
#define INSERT_STRING_NO_FREE( string ) \
...
@@ -730,15 +725,15 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
...
@@ -730,15 +725,15 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
}
}
break
;
break
;
case
's'
:
case
's'
:
{
{
char
*
lang
=
NULL
;
char
*
lang
=
NULL
;
if
(
p_input
)
if
(
p_input
)
lang
=
var_GetNonEmptyString
(
p_input
,
"sub-language"
);
lang
=
var_GetNonEmptyString
(
p_input
,
"sub-language"
);
if
(
lang
==
NULL
)
if
(
lang
==
NULL
)
lang
=
strdup
(
b_empty_if_na
?
""
:
"-"
);
lang
=
strdup
(
b_empty_if_na
?
""
:
"-"
);
INSERT_STRING
(
lang
);
INSERT_STRING
(
lang
);
break
;
break
;
}
}
case
't'
:
case
't'
:
if
(
p_item
)
if
(
p_item
)
{
{
...
@@ -822,16 +817,16 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
...
@@ -822,16 +817,16 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
}
}
break
;
break
;
case
'O'
:
case
'O'
:
{
{
char
*
lang
=
NULL
;
char
*
lang
=
NULL
;
if
(
p_input
)
if
(
p_input
)
lang
=
var_GetNonEmptyString
(
p_input
,
lang
=
var_GetNonEmptyString
(
p_input
,
"audio-language"
);
"audio-language"
);
if
(
lang
==
NULL
)
if
(
lang
==
NULL
)
lang
=
strdup
(
b_empty_if_na
?
""
:
"-"
);
lang
=
strdup
(
b_empty_if_na
?
""
:
"-"
);
INSERT_STRING
(
lang
);
INSERT_STRING
(
lang
);
break
;
break
;
}
}
case
'P'
:
case
'P'
:
if
(
p_input
)
if
(
p_input
)
{
{
...
@@ -871,7 +866,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
...
@@ -871,7 +866,7 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
format_duration
(
buf
,
sizeof
(
buf
),
i_time
);
format_duration
(
buf
,
sizeof
(
buf
),
i_time
);
}
}
else
else
strcpy
(
buf
,
b_empty_if_na
?
""
:
"--:--:--"
);
strcpy
(
buf
,
b_empty_if_na
?
""
:
"--:--:--"
);
INSERT_STRING_NO_FREE
(
buf
);
INSERT_STRING_NO_FREE
(
buf
);
break
;
break
;
case
'U'
:
case
'U'
:
...
@@ -881,12 +876,12 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
...
@@ -881,12 +876,12 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
}
}
break
;
break
;
case
'V'
:
case
'V'
:
{
{
audio_volume_t
volume
=
aout_VolumeGet
(
p_object
);
audio_volume_t
volume
=
aout_VolumeGet
(
p_object
);
snprintf
(
buf
,
10
,
"%d"
,
volume
);
snprintf
(
buf
,
10
,
"%d"
,
volume
);
INSERT_STRING_NO_FREE
(
buf
);
INSERT_STRING_NO_FREE
(
buf
);
break
;
break
;
}
}
case
'_'
:
case
'_'
:
*
(
dst
+
d
)
=
'\n'
;
*
(
dst
+
d
)
=
'\n'
;
d
++
;
d
++
;
...
@@ -897,8 +892,12 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
...
@@ -897,8 +892,12 @@ char *str_format_meta( vlc_object_t *p_object, const char *string )
char
*
now_playing
=
input_item_GetNowPlaying
(
p_item
);
char
*
now_playing
=
input_item_GetNowPlaying
(
p_item
);
if
(
now_playing
==
NULL
)
if
(
now_playing
==
NULL
)
{
{
INSERT_STRING
(
input_item_GetTitle
(
p_item
)
);
char
*
temp
=
input_item_GetTitle
(
p_item
);
INSERT_STRING_NO_FREE
(
" - "
);
if
(
!
EMPTY_STR
(
temp
)
)
{
INSERT_STRING
(
temp
);
INSERT_STRING_NO_FREE
(
" - "
);
}
INSERT_STRING
(
input_item_GetArtist
(
p_item
)
);
INSERT_STRING
(
input_item_GetArtist
(
p_item
)
);
}
}
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment