Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
1ae86f62
Commit
1ae86f62
authored
Nov 23, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated qt4 to use intf-event.
It might need a review and a clean up of the qt4 code.
parent
aa31cdc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
136 deletions
+72
-136
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+70
-135
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+2
-1
No files found.
modules/gui/qt4/input_manager.cpp
View file @
1ae86f62
...
@@ -30,31 +30,17 @@
...
@@ -30,31 +30,17 @@
#include "input_manager.hpp"
#include "input_manager.hpp"
#include "dialogs_provider.hpp"
#include "dialogs_provider.hpp"
static
int
ChangeSPU
(
vlc_object_t
*
p_this
,
const
char
*
var
,
vlc_value_t
o
,
vlc_value_t
n
,
void
*
param
);
static
int
ChangeTeletext
(
vlc_object_t
*
p_this
,
const
char
*
var
,
vlc_value_t
o
,
vlc_value_t
n
,
void
*
param
);
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
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
InterfaceChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
StatisticsUpdated
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
InterfaceVoutChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
ItemStateChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
ItemRateChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
ItemTitleChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
VolumeChanged
(
vlc_object_t
*
,
const
char
*
,
static
int
VolumeChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
InputEvent
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
/**********************************************************************
/**********************************************************************
* InputManager implementation
* InputManager implementation
**********************************************************************
**********************************************************************
...
@@ -139,47 +125,13 @@ void InputManager::delInput()
...
@@ -139,47 +125,13 @@ void InputManager::delInput()
/* Add the callbacks on Input. Self explanatory */
/* Add the callbacks on Input. Self explanatory */
void
InputManager
::
addCallbacks
()
void
InputManager
::
addCallbacks
()
{
{
/* We don't care about:
var_AddCallback
(
p_input
,
"intf-event"
,
InputEvent
,
this
);
- chapter
- programs
- audio-delay
- spu-delay
- bookmark
- position, time, length, because they are included in intf-change
*/
/* src/input/input.c:1629 */
var_AddCallback
(
p_input
,
"state"
,
ItemStateChanged
,
this
);
/* src/input/es-out.c:552 */
var_AddCallback
(
p_input
,
"spu-es"
,
ChangeSPU
,
this
);
/* emit UpdateStatus so that main_interface updates controls
* if there is new videotracks (mpeg-ts)*/
var_AddCallback
(
p_input
,
"video-es"
,
ItemStateChanged
,
this
);
/* src/input/es-out.c: */
var_AddCallback
(
p_input
,
"teletext-es"
,
ChangeTeletext
,
this
);
/* src/input/input.c:1765 */
var_AddCallback
(
p_input
,
"rate-change"
,
ItemRateChanged
,
this
);
/* src/input/input.c:2003 */
var_AddCallback
(
p_input
,
"title"
,
ItemTitleChanged
,
this
);
/* src/input/input.c:734 for timers update*/
var_AddCallback
(
p_input
,
"intf-change"
,
InterfaceChanged
,
this
);
/* src/input/input.c:710 for statistics update*/
var_AddCallback
(
p_input
,
"stats-change"
,
StatisticsUpdated
,
this
);
/* src/input/input.c for vout creation/destruction */
var_AddCallback
(
p_input
,
"intf-change-vout"
,
InterfaceVoutChanged
,
this
);
}
}
/* Delete the callbacks on Input. Self explanatory */
/* Delete the callbacks on Input. Self explanatory */
void
InputManager
::
delCallbacks
()
void
InputManager
::
delCallbacks
()
{
{
var_DelCallback
(
p_input
,
"spu-es"
,
ChangeSPU
,
this
);
var_DelCallback
(
p_input
,
"intf-event"
,
InputEvent
,
this
);
var_DelCallback
(
p_input
,
"video-es"
,
ItemStateChanged
,
this
);
var_DelCallback
(
p_input
,
"teletext-es"
,
ChangeTeletext
,
this
);
var_DelCallback
(
p_input
,
"state"
,
ItemStateChanged
,
this
);
var_DelCallback
(
p_input
,
"rate-change"
,
ItemRateChanged
,
this
);
var_DelCallback
(
p_input
,
"title"
,
ItemTitleChanged
,
this
);
var_DelCallback
(
p_input
,
"intf-change"
,
InterfaceChanged
,
this
);
var_DelCallback
(
p_input
,
"stats-change"
,
StatisticsUpdated
,
this
);
var_DelCallback
(
p_input
,
"intf-change-vout"
,
InterfaceVoutChanged
,
this
);
}
}
/* Convert the event from the callbacks in actions */
/* Convert the event from the callbacks in actions */
...
@@ -192,13 +144,16 @@ void InputManager::customEvent( QEvent *event )
...
@@ -192,13 +144,16 @@ void InputManager::customEvent( QEvent *event )
i_type
!=
ItemChanged_Type
&&
i_type
!=
ItemChanged_Type
&&
i_type
!=
ItemRateChanged_Type
&&
i_type
!=
ItemRateChanged_Type
&&
i_type
!=
ItemTitleChanged_Type
&&
i_type
!=
ItemTitleChanged_Type
&&
i_type
!=
Item
Spu
Changed_Type
&&
i_type
!=
Item
Es
Changed_Type
&&
i_type
!=
ItemTeletextChanged_Type
&&
i_type
!=
ItemTeletextChanged_Type
&&
i_type
!=
ItemStateChanged_Type
&&
i_type
!=
ItemStateChanged_Type
&&
i_type
!=
StatisticsUpdate_Type
&&
i_type
!=
StatisticsUpdate_Type
&&
i_type
!=
InterfaceVoutUpdate_Type
)
i_type
!=
InterfaceVoutUpdate_Type
&&
i_type
!=
MetaChanged_Type
)
return
;
return
;
/* TODO ItemStateChanged_Type: should probably be reviewed */
if
(
i_type
==
ItemStateChanged_Type
)
if
(
i_type
==
ItemStateChanged_Type
)
{
{
UpdateNavigation
();
UpdateNavigation
();
...
@@ -209,11 +164,12 @@ void InputManager::customEvent( QEvent *event )
...
@@ -209,11 +164,12 @@ void InputManager::customEvent( QEvent *event )
if
(
(
i_type
!=
PositionUpdate_Type
&&
if
(
(
i_type
!=
PositionUpdate_Type
&&
i_type
!=
ItemRateChanged_Type
&&
i_type
!=
ItemRateChanged_Type
&&
i_type
!=
Item
Spu
Changed_Type
&&
i_type
!=
Item
Es
Changed_Type
&&
i_type
!=
ItemTeletextChanged_Type
&&
i_type
!=
ItemTeletextChanged_Type
&&
i_type
!=
ItemStateChanged_Type
&&
i_type
!=
ItemStateChanged_Type
&&
i_type
!=
StatisticsUpdate_Type
&&
i_type
!=
StatisticsUpdate_Type
&&
i_type
!=
InterfaceVoutUpdate_Type
i_type
!=
InterfaceVoutUpdate_Type
&&
i_type
!=
MetaChanged_Type
)
)
&&
(
i_input_id
!=
ple
->
i_id
)
)
&&
(
i_input_id
!=
ple
->
i_id
)
)
return
;
return
;
...
@@ -236,6 +192,10 @@ void InputManager::customEvent( QEvent *event )
...
@@ -236,6 +192,10 @@ void InputManager::customEvent( QEvent *event )
UpdateStatus
();
UpdateStatus
();
UpdateArt
();
UpdateArt
();
break
;
break
;
case
MetaChanged_Type
:
UpdateMeta
();
UpdateArt
();
break
;
case
ItemStateChanged_Type
:
case
ItemStateChanged_Type
:
UpdateStatus
();
UpdateStatus
();
UpdateNavigation
();
UpdateNavigation
();
...
@@ -248,7 +208,7 @@ void InputManager::customEvent( QEvent *event )
...
@@ -248,7 +208,7 @@ void InputManager::customEvent( QEvent *event )
case
ItemRateChanged_Type
:
case
ItemRateChanged_Type
:
UpdateRate
();
UpdateRate
();
break
;
break
;
case
Item
Spu
Changed_Type
:
case
Item
Es
Changed_Type
:
UpdateSPU
();
UpdateSPU
();
break
;
break
;
case
ItemTeletextChanged_Type
:
case
ItemTeletextChanged_Type
:
...
@@ -763,98 +723,71 @@ void MainInputManager::togglePlayPause()
...
@@ -763,98 +723,71 @@ void MainInputManager::togglePlayPause()
/* Static callbacks */
/* Static callbacks */
/* IM */
/* IM */
static
int
InterfaceChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
static
int
ItemChanged
(
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
)
{
/* FIXME remove that static variable */
static
int
counter
=
0
;
InputManager
*
im
=
(
InputManager
*
)
param
;
counter
=
++
counter
%
4
;
if
(
!
counter
)
return
VLC_SUCCESS
;
IMEvent
*
event
=
new
IMEvent
(
PositionUpdate_Type
,
0
);
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
return
VLC_SUCCESS
;
}
static
int
StatisticsUpdated
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
InputManager
*
im
=
(
InputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
StatisticsUpdate_Type
,
0
);
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
return
VLC_SUCCESS
;
}
static
int
InterfaceVoutChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
InputManager
*
im
=
(
InputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
InterfaceVoutUpdate_Type
,
0
);
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
return
VLC_SUCCESS
;
}
static
int
ItemStateChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
{
InputManager
*
im
=
(
InputManager
*
)
param
;
InputManager
*
im
=
(
InputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
Item
StateChanged_Type
,
0
);
IMEvent
*
event
=
new
IMEvent
(
Item
Changed_Type
,
newval
.
i_int
);
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
static
int
I
temRateChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
static
int
I
nputEvent
(
vlc_object_t
*
p_this
,
const
char
*
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
vlc_value_t
,
vlc_value_t
newval
,
void
*
param
)
{
{
InputManager
*
im
=
(
InputManager
*
)
param
;
InputManager
*
im
=
(
InputManager
*
)
param
;
IMEvent
*
event
;
IMEvent
*
event
=
new
IMEvent
(
ItemRateChanged_Type
,
0
);
switch
(
newval
.
i_int
)
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
{
return
VLC_SUCCESS
;
case
INPUT_EVENT_STATE
:
}
event
=
new
IMEvent
(
ItemStateChanged_Type
,
0
);
break
;
static
int
ItemTitleChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
case
INPUT_EVENT_RATE
:
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
event
=
new
IMEvent
(
ItemRateChanged_Type
,
0
);
{
break
;
InputManager
*
im
=
(
InputManager
*
)
param
;
case
INPUT_EVENT_TIMES
:
event
=
new
IMEvent
(
PositionUpdate_Type
,
0
);
break
;
IMEvent
*
event
=
new
IMEvent
(
ItemTitleChanged_Type
,
0
);
case
INPUT_EVENT_STATISTICS
:
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
event
=
new
IMEvent
(
StatisticsUpdate_Type
,
0
);
return
VLC_SUCCESS
;
break
;
}
case
INPUT_EVENT_VOUT
:
event
=
new
IMEvent
(
InterfaceVoutUpdate_Type
,
0
);
break
;
static
int
ItemChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
case
INPUT_EVENT_TITLE
:
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
case
INPUT_EVENT_CHAPTER
:
/* TODO is that correct ? */
{
event
=
new
IMEvent
(
ItemTitleChanged_Type
,
0
);
InputManager
*
im
=
(
InputManager
*
)
param
;
break
;
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
,
newval
.
i_int
);
case
INPUT_EVENT_ITEM_META
:
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
case
INPUT_EVENT_ITEM_INFO
:
return
VLC_SUCCESS
;
case
INPUT_EVENT_ITEM_NAME
:
}
event
=
new
IMEvent
(
MetaChanged_Type
,
0
);
break
;
static
int
ChangeSPU
(
vlc_object_t
*
p_this
,
const
char
*
var
,
vlc_value_t
o
,
case
INPUT_EVENT_ES
:
vlc_value_t
n
,
void
*
param
)
event
=
new
IMEvent
(
ItemEsChanged_Type
,
0
);
{
break
;
InputManager
*
im
=
(
InputManager
*
)
param
;
case
INPUT_EVENT_TELETEXT
:
IMEvent
*
event
=
new
IMEvent
(
ItemSpuChanged_Type
,
0
);
event
=
new
IMEvent
(
ItemTeletextChanged_Type
,
0
);
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
break
;
return
VLC_SUCCESS
;
}
static
int
ChangeTeletext
(
vlc_object_t
*
p_this
,
const
char
*
var
,
vlc_value_t
o
,
case
INPUT_EVENT_PROGRAM
:
vlc_value_t
n
,
void
*
param
)
case
INPUT_EVENT_RECORD
:
{
case
INPUT_EVENT_SIGNAL
:
case
INPUT_EVENT_AUDIO_DELAY
:
case
INPUT_EVENT_SUBTITLE_DELAY
:
default:
event
=
NULL
;
break
;
}
InputManager
*
im
=
(
InputManager
*
)
param
;
if
(
event
)
IMEvent
*
event
=
new
IMEvent
(
ItemTeletextChanged_Type
,
0
);
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
QApplication
::
postEvent
(
im
,
static_cast
<
QEvent
*>
(
event
)
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -878,3 +811,5 @@ static int VolumeChanged( vlc_object_t *p_this, const char *psz_var,
...
@@ -878,3 +811,5 @@ static int VolumeChanged( vlc_object_t *p_this, const char *psz_var,
QApplication
::
postEvent
(
mim
,
static_cast
<
QEvent
*>
(
event
)
);
QApplication
::
postEvent
(
mim
,
static_cast
<
QEvent
*>
(
event
)
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
modules/gui/qt4/input_manager.hpp
View file @
1ae86f62
...
@@ -43,10 +43,11 @@ enum {
...
@@ -43,10 +43,11 @@ enum {
ItemTitleChanged_Type
,
ItemTitleChanged_Type
,
ItemRateChanged_Type
,
ItemRateChanged_Type
,
VolumeChanged_Type
,
VolumeChanged_Type
,
Item
Spu
Changed_Type
,
Item
Es
Changed_Type
,
ItemTeletextChanged_Type
,
ItemTeletextChanged_Type
,
InterfaceVoutUpdate_Type
,
InterfaceVoutUpdate_Type
,
StatisticsUpdate_Type
,
StatisticsUpdate_Type
,
MetaChanged_Type
,
FullscreenControlToggle_Type
=
QEvent
::
User
+
IMEventType
+
20
,
FullscreenControlToggle_Type
=
QEvent
::
User
+
IMEventType
+
20
,
FullscreenControlShow_Type
,
FullscreenControlShow_Type
,
...
...
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