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
cb81565b
Commit
cb81565b
authored
Feb 16, 2009
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt4: remove item-change callback from playlist-model
parent
e916edc9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
12 deletions
+31
-12
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+18
-9
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+2
-1
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+9
-2
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+2
-0
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
cb81565b
...
@@ -96,6 +96,10 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
...
@@ -96,6 +96,10 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
#undef ADD_ICON
#undef ADD_ICON
rebuild
(
p_root
);
rebuild
(
p_root
);
CONNECT
(
THEMIM
->
getIM
(),
metaChanged
(
int
),
this
,
ProcessInputItemUpdate
(
int
)
);
CONNECT
(
THEMIM
,
inputChanged
(
input_thread_t
*
),
this
,
ProcessInputItemUpdate
(
input_thread_t
*
)
);
}
}
PLModel
::~
PLModel
()
PLModel
::~
PLModel
()
...
@@ -220,18 +224,20 @@ void PLModel::addCallbacks()
...
@@ -220,18 +224,20 @@ void PLModel::addCallbacks()
{
{
/* Some global changes happened -> Rebuild all */
/* Some global changes happened -> Rebuild all */
var_AddCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
this
);
var_AddCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
this
);
/* We went to the next item
*/
/* We went to the next item
var_AddCallback( p_playlist, "item-current", PlaylistNext, this );
var_AddCallback( p_playlist, "item-current", PlaylistNext, this );
*/
/* One item has been updated */
/* One item has been updated */
var_AddCallback
(
p_playlist
,
"item-change"
,
ItemChanged
,
this
);
var_AddCallback
(
p_playlist
,
"item-append"
,
ItemAppended
,
this
);
var_AddCallback
(
p_playlist
,
"playlist-item-append"
,
ItemAppended
,
this
);
var_AddCallback
(
p_playlist
,
"item-deleted"
,
ItemDeleted
,
this
);
var_AddCallback
(
p_playlist
,
"playlist-item-deleted"
,
ItemDeleted
,
this
);
}
}
void
PLModel
::
delCallbacks
()
void
PLModel
::
delCallbacks
()
{
{
var_DelCallback
(
p_playlist
,
"item-change"
,
ItemChanged
,
this
);
var_DelCallback
(
p_playlist
,
"item-change"
,
ItemChanged
,
this
);
/*
var_DelCallback( p_playlist, "item-current", PlaylistNext, this );
var_DelCallback( p_playlist, "item-current", PlaylistNext, this );
*/
var_DelCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
this
);
var_DelCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
this
);
var_DelCallback
(
p_playlist
,
"playlist-item-append"
,
ItemAppended
,
this
);
var_DelCallback
(
p_playlist
,
"playlist-item-append"
,
ItemAppended
,
this
);
var_DelCallback
(
p_playlist
,
"playlist-item-deleted"
,
ItemDeleted
,
this
);
var_DelCallback
(
p_playlist
,
"playlist-item-deleted"
,
ItemDeleted
,
this
);
...
@@ -512,16 +518,14 @@ PLItem * PLModel::FindInner( PLItem *root, int i_id, bool b_input )
...
@@ -512,16 +518,14 @@ PLItem * PLModel::FindInner( PLItem *root, int i_id, bool b_input )
void
PLModel
::
customEvent
(
QEvent
*
event
)
void
PLModel
::
customEvent
(
QEvent
*
event
)
{
{
int
type
=
event
->
type
();
int
type
=
event
->
type
();
if
(
type
!=
Item
Update_Type
&&
type
!=
Item
Append_Type
&&
if
(
type
!=
ItemAppend_Type
&&
type
!=
ItemDelete_Type
&&
type
!=
PLUpdate_Type
)
type
!=
ItemDelete_Type
&&
type
!=
PLUpdate_Type
)
return
;
return
;
PLEvent
*
ple
=
static_cast
<
PLEvent
*>
(
event
);
PLEvent
*
ple
=
static_cast
<
PLEvent
*>
(
event
);
if
(
type
==
ItemUpdate_Type
)
if
(
type
==
ItemAppend_Type
)
ProcessInputItemUpdate
(
ple
->
i_id
);
ProcessItemAppend
(
ple
->
p_add
);
else
if
(
type
==
ItemAppend_Type
)
ProcessItemAppend
(
&
ple
->
add
);
else
if
(
type
==
ItemDelete_Type
)
else
if
(
type
==
ItemDelete_Type
)
ProcessItemRemoval
(
ple
->
i_id
);
ProcessItemRemoval
(
ple
->
i_id
);
else
else
...
@@ -529,6 +533,11 @@ void PLModel::customEvent( QEvent *event )
...
@@ -529,6 +533,11 @@ void PLModel::customEvent( QEvent *event )
}
}
/**** Events processing ****/
/**** Events processing ****/
void
PLModel
::
ProcessInputItemUpdate
(
input_thread_t
*
p_input
)
{
if
(
!
p_input
)
return
;
ProcessInputItemUpdate
(
input_GetItem
(
p_input
)
->
i_id
);
}
void
PLModel
::
ProcessInputItemUpdate
(
int
i_input_id
)
void
PLModel
::
ProcessInputItemUpdate
(
int
i_input_id
)
{
{
if
(
i_input_id
<=
0
)
return
;
if
(
i_input_id
<=
0
)
return
;
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
cb81565b
...
@@ -140,7 +140,6 @@ private:
...
@@ -140,7 +140,6 @@ private:
static
QIcon
icons
[
ITEM_TYPE_NUMBER
];
static
QIcon
icons
[
ITEM_TYPE_NUMBER
];
/* Update processing */
/* Update processing */
void
ProcessInputItemUpdate
(
int
i_input_id
);
void
ProcessItemRemoval
(
int
i_id
);
void
ProcessItemRemoval
(
int
i_id
);
void
ProcessItemAppend
(
const
playlist_add_t
*
p_add
);
void
ProcessItemAppend
(
const
playlist_add_t
*
p_add
);
...
@@ -184,6 +183,8 @@ private slots:
...
@@ -184,6 +183,8 @@ private slots:
void
popupSave
();
void
popupSave
();
void
popupExplore
();
void
popupExplore
();
void
viewchanged
(
int
);
void
viewchanged
(
int
);
void
ProcessInputItemUpdate
(
int
i_input_id
);
void
ProcessInputItemUpdate
(
input_thread_t
*
p_input
);
};
};
#endif
#endif
modules/gui/qt4/input_manager.cpp
View file @
cb81565b
...
@@ -136,7 +136,7 @@ void InputManager::delInput()
...
@@ -136,7 +136,7 @@ void InputManager::delInput()
/* Reset all InfoPanels but stats */
/* Reset all InfoPanels but stats */
emit
artChanged
(
NULL
);
emit
artChanged
(
NULL
);
emit
infoChanged
(
NULL
);
emit
infoChanged
(
NULL
);
emit
metaChanged
(
NULL
);
emit
metaChanged
(
(
input_item_t
*
)
NULL
);
}
}
/* Convert the event from the callbacks in actions */
/* Convert the event from the callbacks in actions */
...
@@ -171,7 +171,9 @@ void InputManager::customEvent( QEvent *event )
...
@@ -171,7 +171,9 @@ void InputManager::customEvent( QEvent *event )
UpdateStatus
();
UpdateStatus
();
// UpdateName();
// UpdateName();
UpdateArt
();
UpdateArt
();
/* Update duration of file */
}
}
UpdateMeta
(
ple
->
i_id
);
break
;
break
;
case
ItemStateChanged_Type
:
case
ItemStateChanged_Type
:
// TODO: Fusion with above state
// TODO: Fusion with above state
...
@@ -599,6 +601,11 @@ inline void InputManager::UpdateStats()
...
@@ -599,6 +601,11 @@ inline void InputManager::UpdateStats()
emit
statisticsUpdated
(
input_GetItem
(
p_input
)
);
emit
statisticsUpdated
(
input_GetItem
(
p_input
)
);
}
}
inline
void
InputManager
::
UpdateMeta
(
int
id
)
{
emit
metaChanged
(
id
);
}
inline
void
InputManager
::
UpdateMeta
()
inline
void
InputManager
::
UpdateMeta
()
{
{
emit
metaChanged
(
input_GetItem
(
p_input
)
);
emit
metaChanged
(
input_GetItem
(
p_input
)
);
...
@@ -889,7 +896,7 @@ void MainInputManager::customEvent( QEvent *event )
...
@@ -889,7 +896,7 @@ void MainInputManager::customEvent( QEvent *event )
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
if
(
p_input
&&
(
p_input
->
b_dead
||
!
vlc_object_alive
(
p_input
)
)
)
if
(
p_input
&&
(
p_input
->
b_dead
||
!
vlc_object_alive
(
p_input
)
)
)
{
{
emit
inputChanged
(
NULL
);
emit
inputChanged
(
p_input
);
var_DelCallback
(
p_input
,
"state"
,
PLItemChanged
,
this
);
var_DelCallback
(
p_input
,
"state"
,
PLItemChanged
,
this
);
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
p_input
=
NULL
;
p_input
=
NULL
;
...
...
modules/gui/qt4/input_manager.hpp
View file @
cb81565b
...
@@ -129,6 +129,7 @@ private:
...
@@ -129,6 +129,7 @@ private:
void
UpdateArt
();
void
UpdateArt
();
void
UpdateInfo
();
void
UpdateInfo
();
void
UpdateMeta
();
void
UpdateMeta
();
void
UpdateMeta
(
int
);
void
UpdateVout
();
void
UpdateVout
();
void
UpdateAout
();
void
UpdateAout
();
void
UpdateStats
();
void
UpdateStats
();
...
@@ -172,6 +173,7 @@ signals:
...
@@ -172,6 +173,7 @@ signals:
void
statisticsUpdated
(
input_item_t
*
);
void
statisticsUpdated
(
input_item_t
*
);
void
infoChanged
(
input_item_t
*
);
void
infoChanged
(
input_item_t
*
);
void
metaChanged
(
input_item_t
*
);
void
metaChanged
(
input_item_t
*
);
void
metaChanged
(
int
);
void
artChanged
(
QString
);
void
artChanged
(
QString
);
/// Play/pause status
/// Play/pause status
void
statusChanged
(
int
);
void
statusChanged
(
int
);
...
...
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