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
874efde6
Commit
874efde6
authored
May 20, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Playlist simplification in leaf-to-parent management
parent
65d1e784
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
26 deletions
+20
-26
include/vlc_playlist.h
include/vlc_playlist.h
+2
-3
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+5
-14
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+1
-1
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+4
-4
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+7
-3
src/playlist/item.c
src/playlist/item.c
+1
-1
No files found.
include/vlc_playlist.h
View file @
874efde6
...
...
@@ -109,9 +109,8 @@ TYPEDEF_ARRAY(playlist_item_t*, playlist_item_array_t)
* - "playlist-item-deleted": It will contain the playlist_item_t->i_id of a
* deleted playlist_item_t.
*
* - "leaf-to-parent": Set when an item gets subitems and is transformed to a
* node. It will contain a pointer to the input_item_t bound to the transformed
* playlist item.
* - "leaf-to-parent": It will contain the playlist_item_t->i_id of an item that is transformed
* into a node.
*
* The playlist contains rate-variable which is propagated to current input if available
* also rate-slower/rate-faster is in use
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
874efde6
...
...
@@ -79,8 +79,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
int
i_savedViewMode
=
getSettings
()
->
value
(
"Playlist/view-mode"
,
TREE_VIEW
).
toInt
();
showView
(
i_savedViewMode
);
DCONNECT
(
THEMIM
,
leafBecameParent
(
in
put_item_t
*
),
this
,
browseInto
(
in
put_item_t
*
)
);
DCONNECT
(
THEMIM
,
leafBecameParent
(
in
t
),
this
,
browseInto
(
in
t
)
);
CONNECT
(
model
,
currentChanged
(
const
QModelIndex
&
),
this
,
handleExpansion
(
const
QModelIndex
&
)
);
...
...
@@ -451,20 +451,11 @@ void StandardPLPanel::activate( const QModelIndex &index )
}
}
void
StandardPLPanel
::
browseInto
(
in
put_item_t
*
p_input
)
void
StandardPLPanel
::
browseInto
(
in
t
i_id
)
{
if
(
p_input
->
i_id
!=
lastActivatedId
)
return
;
if
(
i_id
!=
lastActivatedId
)
return
;
playlist_Lock
(
THEPL
);
playlist_item_t
*
p_item
=
playlist_ItemGetByInput
(
THEPL
,
p_input
);
if
(
!
p_item
)
{
playlist_Unlock
(
THEPL
);
return
;
}
QModelIndex
index
=
model
->
index
(
p_item
->
i_id
,
0
);
QModelIndex
index
=
model
->
index
(
i_id
,
0
);
playlist_Unlock
(
THEPL
);
if
(
currentView
==
treeView
)
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
874efde6
...
...
@@ -111,7 +111,7 @@ private slots:
void
activate
(
const
QModelIndex
&
);
void
browseInto
();
void
browseInto
(
in
put_item_t
*
);
void
browseInto
(
in
t
);
void
gotoPlayingItem
();
...
...
modules/gui/qt4/input_manager.cpp
View file @
874efde6
...
...
@@ -1027,8 +1027,8 @@ void MainInputManager::customEvent( QEvent *event )
notifyRepeatLoop
();
return
;
case
LeafToParent_Type
:
imEv
=
static_cast
<
IM
Event
*>
(
event
);
emit
leafBecameParent
(
imEv
->
p
_item
);
plEv
=
static_cast
<
PL
Event
*>
(
event
);
emit
leafBecameParent
(
plEv
->
i
_item
);
return
;
default:
if
(
type
!=
ItemChanged_Type
)
return
;
...
...
@@ -1186,8 +1186,8 @@ static int LeafToParent( vlc_object_t *p_this, const char *psz_var,
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
psz_var
);
VLC_UNUSED
(
oldval
);
MainInputManager
*
mim
=
(
MainInputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
LeafToParent_Type
,
static_cast
<
input_item_t
*>
(
newval
.
p_address
)
);
PLEvent
*
event
=
new
PLEvent
(
LeafToParent_Type
,
newval
.
i_int
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
}
...
...
modules/gui/qt4/input_manager.hpp
View file @
874efde6
...
...
@@ -107,9 +107,13 @@ enum PLEventTypes
class
PLEvent
:
public
QEvent
{
public:
PLEvent
(
PLEventTypes
t
,
int
i
,
int
p
)
:
QEvent
(
(
QEvent
::
Type
)
t
),
i_item
(
i
),
i_parent
(
p
)
{}
PLEvent
(
int
t
,
int
i
,
int
p
=
0
)
:
QEvent
(
(
QEvent
::
Type
)(
t
)
),
i_item
(
i
),
i_parent
(
p
)
{}
/* Needed for "playlist-item*" and "leaf-to-parent" callbacks
* !! Can be a input_item_t->i_id or a playlist_item_t->i_id */
int
i_item
;
// Needed for "playlist-item-append" callback, notably
int
i_parent
;
};
...
...
@@ -290,7 +294,7 @@ signals:
void
playlistItemRemoved
(
int
itemId
);
void
randomChanged
(
bool
);
void
repeatLoopChanged
(
int
);
void
leafBecameParent
(
in
put_item_t
*
);
void
leafBecameParent
(
in
t
);
};
#endif
src/playlist/item.c
View file @
874efde6
...
...
@@ -126,7 +126,7 @@ static void input_item_add_subitem_tree ( const vlc_event_t * p_event,
pos
,
b_flat
);
if
(
!
b_flat
)
var_SetAddress
(
p_playlist
,
"leaf-to-parent"
,
p_i
nput
);
if
(
!
b_flat
)
var_SetAddress
(
p_playlist
,
"leaf-to-parent"
,
p_i
tem
->
i_id
);
//control playback only if it was the current playing item that got subitems
if
(
b_current
)
...
...
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