Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
07afa46c
Commit
07afa46c
authored
Nov 23, 2003
by
ipkiss
Browse files
Use snprintf instead of sprintf
parent
20da59b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/gui/wxwindows/timer.cpp
View file @
07afa46c
/*****************************************************************************
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-200
1
VideoLAN
* $Id: timer.cpp,v 1.3
4
2003/1
0/15 12:24:14 gbazin
Exp $
* Copyright (C) 2000-200
3
VideoLAN
* $Id: timer.cpp,v 1.3
5
2003/1
1/23 22:29:27 ipkiss
Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -40,7 +40,7 @@
/* Callback prototype */
static
int
PopupMenuCB
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
);
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
);
/*****************************************************************************
* Constructor.
...
...
@@ -97,9 +97,9 @@ void Timer::Notify()
/* Update the input */
if
(
p_intf
->
p_sys
->
p_input
==
NULL
)
{
p_intf
->
p_sys
->
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
p_intf
->
p_sys
->
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
/* Show slider */
if
(
p_intf
->
p_sys
->
p_input
)
...
...
@@ -186,26 +186,28 @@ void Timer::Notify()
vlc_value_t
pos
;
char
psz_time
[
OFFSETTOTIME_MAX_SIZE
];
vlc_value_t
time
;
mtime_t
i_seconds
;
mtime_t
i_seconds
;
/* Update the value */
var_Get
(
p_input
,
"position"
,
&
pos
);
if
(
pos
.
f_float
>=
0.0
)
{
p_intf
->
p_sys
->
i_slider_pos
=
(
int
)(
SLIDER_MAX_POS
*
pos
.
f_float
);
p_intf
->
p_sys
->
i_slider_pos
=
(
int
)(
SLIDER_MAX_POS
*
pos
.
f_float
);
p_main_interface
->
slider
->
SetValue
(
p_intf
->
p_sys
->
i_slider_pos
);
p_main_interface
->
slider
->
SetValue
(
p_intf
->
p_sys
->
i_slider_pos
);
var_Get
(
p_intf
->
p_sys
->
p_input
,
"time"
,
&
time
);
i_seconds
=
time
.
i_time
/
1000000
;
sprintf
(
psz_time
,
"%d:%02d:%02d"
,
(
int
)
(
i_seconds
/
(
60
*
60
)),
(
int
)
(
i_seconds
/
60
%
60
),
(
int
)
(
i_seconds
%
60
)
);
snprintf
(
psz_time
,
OFFSETTOTIME_MAX_SIZE
,
"%d:%02d:%02d"
,
(
int
)
(
i_seconds
/
(
60
*
60
)),
(
int
)
(
i_seconds
/
60
%
60
),
(
int
)
(
i_seconds
%
60
)
);
p_main_interface
->
slider_box
->
SetLabel
(
wxU
(
psz_time
)
);
p_main_interface
->
slider_box
->
SetLabel
(
wxU
(
psz_time
)
);
}
}
}
...
...
@@ -266,8 +268,10 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
if
(
p_intf
->
p_sys
->
pf_show_dialog
)
{
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_POPUPMENU
,
new_val
.
b_bool
,
0
);
}
return
VLC_SUCCESS
;
}
Write
Preview
Supports
Markdown
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