Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
2b0981f7
Commit
2b0981f7
authored
Oct 29, 2010
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncurses: simplify IsIndex() and DrawPlaylist()
parent
e425c7c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
25 deletions
+20
-25
modules/gui/ncurses.c
modules/gui/ncurses.c
+20
-25
No files found.
modules/gui/ncurses.c
View file @
2b0981f7
...
...
@@ -462,16 +462,6 @@ static int PlaylistChanged(vlc_object_t *p_this, const char *psz_variable,
}
/* Playlist suxx */
/* This function have to be called with the playlist locked */
static
inline
bool
PlaylistIsPlaying
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_item
)
{
playlist_item_t
*
p_played_item
=
playlist_CurrentPlayingItem
(
p_playlist
);
return
p_item
&&
p_played_item
&&
p_item
->
p_input
&&
p_played_item
->
p_input
&&
p_item
->
p_input
->
i_id
==
p_played_item
->
p_input
->
i_id
;
}
static
int
SubSearchPlaylist
(
intf_sys_t
*
p_sys
,
char
*
psz_searchstring
,
int
i_start
,
int
i_stop
)
{
...
...
@@ -510,8 +500,18 @@ static void SearchPlaylist(intf_sys_t *p_sys, char *psz_searchstring)
static
inline
bool
IsIndex
(
intf_sys_t
*
p_sys
,
playlist_t
*
p_playlist
,
int
i
)
{
playlist_item_t
*
p_item
=
p_sys
->
pp_plist
[
i
]
->
p_item
;
return
(
p_item
->
i_children
==
0
&&
p_item
==
p_sys
->
p_node
)
||
PlaylistIsPlaying
(
p_playlist
,
p_item
);
playlist_item_t
*
p_played_item
;
PL_ASSERT_LOCKED
;
if
(
p_item
->
i_children
==
0
&&
p_item
==
p_sys
->
p_node
)
return
true
;
p_played_item
=
playlist_CurrentPlayingItem
(
p_playlist
);
if
(
p_played_item
&&
p_item
->
p_input
&&
p_played_item
->
p_input
)
return
p_item
->
p_input
->
i_id
==
p_played_item
->
p_input
->
i_id
;
return
false
;
}
static
void
FindIndex
(
intf_sys_t
*
p_sys
,
playlist_t
*
p_playlist
)
...
...
@@ -1002,28 +1002,23 @@ static int DrawPlaylist(intf_thread_t *p_intf)
for
(
int
i
=
0
;
i
<
p_sys
->
i_plist_entries
;
i
++
)
{
char
c
=
' '
;
playlist_item_t
*
p_current_item
,
*
p_item
,
*
p_node
;
input_thread_t
*
p_input2
;
p_item
=
p_sys
->
pp_plist
[
i
]
->
p_item
;
p_node
=
p_sys
->
p_node
;
p_input2
=
playlist_CurrentInput
(
p_playlist
);
char
c
;
playlist_item_t
*
p_current_item
;
playlist_item_t
*
p_item
=
p_sys
->
pp_plist
[
i
]
->
p_item
;
playlist_item_t
*
p_node
=
p_sys
->
p_node
;
PL_LOCK
;
assert
(
p_item
);
p_current_item
=
playlist_CurrentPlayingItem
(
p_playlist
);
if
((
p_node
&&
p_item
->
p_input
==
p_node
->
p_input
)
||
(
!
p_node
&&
p_input2
&&
p_current_item
&&
p_item
->
p_input
==
p_current_item
->
p_input
))
(
!
p_node
&&
p_current_item
&&
p_item
->
p_input
==
p_current_item
->
p_input
))
c
=
'*'
;
else
if
(
p_item
==
p_node
||
PlaylistIsPlaying
(
p_playlist
,
p_item
)
)
else
if
(
p_item
==
p_node
||
p_current_item
==
p_item
)
c
=
'>'
;
else
c
=
' '
;
PL_UNLOCK
;
if
(
p_input2
)
vlc_object_release
(
p_input2
);
if
(
p_sys
->
b_color
)
color_set
(
i
%
3
+
C_PLAYLIST_1
,
NULL
);
MainBoxWrite
(
p_sys
,
i
,
"%c%s"
,
c
,
p_sys
->
pp_plist
[
i
]
->
psz_display
);
if
(
p_sys
->
b_color
)
color_set
(
C_DEFAULT
,
NULL
);
...
...
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