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
087fcf43
Commit
087fcf43
authored
Aug 17, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: namespace IMEvent types
parent
f6d61f8b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
82 deletions
+81
-82
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.cpp
+7
-7
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+42
-42
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+31
-32
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+1
-1
No files found.
modules/gui/qt4/components/controller.cpp
View file @
087fcf43
...
...
@@ -938,7 +938,7 @@ void FullscreenControllerWidget::customEvent( QEvent *event )
switch
(
(
int
)
event
->
type
()
)
{
/* This is used when the 'i' hotkey is used, to force quick toggle */
case
FullscreenControlToggle_Type
:
case
IMEvent
:
:
FullscreenControlToggle_Type
:
vlc_mutex_lock
(
&
lock
);
b_fs
=
b_fullscreen
;
vlc_mutex_unlock
(
&
lock
);
...
...
@@ -955,7 +955,7 @@ void FullscreenControllerWidget::customEvent( QEvent *event )
}
break
;
/* Event called to Show the FSC on mouseChanged() */
case
FullscreenControlShow_Type
:
case
IMEvent
:
:
FullscreenControlShow_Type
:
vlc_mutex_lock
(
&
lock
);
b_fs
=
b_fullscreen
;
vlc_mutex_unlock
(
&
lock
);
...
...
@@ -965,12 +965,12 @@ void FullscreenControllerWidget::customEvent( QEvent *event )
break
;
/* Start the timer to hide later, called usually with above case */
case
FullscreenControlPlanHide_Type
:
case
IMEvent
:
:
FullscreenControlPlanHide_Type
:
if
(
!
b_mouse_over
)
// Only if the mouse is not over FSC
planHideFSC
();
break
;
/* Hide */
case
FullscreenControlHide_Type
:
case
IMEvent
:
:
FullscreenControlHide_Type
:
hideFSC
();
break
;
default:
...
...
@@ -1174,7 +1174,7 @@ void FullscreenControllerWidget::fullscreenChanged( vout_thread_t *p_vout,
FullscreenControllerWidgetMouseMoved
,
this
);
/* Force fs hiding */
IMEvent
*
eHide
=
new
IMEvent
(
FullscreenControlHide_Type
,
0
);
IMEvent
*
eHide
=
new
IMEvent
(
IMEvent
::
FullscreenControlHide_Type
,
0
);
QApplication
::
postEvent
(
this
,
eHide
);
}
vlc_mutex_unlock
(
&
lock
);
...
...
@@ -1202,11 +1202,11 @@ void FullscreenControllerWidget::mouseChanged( vout_thread_t *, int i_mousex, in
if
(
b_toShow
)
{
/* Show event */
IMEvent
*
eShow
=
new
IMEvent
(
FullscreenControlShow_Type
,
0
);
IMEvent
*
eShow
=
new
IMEvent
(
IMEvent
::
FullscreenControlShow_Type
,
0
);
QApplication
::
postEvent
(
this
,
eShow
);
/* Plan hide event */
IMEvent
*
eHide
=
new
IMEvent
(
FullscreenControlPlanHide_Type
,
0
);
IMEvent
*
eHide
=
new
IMEvent
(
IMEvent
::
FullscreenControlPlanHide_Type
,
0
);
QApplication
::
postEvent
(
this
,
eHide
);
}
}
...
...
modules/gui/qt4/input_manager.cpp
View file @
087fcf43
...
...
@@ -180,7 +180,7 @@ void InputManager::customEvent( QEvent *event )
int
i_type
=
event
->
type
();
IMEvent
*
ple
=
static_cast
<
IMEvent
*>
(
event
);
if
(
i_type
==
ItemChanged_Type
)
if
(
i_type
==
I
MEvent
::
I
temChanged_Type
)
UpdateMeta
(
ple
->
item
()
);
if
(
!
hasInput
()
)
...
...
@@ -189,13 +189,13 @@ void InputManager::customEvent( QEvent *event )
/* Actions */
switch
(
i_type
)
{
case
PositionUpdate_Type
:
case
IMEvent
:
:
PositionUpdate_Type
:
UpdatePosition
();
break
;
case
StatisticsUpdate_Type
:
case
IMEvent
:
:
StatisticsUpdate_Type
:
UpdateStats
();
break
;
case
ItemChanged_Type
:
case
I
MEvent
:
:
I
temChanged_Type
:
/* Ignore ItemChanged_Type event that does not apply to our input */
if
(
p_item
==
ple
->
item
()
)
{
...
...
@@ -206,60 +206,60 @@ void InputManager::customEvent( QEvent *event )
/* Update duration of file */
}
break
;
case
ItemStateChanged_Type
:
case
I
MEvent
:
:
I
temStateChanged_Type
:
// TODO: Fusion with above state
UpdateStatus
();
// UpdateName();
// UpdateNavigation(); This shouldn't be useful now
// UpdateTeletext(); Same
break
;
case
NameChanged_Type
:
case
IMEvent
:
:
NameChanged_Type
:
UpdateName
();
break
;
case
MetaChanged_Type
:
case
IMEvent
:
:
MetaChanged_Type
:
UpdateMeta
();
UpdateName
();
/* Needed for NowPlaying */
UpdateArt
();
/* Art is part of meta in the core */
break
;
case
InfoChanged_Type
:
case
I
MEvent
:
:
I
nfoChanged_Type
:
UpdateInfo
();
break
;
case
ItemTitleChanged_Type
:
case
I
MEvent
:
:
I
temTitleChanged_Type
:
UpdateNavigation
();
UpdateName
();
/* Display the name of the Chapter, if exists */
break
;
case
ItemRateChanged_Type
:
case
I
MEvent
:
:
I
temRateChanged_Type
:
UpdateRate
();
break
;
case
ItemEsChanged_Type
:
case
I
MEvent
:
:
I
temEsChanged_Type
:
UpdateTeletext
();
// We don't do anything ES related. Why ?
break
;
case
ItemTeletextChanged_Type
:
case
I
MEvent
:
:
I
temTeletextChanged_Type
:
UpdateTeletext
();
break
;
case
InterfaceVoutUpdate_Type
:
case
I
MEvent
:
:
I
nterfaceVoutUpdate_Type
:
UpdateVout
();
break
;
case
SynchroChanged_Type
:
case
IMEvent
:
:
SynchroChanged_Type
:
emit
synchroChanged
();
break
;
case
CachingEvent_Type
:
case
IMEvent
:
:
CachingEvent_Type
:
UpdateCaching
();
break
;
case
BookmarksChanged_Type
:
case
IMEvent
:
:
BookmarksChanged_Type
:
emit
bookmarksChanged
();
break
;
case
InterfaceAoutUpdate_Type
:
case
I
MEvent
:
:
I
nterfaceAoutUpdate_Type
:
UpdateAout
();
break
;
case
RecordingEvent_Type
:
case
IMEvent
:
:
RecordingEvent_Type
:
UpdateRecord
();
break
;
case
ProgramChanged_Type
:
case
IMEvent
:
:
ProgramChanged_Type
:
UpdateProgramEvent
();
break
;
case
EPGEvent_Type
:
case
IMEvent
:
:
EPGEvent_Type
:
UpdateEPG
();
break
;
default:
...
...
@@ -289,7 +289,7 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
InputManager
*
im
=
(
InputManager
*
)
param
;
input_item_t
*
p_item
=
static_cast
<
input_item_t
*>
(
newval
.
p_address
);
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
,
p_item
);
IMEvent
*
event
=
new
IMEvent
(
I
MEvent
::
I
temChanged_Type
,
p_item
);
im
->
postUniqueEvent
(
im
,
event
);
return
VLC_SUCCESS
;
}
...
...
@@ -306,75 +306,75 @@ static int InputEvent( vlc_object_t *p_this, const char *,
switch
(
newval
.
i_int
)
{
case
INPUT_EVENT_STATE
:
event
=
new
IMEvent
(
ItemStateChanged_Type
);
event
=
new
IMEvent
(
I
MEvent
::
I
temStateChanged_Type
);
break
;
case
INPUT_EVENT_RATE
:
event
=
new
IMEvent
(
ItemRateChanged_Type
);
event
=
new
IMEvent
(
I
MEvent
::
I
temRateChanged_Type
);
break
;
case
INPUT_EVENT_POSITION
:
//case INPUT_EVENT_LENGTH:
event
=
new
IMEvent
(
PositionUpdate_Type
);
event
=
new
IMEvent
(
IMEvent
::
PositionUpdate_Type
);
break
;
case
INPUT_EVENT_TITLE
:
case
INPUT_EVENT_CHAPTER
:
event
=
new
IMEvent
(
ItemTitleChanged_Type
);
event
=
new
IMEvent
(
I
MEvent
::
I
temTitleChanged_Type
);
break
;
case
INPUT_EVENT_ES
:
event
=
new
IMEvent
(
ItemEsChanged_Type
);
event
=
new
IMEvent
(
I
MEvent
::
I
temEsChanged_Type
);
break
;
case
INPUT_EVENT_TELETEXT
:
event
=
new
IMEvent
(
ItemTeletextChanged_Type
);
event
=
new
IMEvent
(
I
MEvent
::
I
temTeletextChanged_Type
);
break
;
case
INPUT_EVENT_STATISTICS
:
event
=
new
IMEvent
(
StatisticsUpdate_Type
);
event
=
new
IMEvent
(
IMEvent
::
StatisticsUpdate_Type
);
break
;
case
INPUT_EVENT_VOUT
:
event
=
new
IMEvent
(
InterfaceVoutUpdate_Type
);
event
=
new
IMEvent
(
I
MEvent
::
I
nterfaceVoutUpdate_Type
);
break
;
case
INPUT_EVENT_AOUT
:
event
=
new
IMEvent
(
InterfaceAoutUpdate_Type
);
event
=
new
IMEvent
(
I
MEvent
::
I
nterfaceAoutUpdate_Type
);
break
;
case
INPUT_EVENT_ITEM_META
:
/* Codec MetaData + Art */
b_unified
=
true
;
event
=
new
IMEvent
(
MetaChanged_Type
);
event
=
new
IMEvent
(
IMEvent
::
MetaChanged_Type
);
break
;
case
INPUT_EVENT_ITEM_INFO
:
/* Codec Info */
event
=
new
IMEvent
(
InfoChanged_Type
);
event
=
new
IMEvent
(
I
MEvent
::
I
nfoChanged_Type
);
break
;
case
INPUT_EVENT_ITEM_NAME
:
event
=
new
IMEvent
(
NameChanged_Type
);
event
=
new
IMEvent
(
IMEvent
::
NameChanged_Type
);
break
;
case
INPUT_EVENT_AUDIO_DELAY
:
case
INPUT_EVENT_SUBTITLE_DELAY
:
event
=
new
IMEvent
(
SynchroChanged_Type
);
event
=
new
IMEvent
(
IMEvent
::
SynchroChanged_Type
);
break
;
case
INPUT_EVENT_CACHE
:
event
=
new
IMEvent
(
CachingEvent_Type
);
event
=
new
IMEvent
(
IMEvent
::
CachingEvent_Type
);
break
;
case
INPUT_EVENT_BOOKMARK
:
event
=
new
IMEvent
(
BookmarksChanged_Type
);
event
=
new
IMEvent
(
IMEvent
::
BookmarksChanged_Type
);
break
;
case
INPUT_EVENT_RECORD
:
event
=
new
IMEvent
(
RecordingEvent_Type
);
event
=
new
IMEvent
(
IMEvent
::
RecordingEvent_Type
);
break
;
case
INPUT_EVENT_PROGRAM
:
/* This is for PID changes */
event
=
new
IMEvent
(
ProgramChanged_Type
);
event
=
new
IMEvent
(
IMEvent
::
ProgramChanged_Type
);
break
;
case
INPUT_EVENT_ITEM_EPG
:
/* EPG data changed */
event
=
new
IMEvent
(
EPGEvent_Type
);
event
=
new
IMEvent
(
IMEvent
::
EPGEvent_Type
);
break
;
case
INPUT_EVENT_SIGNAL
:
...
...
@@ -400,7 +400,7 @@ static int VbiEvent( vlc_object_t *, const char *,
vlc_value_t
,
vlc_value_t
,
void
*
param
)
{
InputManager
*
im
=
(
InputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
ItemTeletextChanged_Type
);
IMEvent
*
event
=
new
IMEvent
(
I
MEvent
::
I
temTeletextChanged_Type
);
QApplication
::
postEvent
(
im
,
event
);
return
VLC_SUCCESS
;
...
...
@@ -1044,7 +1044,7 @@ void MainInputManager::customEvent( QEvent *event )
emit
leafBecameParent
(
plEv
->
getItemId
()
);
return
;
default:
if
(
type
!=
ItemChanged_Type
)
return
;
if
(
type
!=
I
MEvent
::
I
temChanged_Type
)
return
;
}
/* Should be PLItemChanged Event */
...
...
@@ -1215,7 +1215,7 @@ static int PLItemChanged( vlc_object_t *p_this, const char *psz_var,
MainInputManager
*
mim
=
(
MainInputManager
*
)
param
;
IMEvent
*
event
=
new
IMEvent
(
ItemChanged_Type
);
IMEvent
*
event
=
new
IMEvent
(
I
MEvent
::
I
temChanged_Type
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
}
...
...
modules/gui/qt4/input_manager.hpp
View file @
087fcf43
...
...
@@ -39,36 +39,6 @@
#include <QObject>
#include <QEvent>
enum
{
PositionUpdate_Type
=
QEvent
::
User
+
IMEventTypeOffset
+
1
,
ItemChanged_Type
,
ItemStateChanged_Type
,
ItemTitleChanged_Type
,
ItemRateChanged_Type
,
ItemEsChanged_Type
,
ItemTeletextChanged_Type
,
InterfaceVoutUpdate_Type
,
StatisticsUpdate_Type
,
/*10*/
InterfaceAoutUpdate_Type
,
MetaChanged_Type
,
NameChanged_Type
,
InfoChanged_Type
,
SynchroChanged_Type
,
CachingEvent_Type
,
BookmarksChanged_Type
,
RecordingEvent_Type
,
ProgramChanged_Type
,
RandomChanged_Type
,
LoopOrRepeatChanged_Type
,
EPGEvent_Type
,
/* SignalChanged_Type, */
FullscreenControlToggle_Type
=
QEvent
::
User
+
IMEventTypeOffset
+
20
,
FullscreenControlShow_Type
,
FullscreenControlHide_Type
,
FullscreenControlPlanHide_Type
,
};
enum
{
NORMAL
,
/* loop: 0, repeat: 0 */
REPEAT_ONE
,
/* loop: 0, repeat: 1 */
REPEAT_ALL
,
/* loop: 1, repeat: 0 */
...
...
@@ -76,8 +46,37 @@ enum { NORMAL, /* loop: 0, repeat: 0 */
class
IMEvent
:
public
UniqueEvent
{
public:
IMEvent
(
int
type
,
input_item_t
*
p_input
=
NULL
)
public:
enum
event_types
{
PositionUpdate_Type
=
QEvent
::
User
+
IMEventTypeOffset
+
1
,
ItemChanged_Type
,
ItemStateChanged_Type
,
ItemTitleChanged_Type
,
ItemRateChanged_Type
,
ItemEsChanged_Type
,
ItemTeletextChanged_Type
,
InterfaceVoutUpdate_Type
,
StatisticsUpdate_Type
,
/*10*/
InterfaceAoutUpdate_Type
,
MetaChanged_Type
,
NameChanged_Type
,
InfoChanged_Type
,
SynchroChanged_Type
,
CachingEvent_Type
,
BookmarksChanged_Type
,
RecordingEvent_Type
,
ProgramChanged_Type
,
RandomChanged_Type
,
LoopOrRepeatChanged_Type
,
EPGEvent_Type
,
/* SignalChanged_Type, */
FullscreenControlToggle_Type
=
QEvent
::
User
+
IMEventTypeOffset
+
20
,
FullscreenControlShow_Type
,
FullscreenControlHide_Type
,
FullscreenControlPlanHide_Type
,
};
IMEvent
(
event_types
type
,
input_item_t
*
p_input
=
NULL
)
:
UniqueEvent
(
(
QEvent
::
Type
)(
type
)
)
{
if
(
(
p_item
=
p_input
)
!=
NULL
)
...
...
modules/gui/qt4/main_interface.cpp
View file @
087fcf43
...
...
@@ -613,7 +613,7 @@ void MainInterface::toggleFSC()
{
if
(
!
fullscreenControls
)
return
;
IMEvent
*
eShow
=
new
IMEvent
(
FullscreenControlToggle_Type
);
IMEvent
*
eShow
=
new
IMEvent
(
IMEvent
::
FullscreenControlToggle_Type
);
QApplication
::
postEvent
(
fullscreenControls
,
eShow
);
}
...
...
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