Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
5a07a426
Commit
5a07a426
authored
Feb 13, 2010
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: add support for tracking current playing item correctly
parent
376635fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
modules/gui/skins2/vars/playtree.cpp
modules/gui/skins2/vars/playtree.cpp
+28
-4
modules/gui/skins2/vars/playtree.hpp
modules/gui/skins2/vars/playtree.hpp
+6
-0
No files found.
modules/gui/skins2/vars/playtree.cpp
View file @
5a07a426
...
...
@@ -36,6 +36,7 @@ Playtree::Playtree( intf_thread_t *pIntf ): VarTree( pIntf )
{
// Get the VLC playlist object
m_pPlaylist
=
pIntf
->
p_sys
->
p_playlist
;
m_playingIt
=
end
();
i_items_to_append
=
0
;
...
...
@@ -133,10 +134,6 @@ void Playtree::onUpdateItem( int id )
playlist_item_t
*
pNode
=
(
playlist_item_t
*
)(
it
->
m_pData
);
UString
*
pName
=
new
UString
(
getIntf
(),
pNode
->
p_input
->
psz_name
);
it
->
m_cString
=
UStringPtr
(
pName
);
playlist_Lock
(
m_pPlaylist
);
it
->
m_playing
=
playlist_CurrentPlayingItem
(
m_pPlaylist
)
==
pNode
;
playlist_Unlock
(
m_pPlaylist
);
if
(
it
->
m_playing
)
descr
.
b_active_item
=
true
;
}
else
{
...
...
@@ -146,6 +143,33 @@ void Playtree::onUpdateItem( int id )
notify
(
&
descr
);
}
void
Playtree
::
onUpdateCurrent
()
{
playlist_Lock
(
m_pPlaylist
);
playlist_item_t
*
current
=
playlist_CurrentPlayingItem
(
m_pPlaylist
);
if
(
!
current
)
{
playlist_Unlock
(
m_pPlaylist
);
return
;
}
Iterator
it
=
findById
(
current
->
i_id
);
it
->
m_playing
=
true
;
if
(
m_playingIt
!=
end
()
)
m_playingIt
->
m_playing
=
false
;
m_playingIt
=
it
;
playlist_Unlock
(
m_pPlaylist
);
tree_update
descr
;
descr
.
b_active_item
=
true
;
descr
.
i_type
=
0
;
notify
(
&
descr
);
}
/// \todo keep a list of "recently removed" to avoid looking up if we
// already removed it
void
Playtree
::
onDelete
(
int
i_id
)
...
...
modules/gui/skins2/vars/playtree.hpp
View file @
5a07a426
...
...
@@ -46,6 +46,9 @@ public:
/// Function called to notify playlist item update
void
onUpdateItem
(
int
id
);
/// Function called to notify about current playing item
void
onUpdateCurrent
(
);
/// Function called to notify playlist item append
void
onAppend
(
playlist_add_t
*
);
...
...
@@ -64,6 +67,9 @@ private:
/// Update Node's children
void
buildNode
(
playlist_item_t
*
p_node
,
VarTree
&
m_pNode
);
/// keep track of item being played
Iterator
m_playingIt
;
};
#endif
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