Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
d19dee0c
Commit
d19dee0c
authored
Mar 25, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: simplify input state callback management
parent
136355ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
42 deletions
+8
-42
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+8
-42
No files found.
modules/gui/qt4/input_manager.cpp
View file @
d19dee0c
...
@@ -274,11 +274,15 @@ void InputManager::customEvent( QEvent *event )
...
@@ -274,11 +274,15 @@ void InputManager::customEvent( QEvent *event )
inline
void
InputManager
::
addCallbacks
()
inline
void
InputManager
::
addCallbacks
()
{
{
var_AddCallback
(
p_input
,
"intf-event"
,
InputEvent
,
this
);
var_AddCallback
(
p_input
,
"intf-event"
,
InputEvent
,
this
);
if
(
!
p_intf
->
p_sys
->
b_isDialogProvider
)
var_AddCallback
(
p_input
,
"state"
,
PLItemChanged
,
THEMIM
);
}
}
/* Delete the callbacks on Input. Self explanatory */
/* Delete the callbacks on Input. Self explanatory */
inline
void
InputManager
::
delCallbacks
()
inline
void
InputManager
::
delCallbacks
()
{
{
if
(
!
p_intf
->
p_sys
->
b_isDialogProvider
)
var_DelCallback
(
p_input
,
"state"
,
PLItemChanged
,
THEMIM
);
var_DelCallback
(
p_input
,
"intf-event"
,
InputEvent
,
this
);
var_DelCallback
(
p_input
,
"intf-event"
,
InputEvent
,
this
);
}
}
...
@@ -995,11 +999,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
...
@@ -995,11 +999,7 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
/* initialize p_input (an input can already be running) */
/* initialize p_input (an input can already be running) */
p_input
=
playlist_CurrentInput
(
pl_Get
(
p_intf
)
);
p_input
=
playlist_CurrentInput
(
pl_Get
(
p_intf
)
);
if
(
p_input
)
if
(
p_input
)
{
if
(
!
p_intf
->
p_sys
->
b_isDialogProvider
)
var_AddCallback
(
p_input
,
"state"
,
PLItemChanged
,
this
);
emit
inputChanged
(
p_input
);
emit
inputChanged
(
p_input
);
}
}
}
MainInputManager
::~
MainInputManager
()
MainInputManager
::~
MainInputManager
()
...
@@ -1007,7 +1007,6 @@ MainInputManager::~MainInputManager()
...
@@ -1007,7 +1007,6 @@ MainInputManager::~MainInputManager()
if
(
p_input
)
if
(
p_input
)
{
{
emit
inputChanged
(
NULL
);
emit
inputChanged
(
NULL
);
var_DelCallback
(
p_input
,
"state"
,
PLItemChanged
,
this
);
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
}
}
...
@@ -1058,43 +1057,10 @@ void MainInputManager::customEvent( QEvent *event )
...
@@ -1058,43 +1057,10 @@ void MainInputManager::customEvent( QEvent *event )
if
(
type
!=
IMEvent
::
ItemChanged
)
return
;
if
(
type
!=
IMEvent
::
ItemChanged
)
return
;
}
}
/* Should be PLItemChanged Event */
if
(
p_input
!=
NULL
)
if
(
!
p_intf
->
p_sys
->
b_isDialogProvider
)
{
if
(
p_input
&&
(
p_input
->
b_dead
||
!
vlc_object_alive
(
p_input
)
)
)
{
emit
inputChanged
(
p_input
);
var_DelCallback
(
p_input
,
"state"
,
PLItemChanged
,
this
);
vlc_object_release
(
p_input
);
p_input
=
NULL
;
return
;
}
if
(
!
p_input
)
{
p_input
=
playlist_CurrentInput
(
THEPL
);
if
(
p_input
)
{
var_AddCallback
(
p_input
,
"state"
,
PLItemChanged
,
this
);
emit
inputChanged
(
p_input
);
}
}
}
else
{
/* remove previous stored p_input */
if
(
p_input
)
{
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
p_input
=
NULL
;
}
/* we are working as a dialogs provider */
p_input
=
playlist_CurrentInput
(
pl_Get
(
p_intf
)
);
p_input
=
playlist_CurrentInput
(
pl_Get
(
p_intf
)
);
if
(
p_input
)
{
emit
inputChanged
(
p_input
);
emit
inputChanged
(
p_input
);
}
}
}
}
/* Playlist Control functions */
/* Playlist Control functions */
...
...
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