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
71ea4eb9
Commit
71ea4eb9
authored
Feb 10, 2003
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the messages update function to another thread. It prevents it from
freezing the main window (cannot seek anymore, etc).
parent
2d68f9c1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
77 deletions
+94
-77
modules/gui/beos/InterfaceWindow.cpp
modules/gui/beos/InterfaceWindow.cpp
+1
-6
modules/gui/beos/InterfaceWindow.h
modules/gui/beos/InterfaceWindow.h
+2
-2
modules/gui/beos/MessagesWindow.cpp
modules/gui/beos/MessagesWindow.cpp
+90
-65
modules/gui/beos/MessagesWindow.h
modules/gui/beos/MessagesWindow.h
+1
-4
No files found.
modules/gui/beos/InterfaceWindow.cpp
View file @
71ea4eb9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* InterfaceWindow.cpp: beos interface
* InterfaceWindow.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.cpp,v 1.
29 2003/02/09 17:10:52 stippi
Exp $
* $Id: InterfaceWindow.cpp,v 1.
30 2003/02/10 15:23:46 titer
Exp $
*
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -791,11 +791,6 @@ void InterfaceWindow::UpdateInterface()
...
@@ -791,11 +791,6 @@ void InterfaceWindow::UpdateInterface()
}
}
}
}
// strangly, someone is calling this function even after the object has been destructed!
// even more strangly, this workarround seems to work
if
(
fMessagesWindow
)
fMessagesWindow
->
UpdateMessages
();
fLastUpdateTime
=
system_time
();
fLastUpdateTime
=
system_time
();
}
}
...
...
modules/gui/beos/InterfaceWindow.h
View file @
71ea4eb9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* InterfaceWindow.h: BeOS interface window class prototype
* InterfaceWindow.h: BeOS interface window class prototype
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.h,v 1.1
2 2003/02/09 17:10:52 stippi
Exp $
* $Id: InterfaceWindow.h,v 1.1
3 2003/02/10 15:23:46 titer
Exp $
*
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
* Tony Castley <tcastley@mail.powerup.com.au>
...
@@ -106,6 +106,7 @@ class InterfaceWindow : public BWindow
...
@@ -106,6 +106,7 @@ class InterfaceWindow : public BWindow
bool
IsStopped
()
const
;
bool
IsStopped
()
const
;
MediaControlView
*
p_mediaControl
;
MediaControlView
*
p_mediaControl
;
MessagesWindow
*
fMessagesWindow
;
private:
private:
void
_UpdatePlaylist
();
void
_UpdatePlaylist
();
...
@@ -126,7 +127,6 @@ class InterfaceWindow : public BWindow
...
@@ -126,7 +127,6 @@ class InterfaceWindow : public BWindow
BFilePanel
*
fFilePanel
;
BFilePanel
*
fFilePanel
;
PlayListWindow
*
fPlaylistWindow
;
PlayListWindow
*
fPlaylistWindow
;
PreferencesWindow
*
fPreferencesWindow
;
PreferencesWindow
*
fPreferencesWindow
;
MessagesWindow
*
fMessagesWindow
;
BMenuBar
*
fMenuBar
;
BMenuBar
*
fMenuBar
;
BMenuItem
*
fGotoMenuMI
;
BMenuItem
*
fGotoMenuMI
;
BMenuItem
*
fNextTitleMI
;
BMenuItem
*
fNextTitleMI
;
...
...
modules/gui/beos/MessagesWindow.cpp
View file @
71ea4eb9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* MessagesWindow.cpp: beos interface
* MessagesWindow.cpp: beos interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MessagesWindow.cpp,v 1.
6 2003/02/01 12:01:11 stippi
Exp $
* $Id: MessagesWindow.cpp,v 1.
7 2003/02/10 15:23:46 titer
Exp $
*
*
* Authors: Eric Petit <titer@videolan.org>
* Authors: Eric Petit <titer@videolan.org>
*
*
...
@@ -31,8 +31,11 @@
...
@@ -31,8 +31,11 @@
/* BeOS module headers */
/* BeOS module headers */
#include "VlcWrapper.h"
#include "VlcWrapper.h"
#include "InterfaceWindow.h"
#include "MessagesWindow.h"
#include "MessagesWindow.h"
static
int
UpdateMessages
(
intf_thread_t
*
p_intf
);
/*****************************************************************************
/*****************************************************************************
* MessagesWindow::MessagesWindow
* MessagesWindow::MessagesWindow
*****************************************************************************/
*****************************************************************************/
...
@@ -42,7 +45,6 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
...
@@ -42,7 +45,6 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
B_NOT_ZOOMABLE
)
B_NOT_ZOOMABLE
)
{
{
this
->
p_intf
=
p_intf
;
this
->
p_intf
=
p_intf
;
p_sub
=
p_intf
->
p_sys
->
p_sub
;
BRect
rect
,
textRect
;
BRect
rect
,
textRect
;
...
@@ -62,6 +64,13 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
...
@@ -62,6 +64,13 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
/* start window thread in hidden state */
/* start window thread in hidden state */
Hide
();
Hide
();
Show
();
Show
();
/* update it */
if
(
vlc_thread_create
(
p_intf
,
"update messages"
,
UpdateMessages
,
VLC_THREAD_PRIORITY_LOW
,
VLC_FALSE
)
)
{
msg_Err
(
p_intf
,
"cannot create update messages thread"
);
}
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -69,6 +78,7 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
...
@@ -69,6 +78,7 @@ MessagesWindow::MessagesWindow( intf_thread_t * p_intf,
*****************************************************************************/
*****************************************************************************/
MessagesWindow
::~
MessagesWindow
()
MessagesWindow
::~
MessagesWindow
()
{
{
vlc_thread_join
(
p_intf
);
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -101,10 +111,21 @@ void MessagesWindow::ReallyQuit()
...
@@ -101,10 +111,21 @@ void MessagesWindow::ReallyQuit()
}
}
/*****************************************************************************
/*****************************************************************************
*
MessagesWindow::
UpdateMessages
* UpdateMessages
*****************************************************************************/
*****************************************************************************/
void
MessagesWindow
::
UpdateMessages
(
)
static
int
UpdateMessages
(
intf_thread_t
*
p_intf
)
{
{
/* workaround: wait a bit or it'll crash */
msleep
(
500000
);
intf_sys_t
*
p_sys
=
(
intf_sys_t
*
)
p_intf
->
p_sys
;
msg_subscription_t
*
p_sub
=
p_sys
->
p_sub
;
MessagesWindow
*
messagesWindow
=
p_sys
->
p_window
->
fMessagesWindow
;
BTextView
*
messagesView
=
messagesWindow
->
fMessagesView
;
BScrollBar
*
scrollBar
=
messagesWindow
->
fScrollBar
;
while
(
!
p_intf
->
b_die
)
{
int
i_start
,
oldLength
;
int
i_start
,
oldLength
;
char
*
psz_module_type
=
NULL
;
char
*
psz_module_type
=
NULL
;
rgb_color
red
=
{
200
,
0
,
0
};
rgb_color
red
=
{
200
,
0
,
0
};
...
@@ -147,27 +168,27 @@ void MessagesWindow::UpdateMessages()
...
@@ -147,27 +168,27 @@ void MessagesWindow::UpdateMessages()
case
VLC_OBJECT_SOUT
:
psz_module_type
=
"stream output"
;
break
;
case
VLC_OBJECT_SOUT
:
psz_module_type
=
"stream output"
;
break
;
}
}
if
(
fM
essagesView
->
LockLooper
()
)
if
(
m
essagesView
->
LockLooper
()
)
{
{
oldLength
=
fM
essagesView
->
TextLength
();
oldLength
=
m
essagesView
->
TextLength
();
BString
string
;
BString
string
;
string
<<
p_sub
->
p_msg
[
i_start
].
psz_module
<<
" "
<<
psz_module_type
<<
" : "
<<
string
<<
p_sub
->
p_msg
[
i_start
].
psz_module
<<
" "
<<
psz_module_type
<<
" : "
<<
p_sub
->
p_msg
[
i_start
].
psz_msg
<<
"
\n
"
;
p_sub
->
p_msg
[
i_start
].
psz_msg
<<
"
\n
"
;
fM
essagesView
->
Insert
(
string
.
String
()
);
m
essagesView
->
Insert
(
string
.
String
()
);
fM
essagesView
->
SetFontAndColor
(
oldLength
,
m
essagesView
->
SetFontAndColor
(
oldLength
,
fM
essagesView
->
TextLength
(),
m
essagesView
->
TextLength
(),
NULL
,
0
,
&
color
);
NULL
,
0
,
&
color
);
fMessagesView
->
Draw
(
fM
essagesView
->
Bounds
()
);
messagesView
->
Draw
(
m
essagesView
->
Bounds
()
);
fM
essagesView
->
UnlockLooper
();
m
essagesView
->
UnlockLooper
();
}
}
/* Scroll at the end */
/* Scroll at the end */
if
(
fS
crollBar
->
LockLooper
()
)
if
(
s
crollBar
->
LockLooper
()
)
{
{
float
min
,
max
;
float
min
,
max
;
fS
crollBar
->
GetRange
(
&
min
,
&
max
);
s
crollBar
->
GetRange
(
&
min
,
&
max
);
fS
crollBar
->
SetValue
(
max
);
s
crollBar
->
SetValue
(
max
);
fS
crollBar
->
UnlockLooper
();
s
crollBar
->
UnlockLooper
();
}
}
}
}
...
@@ -175,4 +196,8 @@ void MessagesWindow::UpdateMessages()
...
@@ -175,4 +196,8 @@ void MessagesWindow::UpdateMessages()
p_sub
->
i_start
=
i_start
;
p_sub
->
i_start
=
i_start
;
vlc_mutex_unlock
(
p_sub
->
p_lock
);
vlc_mutex_unlock
(
p_sub
->
p_lock
);
}
}
/* Wait a bit */
msleep
(
INTF_IDLE_SLEEP
);
}
return
0
;
}
}
modules/gui/beos/MessagesWindow.h
View file @
71ea4eb9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* MessagesWindow.h
* MessagesWindow.h
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MessagesWindow.h,v 1.
2 2003/01/26 08:28:20
titer Exp $
* $Id: MessagesWindow.h,v 1.
3 2003/02/10 15:23:46
titer Exp $
*
*
* Authors: Eric Petit <titer@videolan.org>
* Authors: Eric Petit <titer@videolan.org>
*
*
...
@@ -36,11 +36,8 @@ class MessagesWindow : public BWindow
...
@@ -36,11 +36,8 @@ class MessagesWindow : public BWindow
virtual
bool
QuitRequested
();
virtual
bool
QuitRequested
();
void
ReallyQuit
();
void
ReallyQuit
();
void
UpdateMessages
();
private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
msg_subscription_t
*
p_sub
;
BView
*
fBackgroundView
;
BView
*
fBackgroundView
;
BTextView
*
fMessagesView
;
BTextView
*
fMessagesView
;
...
...
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