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
fd930cde
Commit
fd930cde
authored
Jan 16, 2011
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: cosmetic (playlist)
Remove variables that were never used, especially in tree_update structure
parent
a714732f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
58 deletions
+43
-58
modules/gui/skins2/utils/var_tree.hpp
modules/gui/skins2/utils/var_tree.hpp
+0
-3
modules/gui/skins2/vars/playtree.cpp
modules/gui/skins2/vars/playtree.cpp
+43
-49
modules/gui/skins2/vars/playtree.hpp
modules/gui/skins2/vars/playtree.hpp
+0
-6
No files found.
modules/gui/skins2/utils/var_tree.hpp
View file @
fd930cde
...
...
@@ -36,10 +36,8 @@
typedef
struct
tree_update
{
int
i_type
;
int
i_parent
;
int
i_id
;
bool
b_active_item
;
bool
b_visible
;
}
tree_update
;
/// Tree variable
...
...
@@ -189,7 +187,6 @@ public:
return
depth
;
}
private:
/// Get root node
...
...
modules/gui/skins2/vars/playtree.cpp
View file @
fd930cde
...
...
@@ -32,14 +32,11 @@
#include <vlc_playlist.h>
#include "../utils/ustring.hpp"
Playtree
::
Playtree
(
intf_thread_t
*
pIntf
)
:
VarTree
(
pIntf
),
m_currentItem
(
NULL
)
Playtree
::
Playtree
(
intf_thread_t
*
pIntf
)
:
VarTree
(
pIntf
)
{
// Get the VLC playlist object
m_pPlaylist
=
pIntf
->
p_sys
->
p_playlist
;
i_items_to_append
=
0
;
buildTree
();
}
...
...
@@ -124,37 +121,43 @@ void Playtree::onChange()
void
Playtree
::
onUpdateItem
(
int
id
)
{
Iterator
it
=
findById
(
id
);
tree_update
descr
;
descr
.
b_active_item
=
false
;
if
(
it
!=
end
()
)
{
// Update the item
playlist_item_t
*
pNode
=
(
playlist_item_t
*
)(
it
->
getData
());
UString
*
pName
=
new
UString
(
getIntf
(),
pNode
->
p_input
->
psz_name
);
it
->
setString
(
UStringPtr
(
pName
)
);
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
i_id
=
id
;
descr
.
b_active_item
=
false
;
notify
(
&
descr
);
}
else
{
msg_Warn
(
getIntf
(),
"cannot find node with id %d"
,
id
);
}
descr
.
i_type
=
0
;
notify
(
&
descr
);
}
void
Playtree
::
onUpdateCurrent
(
bool
b_active
)
{
if
(
!
b_active
)
for
(
VarTree
::
Iterator
it
=
begin
();
it
!=
end
();
it
=
getNextItem
(
it
)
)
{
if
(
it
->
isPlaying
()
)
{
if
(
!
m_currentItem
)
return
;
Iterator
it
=
findById
(
m_currentItem
->
i_id
);
if
(
it
!=
end
()
)
it
->
setPlaying
(
false
);
m_currentItem
=
NULL
;
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
i_id
=
it
->
getId
();
descr
.
b_active_item
=
false
;
notify
(
&
descr
);
break
;
}
else
}
if
(
b_active
)
{
playlist_Lock
(
m_pPlaylist
);
...
...
@@ -168,20 +171,17 @@ void Playtree::onUpdateCurrent( bool b_active )
Iterator
it
=
findById
(
current
->
i_id
);
if
(
it
!=
end
()
)
it
->
setPlaying
(
true
);
m_currentItem
=
current
;
playlist_Unlock
(
m_pPlaylist
);
}
tree_update
descr
;
descr
.
b_active_item
=
true
;
descr
.
i_type
=
0
;
descr
.
i_id
=
current
->
i_id
;
descr
.
b_active_item
=
true
;
notify
(
&
descr
);
}
}
/// \todo keep a list of "recently removed" to avoid looking up if we
// already removed it
void
Playtree
::
onDelete
(
int
i_id
)
{
Iterator
item
=
findById
(
i_id
)
;
...
...
@@ -192,45 +192,41 @@ void Playtree::onDelete( int i_id )
item
->
setDeleted
(
true
);
tree_update
descr
;
descr
.
i_id
=
i_id
;
descr
.
i_type
=
3
;
descr
.
b_visible
=
parent
?
parent
->
isExpanded
()
:
true
;
descr
.
i_id
=
i_id
;
notify
(
&
descr
);
if
(
parent
)
parent
->
removeChild
(
item
);
}
}
void
Playtree
::
onAppend
(
playlist_add_t
*
p_add
)
{
i_items_to_append
--
;
Iterator
node
=
findById
(
p_add
->
i_node
);
if
(
node
!=
end
()
)
{
playlist_Lock
(
m_pPlaylist
);
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
m_pPlaylist
,
p_add
->
i_item
);
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
m_pPlaylist
,
p_add
->
i_item
);
if
(
!
p_item
)
{
playlist_Unlock
(
m_pPlaylist
);
return
;
}
UString
*
pName
=
new
UString
(
getIntf
(),
p_item
->
p_input
->
psz_name
);
node
->
add
(
p_add
->
i_item
,
UStringPtr
(
pName
),
false
,
false
,
false
,
p_item
->
i_flags
&
PLAYLIST_RO_FLAG
,
p_item
);
playlist_Unlock
(
m_pPlaylist
);
}
tree_update
descr
;
descr
.
i_id
=
p_add
->
i_item
;
descr
.
i_parent
=
p_add
->
i_node
;
descr
.
b_visible
=
node
->
isExpanded
();
descr
.
i_type
=
2
;
descr
.
i_id
=
p_add
->
i_item
;
notify
(
&
descr
);
}
}
void
Playtree
::
buildNode
(
playlist_item_t
*
pNode
,
VarTree
&
rTree
)
...
...
@@ -239,8 +235,8 @@ void Playtree::buildNode( playlist_item_t *pNode, VarTree &rTree )
{
UString
*
pName
=
new
UString
(
getIntf
(),
pNode
->
pp_children
[
i
]
->
p_input
->
psz_name
);
rTree
.
add
(
pNode
->
pp_children
[
i
]
->
i_id
,
UStringPtr
(
pName
),
false
,
rTree
.
add
(
pNode
->
pp_children
[
i
]
->
i_id
,
UStringPtr
(
pName
),
false
,
playlist_CurrentPlayingItem
(
m_pPlaylist
)
==
pNode
->
pp_children
[
i
],
false
,
pNode
->
pp_children
[
i
]
->
i_flags
&
PLAYLIST_RO_FLAG
,
pNode
->
pp_children
[
i
]
);
...
...
@@ -256,8 +252,6 @@ void Playtree::buildTree()
clear
();
playlist_Lock
(
m_pPlaylist
);
i_items_to_append
=
0
;
clear
();
/* TODO: Let user choose view - Stick with category ATM */
...
...
modules/gui/skins2/vars/playtree.hpp
View file @
fd930cde
...
...
@@ -56,9 +56,6 @@ public:
/// Function called to notify playlist item delete
void
onDelete
(
int
);
/// Items waiting to be appended
int
i_items_to_append
;
private:
/// VLC playlist object
playlist_t
*
m_pPlaylist
;
...
...
@@ -68,9 +65,6 @@ private:
/// Update Node's children
void
buildNode
(
playlist_item_t
*
p_node
,
VarTree
&
m_pNode
);
/// keep track of item being played
playlist_item_t
*
m_currentItem
;
};
#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