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
a7765cbe
Commit
a7765cbe
authored
Nov 28, 2008
by
Geoffroy Couprie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WinCE: update the use of messages subscription
parent
b047088a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
70 deletions
+54
-70
modules/gui/wince/dialogs.cpp
modules/gui/wince/dialogs.cpp
+0
-3
modules/gui/wince/messages.cpp
modules/gui/wince/messages.cpp
+41
-58
modules/gui/wince/wince.cpp
modules/gui/wince/wince.cpp
+0
-5
modules/gui/wince/wince.h
modules/gui/wince/wince.h
+13
-4
No files found.
modules/gui/wince/dialogs.cpp
View file @
a7765cbe
...
...
@@ -150,9 +150,6 @@ LRESULT DialogsProvider::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
void
DialogsProvider
::
OnIdle
(
void
)
{
/* Update the log window */
if
(
p_messages_dialog
)
p_messages_dialog
->
UpdateLog
();
/* Update the playlist */
if
(
p_playlist_dialog
)
p_playlist_dialog
->
UpdatePlaylist
();
...
...
modules/gui/wince/messages.cpp
View file @
a7765cbe
...
...
@@ -63,6 +63,16 @@ Messages::Messages( intf_thread_t *p_intf, CBaseWindow *p_parent,
WS_POPUP
|
WS_CAPTION
|
WS_SYSMENU
|
WS_SIZEBOX
,
0
,
0
,
/*CW_USEDEFAULT*/
300
,
/*CW_USEDEFAULT*/
300
,
p_parent
->
GetHandle
(),
NULL
,
h_inst
,
(
void
*
)
this
);
// Suscribe to messages bank
cb_data
=
new
msg_cb_data_t
;
cb_data
->
self
=
this
;
sub
=
msg_Subscribe
(
p_intf
->
p_libvlc
,
sinkMessage
,
cb_data
);
}
Messages
::~
Messages
()
{
delete
cb_data
;
msg_Unsubscribe
(
sub
);
}
/***********************************************************************
...
...
@@ -124,10 +134,6 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
SHFullScreen
(
hwnd
,
SHFS_HIDESIPBUTTON
);
break
;
case
WM_TIMER
:
UpdateLog
();
break
;
case
WM_CLOSE
:
Show
(
FALSE
);
return
TRUE
;
...
...
@@ -191,65 +197,42 @@ LRESULT Messages::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
return
DefWindowProc
(
hwnd
,
msg
,
wp
,
lp
);
}
void
Messages
::
UpdateLog
()
void
Messages
::
sinkMessage
(
msg_cb_data_t
*
data
,
msg_item_t
*
item
,
unsigned
overruns
)
{
msg_subscription_t
*
p_sub
=
p_intf
->
p_sys
->
p_sub
;
string
debug
;
int
i_start
,
i_stop
;
Messages
*
self
=
data
->
self
;
vlc_mutex_lock
(
p_sub
->
p_lock
);
i_stop
=
*
p_sub
->
pi_stop
;
vlc_mutex_unlock
(
p_sub
->
p_lock
);
if
(
p_sub
->
i_start
!=
i_stop
)
{
for
(
i_start
=
p_sub
->
i_start
;
i_start
!=
i_stop
;
i_start
=
(
i_start
+
1
)
%
VLC_MSG_QSIZE
)
{
vlc_value_t
val
;
var_Get
(
p_intf
->
p_libvlc
,
"verbose"
,
&
val
);
self
->
sinkMessage
(
item
,
overruns
);
}
switch
(
p_sub
->
p_msg
[
i_start
].
i_type
)
{
case
VLC_MSG_ERR
:
case
VLC_MSG_INFO
:
if
(
val
.
i_int
<
0
)
continue
;
break
;
case
VLC_MSG_WARN
:
if
(
val
.
i_int
<
1
)
continue
;
break
;
case
VLC_MSG_DBG
:
if
(
val
.
i_int
<
2
)
continue
;
break
;
}
void
Messages
::
sinkMessage
(
msg_item_t
*
item
,
unsigned
overruns
)
{
vlc_value_t
val
;
var_Get
(
p_intf
->
p_libvlc
,
"verbose"
,
&
val
);
/* Append all messages to log window */
debug
=
p_sub
->
p_msg
[
i_start
].
psz_module
;
switch
(
p_sub
->
p_msg
[
i_start
].
i_type
)
{
case
VLC_MSG_INFO
:
debug
+=
": "
;
break
;
case
VLC_MSG_ERR
:
debug
+=
" error: "
;
break
;
case
VLC_MSG_WARN
:
debug
+=
" warning: "
;
break
;
default:
debug
+=
" debug: "
;
break
;
}
/* Add message */
debug
+=
p_sub
->
p_msg
[
i_start
].
psz_msg
;
LVITEM
lv
;
lv
.
mask
=
LVIF_TEXT
;
lv
.
pszText
=
TEXT
(
""
);
lv
.
cchTextMax
=
1
;
lv
.
iSubItem
=
0
;
lv
.
iItem
=
ListView_GetItemCount
(
hListView
);
ListView_InsertItem
(
hListView
,
&
lv
);
ListView_SetItemText
(
hListView
,
lv
.
iItem
,
0
,
(
TCHAR
*
)
_FROMMB
(
debug
.
c_str
())
);
}
/* Append all messages to log window */
string
debug
=
item
->
psz_module
;
vlc_mutex_lock
(
p_sub
->
p_lock
);
p_sub
->
i_start
=
i_start
;
vlc_mutex_unlock
(
p_sub
->
p_lock
);
switch
(
item
->
i_type
)
{
case
VLC_MSG_INFO
:
debug
+=
": "
;
break
;
case
VLC_MSG_ERR
:
debug
+=
" error: "
;
break
;
case
VLC_MSG_WARN
:
debug
+=
" warning: "
;
break
;
default:
debug
+=
" debug: "
;
break
;
}
/* Add message */
debug
+=
item
->
psz_msg
;
LVITEM
lv
;
lv
.
mask
=
LVIF_TEXT
;
lv
.
pszText
=
TEXT
(
""
);
lv
.
cchTextMax
=
1
;
lv
.
iSubItem
=
0
;
lv
.
iItem
=
ListView_GetItemCount
(
hListView
);
ListView_InsertItem
(
hListView
,
&
lv
);
ListView_SetItemText
(
hListView
,
lv
.
iItem
,
0
,
(
TCHAR
*
)
_FROMMB
(
debug
.
c_str
())
);
}
modules/gui/wince/wince.cpp
View file @
a7765cbe
...
...
@@ -116,8 +116,6 @@ static int Open( vlc_object_t *p_this )
if
(
p_intf
->
p_sys
==
NULL
)
return
VLC_ENOMEM
;
// Suscribe to messages bank
p_intf
->
p_sys
->
p_sub
=
msg_Subscribe
(
p_intf
);
// Misc init
p_intf
->
p_sys
->
p_audio_menu
=
NULL
;
...
...
@@ -179,9 +177,6 @@ static void Close( vlc_object_t *p_this )
vlc_thread_join
(
p_intf
);
}
// Unsuscribe to messages bank
msg_Unsubscribe
(
p_intf
,
p_intf
->
p_sys
->
p_sub
);
// Destroy structure
free
(
p_intf
->
p_sys
);
}
...
...
modules/gui/wince/wince.h
View file @
a7765cbe
...
...
@@ -40,6 +40,7 @@
#endif
#include "vlc_keys.h"
#include <vlc_messages.h>
#include <stdio.h>
#include <string>
...
...
@@ -69,8 +70,7 @@ struct intf_sys_t
int
i_slider_oldpos
;
/* previous position */
bool
b_slider_free
;
/* slider status */
/* The messages window */
msg_subscription_t
*
p_sub
;
/* message bank subscription */
/* Playlist management */
int
i_playing
;
/* playlist selected item */
...
...
@@ -212,20 +212,29 @@ protected:
BOOL
CreateTreeView
(
HWND
);
};
struct
msg_cb_data_t
{
Messages
*
self
;
};
/* Messages */
class
Messages
:
public
CBaseWindow
{
public:
/* Constructor */
Messages
(
intf_thread_t
*
,
CBaseWindow
*
,
HINSTANCE
);
virtual
~
Messages
(){}
;
~
Messages
()
;
void
UpdateLog
(
void
);
static
void
sinkMessage
(
msg_cb_data_t
*
,
msg_item_t
*
,
unsigned
);
void
sinkMessage
(
msg_item_t
*
item
,
unsigned
);
protected:
virtual
LRESULT
WndProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
/* The messages window */
msg_subscription_t
*
sub
;
/* message bank subscription */
msg_cb_data_t
*
cb_data
;
HWND
hListView
;
bool
b_verbose
;
};
...
...
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