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
b5998426
Commit
b5998426
authored
Jan 30, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: efficient iconView browsing demands a specialized playlist event
parent
6a4273c2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
15 deletions
+35
-15
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+10
-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
+19
-0
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+3
-0
src/playlist/engine.c
src/playlist/engine.c
+1
-0
src/playlist/item.c
src/playlist/item.c
+1
-0
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
b5998426
...
@@ -130,8 +130,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -130,8 +130,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
getSettings
()
->
endGroup
();
getSettings
()
->
endGroup
();
CONNECT
(
THEMIM
,
inputChanged
(
input_thread_t
*
),
CONNECT
(
THEMIM
,
leafBecameParent
(
input_item_t
*
),
this
,
handleInputChange
(
input_thread
_t
*
)
);
this
,
browseInto
(
input_item
_t
*
)
);
CONNECT
(
model
,
currentChanged
(
const
QModelIndex
&
),
CONNECT
(
model
,
currentChanged
(
const
QModelIndex
&
),
this
,
handleExpansion
(
const
QModelIndex
&
)
);
this
,
handleExpansion
(
const
QModelIndex
&
)
);
...
@@ -410,7 +410,7 @@ void StandardPLPanel::wheelEvent( QWheelEvent *e )
...
@@ -410,7 +410,7 @@ void StandardPLPanel::wheelEvent( QWheelEvent *e )
void
StandardPLPanel
::
activate
(
const
QModelIndex
&
index
)
void
StandardPLPanel
::
activate
(
const
QModelIndex
&
index
)
{
{
last_activated_id
=
model
->
itemId
(
index
)
;
last_activated_id
=
model
->
getItem
(
index
)
->
inputItem
()
->
i_id
;
if
(
model
->
hasChildren
(
index
)
)
if
(
model
->
hasChildren
(
index
)
)
{
{
if
(
currentView
==
iconView
)
{
if
(
currentView
==
iconView
)
{
...
@@ -425,26 +425,22 @@ void StandardPLPanel::activate( const QModelIndex &index )
...
@@ -425,26 +425,22 @@ void StandardPLPanel::activate( const QModelIndex &index )
}
}
}
}
void
StandardPLPanel
::
handleInputChange
(
input_thread_t
*
p_input_thread
)
void
StandardPLPanel
::
browseInto
(
input_item_t
*
p_input
)
{
{
if
(
currentView
!=
iconView
)
return
;
input_item_t
*
p_input_item
=
input_GetItem
(
p_input_thread
);
if
(
p_input
->
i_id
!=
last_activated_id
)
return
;
if
(
!
p_input_item
)
return
;
playlist_Lock
(
THEPL
);
playlist_Lock
(
THEPL
);
playlist_item_t
*
p_item
=
playlist_ItemGetByInput
(
THEPL
,
p_input_item
);
playlist_item_t
*
p_item
=
playlist_ItemGetByInput
(
THEPL
,
p_input
);
assert
(
p_item
!=
NULL
);
if
(
p_item
&&
p_item
->
p_parent
&&
if
(
currentView
==
iconView
)
{
p_item
->
p_parent
->
i_id
==
last_activated_id
)
QModelIndex
index
=
model
->
index
(
p_item
->
i_id
,
0
);
{
QModelIndex
index
=
model
->
index
(
p_item
->
p_parent
->
i_id
,
0
);
iconView
->
setRootIndex
(
index
);
iconView
->
setRootIndex
(
index
);
//title->setText( index.data().toString() );
locationBar
->
setIndex
(
index
);
locationBar
->
setIndex
(
index
);
last_activated_id
=
p_item
->
i_id
;
}
}
last_activated_id
=
p_item
->
pp_children
[
0
]
->
p_input
->
i_id
;
playlist_Unlock
(
THEPL
);
playlist_Unlock
(
THEPL
);
}
}
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
b5998426
...
@@ -107,7 +107,7 @@ private slots:
...
@@ -107,7 +107,7 @@ private slots:
void
showView
(
int
);
void
showView
(
int
);
void
cycleViews
();
void
cycleViews
();
void
activate
(
const
QModelIndex
&
);
void
activate
(
const
QModelIndex
&
);
void
handleInputChange
(
input_thread
_t
*
);
void
browseInto
(
input_item
_t
*
);
};
};
class
LocationBar
:
public
QToolBar
class
LocationBar
:
public
QToolBar
...
...
modules/gui/qt4/input_manager.cpp
View file @
b5998426
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
static
int
ItemChanged
(
vlc_object_t
*
,
const
char
*
,
static
int
ItemChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
LeafToParent
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
PLItemChanged
(
vlc_object_t
*
,
const
char
*
,
static
int
PLItemChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
PLItemAppended
(
vlc_object_t
*
,
const
char
*
,
static
int
PLItemAppended
(
vlc_object_t
*
,
const
char
*
,
...
@@ -905,6 +907,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
...
@@ -905,6 +907,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
var_AddCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
im
);
var_AddCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
im
);
var_AddCallback
(
THEPL
,
"item-current"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"item-current"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"leaf-to-parent"
,
LeafToParent
,
this
);
var_AddCallback
(
THEPL
,
"playlist-item-append"
,
PLItemAppended
,
this
);
var_AddCallback
(
THEPL
,
"playlist-item-append"
,
PLItemAppended
,
this
);
var_AddCallback
(
THEPL
,
"playlist-item-deleted"
,
PLItemRemoved
,
this
);
var_AddCallback
(
THEPL
,
"playlist-item-deleted"
,
PLItemRemoved
,
this
);
var_AddCallback
(
THEPL
,
"random"
,
RandomChanged
,
this
);
var_AddCallback
(
THEPL
,
"random"
,
RandomChanged
,
this
);
...
@@ -947,6 +950,7 @@ MainInputManager::~MainInputManager()
...
@@ -947,6 +950,7 @@ MainInputManager::~MainInputManager()
var_DelCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
im
);
var_DelCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
im
);
var_DelCallback
(
THEPL
,
"leaf-to-parent"
,
LeafToParent
,
this
);
var_DelCallback
(
THEPL
,
"item-current"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"item-current"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"playlist-item-append"
,
PLItemAppended
,
this
);
var_DelCallback
(
THEPL
,
"playlist-item-append"
,
PLItemAppended
,
this
);
...
@@ -972,6 +976,7 @@ void MainInputManager::customEvent( QEvent *event )
...
@@ -972,6 +976,7 @@ void MainInputManager::customEvent( QEvent *event )
int
type
=
event
->
type
();
int
type
=
event
->
type
();
PLEvent
*
plEv
;
PLEvent
*
plEv
;
IMEvent
*
imEv
;
// msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
// msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
switch
(
type
)
switch
(
type
)
...
@@ -997,6 +1002,9 @@ void MainInputManager::customEvent( QEvent *event )
...
@@ -997,6 +1002,9 @@ void MainInputManager::customEvent( QEvent *event )
case
RepeatChanged_Type
:
case
RepeatChanged_Type
:
notifyRepeatLoop
();
notifyRepeatLoop
();
return
;
return
;
case
LeafToParent_Type
:
imEv
=
static_cast
<
IMEvent
*>
(
event
);
emit
leafBecameParent
(
imEv
->
p_item
);
default:
default:
if
(
type
!=
ItemChanged_Type
)
return
;
if
(
type
!=
ItemChanged_Type
)
return
;
}
}
...
@@ -1135,6 +1143,17 @@ static int PLItemChanged( vlc_object_t *p_this, const char *psz_var,
...
@@ -1135,6 +1143,17 @@ static int PLItemChanged( vlc_object_t *p_this, const char *psz_var,
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
static
int
LeafToParent
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
MainInputManager
*
mim
=
(
MainInputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
LeafToParent_Type
,
static_cast
<
input_item_t
*>
(
newval
.
p_address
)
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
}
static
int
VolumeChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
static
int
VolumeChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
{
...
...
modules/gui/qt4/input_manager.hpp
View file @
b5998426
...
@@ -61,6 +61,7 @@ enum {
...
@@ -61,6 +61,7 @@ enum {
RandomChanged_Type
,
RandomChanged_Type
,
LoopChanged_Type
,
LoopChanged_Type
,
RepeatChanged_Type
,
RepeatChanged_Type
,
LeafToParent_Type
,
/* SignalChanged_Type, */
/* SignalChanged_Type, */
FullscreenControlToggle_Type
=
QEvent
::
User
+
IMEventType
+
20
,
FullscreenControlToggle_Type
=
QEvent
::
User
+
IMEventType
+
20
,
...
@@ -77,6 +78,7 @@ enum { NORMAL, /* loop: 0, repeat: 0 */
...
@@ -77,6 +78,7 @@ enum { NORMAL, /* loop: 0, repeat: 0 */
class
IMEvent
:
public
QEvent
class
IMEvent
:
public
QEvent
{
{
friend
class
InputManager
;
friend
class
InputManager
;
friend
class
MainInputManager
;
public:
public:
IMEvent
(
int
type
,
input_item_t
*
p_input
=
NULL
)
IMEvent
(
int
type
,
input_item_t
*
p_input
=
NULL
)
:
QEvent
(
(
QEvent
::
Type
)(
type
)
)
:
QEvent
(
(
QEvent
::
Type
)(
type
)
)
...
@@ -288,6 +290,7 @@ signals:
...
@@ -288,6 +290,7 @@ signals:
void
playlistItemRemoved
(
int
itemId
);
void
playlistItemRemoved
(
int
itemId
);
void
randomChanged
(
bool
);
void
randomChanged
(
bool
);
void
repeatLoopChanged
(
int
);
void
repeatLoopChanged
(
int
);
void
leafBecameParent
(
input_item_t
*
);
};
};
#endif
#endif
src/playlist/engine.c
View file @
b5998426
...
@@ -279,6 +279,7 @@ static void VariablesInit( playlist_t *p_playlist )
...
@@ -279,6 +279,7 @@ static void VariablesInit( playlist_t *p_playlist )
var_SetBool
(
p_playlist
,
"intf-change"
,
true
);
var_SetBool
(
p_playlist
,
"intf-change"
,
true
);
var_Create
(
p_playlist
,
"item-change"
,
VLC_VAR_ADDRESS
);
var_Create
(
p_playlist
,
"item-change"
,
VLC_VAR_ADDRESS
);
var_Create
(
p_playlist
,
"leaf-to-parent"
,
VLC_VAR_ADDRESS
);
var_Create
(
p_playlist
,
"playlist-item-deleted"
,
VLC_VAR_INTEGER
);
var_Create
(
p_playlist
,
"playlist-item-deleted"
,
VLC_VAR_INTEGER
);
var_SetInteger
(
p_playlist
,
"playlist-item-deleted"
,
-
1
);
var_SetInteger
(
p_playlist
,
"playlist-item-deleted"
,
-
1
);
...
...
src/playlist/item.c
View file @
b5998426
...
@@ -626,6 +626,7 @@ static playlist_item_t *ItemToNode( playlist_t *p_playlist,
...
@@ -626,6 +626,7 @@ static playlist_item_t *ItemToNode( playlist_t *p_playlist,
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
vlc_cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
vlc_cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
var_SetAddress
(
p_playlist
,
"item-change"
,
p_item_in_category
->
p_input
);
var_SetAddress
(
p_playlist
,
"item-change"
,
p_item_in_category
->
p_input
);
var_SetAddress
(
p_playlist
,
"leaf-to-parent"
,
p_item_in_category
->
p_input
);
PL_UNLOCK_IF
(
!
b_locked
);
PL_UNLOCK_IF
(
!
b_locked
);
return
p_item_in_category
;
return
p_item_in_category
;
}
}
...
...
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