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
eb84c196
Commit
eb84c196
authored
Apr 16, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
showintf: fix a variable type (bool instead of int) and do some cleanup.
parent
a155e540
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
51 deletions
+18
-51
modules/control/showintf.c
modules/control/showintf.c
+18
-51
No files found.
modules/control/showintf.c
View file @
eb84c196
...
...
@@ -44,11 +44,11 @@
*****************************************************************************/
struct
intf_sys_t
{
vlc_mutex_t
lock
;
vlc_object_t
*
p_vout
;
bool
b_button_pressed
;
bool
b_triggered
;
int
i_threshold
;
vlc_mutex_t
lock
;
vlc_object_t
*
p_vout
;
bool
b_button_pressed
;
bool
b_triggered
;
int
i_threshold
;
};
/*****************************************************************************
...
...
@@ -57,7 +57,6 @@ struct intf_sys_t
int
Open
(
vlc_object_t
*
);
void
Close
(
vlc_object_t
*
);
static
void
RunIntf
(
intf_thread_t
*
p_intf
);
static
int
InitThread
(
intf_thread_t
*
p_intf
);
static
int
MouseEvent
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
...
...
@@ -84,16 +83,19 @@ int Open( vlc_object_t *p_this )
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
/* Allocate instance and initialize some members */
p_intf
->
p_sys
=
malloc
(
sizeof
(
intf_sys_t
)
);
if
(
p_intf
->
p_sys
==
NULL
)
{
return
(
1
);
};
intf_sys_t
*
p_sys
=
p_intf
->
p_sys
=
malloc
(
sizeof
(
intf_sys_t
)
);
if
(
p_sys
==
NULL
)
return
VLC_ENOMEM
;
vlc_mutex_init
(
&
p_sys
->
lock
);
p_sys
->
p_vout
=
NULL
;
p_sys
->
b_button_pressed
=
false
;
p_sys
->
b_triggered
=
false
;
p_sys
->
i_threshold
=
config_GetInt
(
p_intf
,
"showintf-threshold"
);
vlc_mutex_init
(
&
p_intf
->
p_sys
->
lock
);
p_intf
->
pf_run
=
RunIntf
;
return
(
0
)
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -115,13 +117,6 @@ void Close( vlc_object_t *p_this )
static
void
RunIntf
(
intf_thread_t
*
p_intf
)
{
int
canc
=
vlc_savecancel
(
);
p_intf
->
p_sys
->
p_vout
=
NULL
;
if
(
InitThread
(
p_intf
)
<
0
)
{
msg_Err
(
p_intf
,
"cannot initialize interface"
);
return
;
}
/* Main loop */
while
(
vlc_object_alive
(
p_intf
)
)
...
...
@@ -177,30 +172,6 @@ static void RunIntf( intf_thread_t *p_intf )
vlc_restorecancel
(
canc
);
}
/*****************************************************************************
* InitThread:
*****************************************************************************/
static
int
InitThread
(
intf_thread_t
*
p_intf
)
{
if
(
vlc_object_alive
(
p_intf
)
)
{
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
lock
);
p_intf
->
p_sys
->
b_triggered
=
false
;
p_intf
->
p_sys
->
b_button_pressed
=
false
;
p_intf
->
p_sys
->
i_threshold
=
config_GetInt
(
p_intf
,
"showintf-threshold"
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
lock
);
return
0
;
}
else
{
return
-
1
;
}
}
/*****************************************************************************
* MouseEvent: callback for mouse events
*****************************************************************************/
...
...
@@ -208,7 +179,6 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
newval
);
vlc_value_t
val
;
int
i_mouse_x
,
i_mouse_y
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_data
;
...
...
@@ -218,17 +188,14 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
return
VLC_SUCCESS
;
/* Nothing to do when not in fullscreen mode */
var_Get
(
p_intf
->
p_sys
->
p_vout
,
"fullscreen"
,
&
val
);
if
(
!
val
.
i_int
)
if
(
!
var_GetBool
(
p_intf
->
p_sys
->
p_vout
,
"fullscreen"
)
)
return
VLC_SUCCESS
;
vlc_mutex_lock
(
&
p_intf
->
p_sys
->
lock
);
if
(
!
strcmp
(
psz_var
,
"mouse-moved"
)
&&
!
p_intf
->
p_sys
->
b_button_pressed
)
{
var_Get
(
p_intf
->
p_sys
->
p_vout
,
"mouse-x"
,
&
val
);
i_mouse_x
=
val
.
i_int
;
var_Get
(
p_intf
->
p_sys
->
p_vout
,
"mouse-y"
,
&
val
);
i_mouse_y
=
val
.
i_int
;
i_mouse_x
=
var_GetInteger
(
p_intf
->
p_sys
->
p_vout
,
"mouse-x"
);
i_mouse_y
=
var_GetInteger
(
p_intf
->
p_sys
->
p_vout
,
"mouse-y"
);
/* Very basic test, we even ignore the x value :) */
if
(
i_mouse_y
<
p_intf
->
p_sys
->
i_threshold
)
...
...
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