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
ba42d61b
Commit
ba42d61b
authored
Aug 27, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to put some background when there is no video
parent
a593fa18
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
22 deletions
+59
-22
modules/gui/qt4/components/video_widget.cpp
modules/gui/qt4/components/video_widget.cpp
+41
-15
modules/gui/qt4/components/video_widget.hpp
modules/gui/qt4/components/video_widget.hpp
+7
-1
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+10
-5
modules/gui/qt4/ui/main_interface.ui
modules/gui/qt4/ui/main_interface.ui
+1
-1
No files found.
modules/gui/qt4/components/video_widget.cpp
View file @
ba42d61b
...
...
@@ -26,6 +26,7 @@
#include "qt4.hpp"
#include "components/video_widget.hpp"
#include "main_interface.hpp"
#include <QHBoxLayout>
static
void
*
DoRequest
(
intf_thread_t
*
,
vout_thread_t
*
,
int
*
,
int
*
,
unsigned
int
*
,
unsigned
int
*
);
...
...
@@ -33,11 +34,12 @@ static void DoRelease( intf_thread_t *, void * );
static
int
DoControl
(
intf_thread_t
*
,
void
*
,
int
,
va_list
);
bool
need_update
;
VideoWidget
::
VideoWidget
(
intf_thread_t
*
_p_i
)
:
QFrame
(
NULL
),
p_intf
(
_p_i
)
VideoWidget
::
VideoWidget
(
intf_thread_t
*
_p_i
,
bool
_always
)
:
QFrame
(
NULL
),
p_intf
(
_p_i
)
{
vlc_mutex_init
(
p_intf
,
&
lock
);
always
=
_always
;
p_intf
->
pf_request_window
=
::
DoRequest
;
p_intf
->
pf_release_window
=
::
DoRelease
;
...
...
@@ -50,6 +52,9 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ),
connect
(
DialogsProvider
::
getInstance
(
NULL
)
->
fixed_timer
,
SIGNAL
(
timeout
()
),
this
,
SLOT
(
update
()
)
);
if
(
always
)
DrawBackground
();
need_update
=
false
;
}
...
...
@@ -106,6 +111,9 @@ void *VideoWidget::Request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
}
p_vout
=
p_nvout
;
if
(
always
)
CleanBackground
();
setMinimumSize
(
1
,
1
);
p_intf
->
p_sys
->
p_mi
->
videoSize
=
QSize
(
*
pi_width
,
*
pi_height
);
updateGeometry
();
...
...
@@ -120,23 +128,40 @@ static void DoRelease( intf_thread_t *p_intf, void *p_win )
void
VideoWidget
::
Release
(
void
*
p_win
)
{
if
(
!
config_GetInt
(
p_intf
,
"qt-always-video"
)
);
p_vout
=
NULL
;
if
(
config_GetInt
(
p_intf
,
"qt-always-video"
)
==
0
)
{
p_intf
->
p_sys
->
p_mi
->
videoSize
=
QSize
(
1
,
1
);
updateGeometry
();
need_update
=
true
;
}
else
{
DrawBackground
();
}
updateGeometry
();
if
(
!
config_GetInt
(
p_intf
,
"qt-always-video"
)
)
need_update
=
true
;
p_vout
=
NULL
;
}
static
int
DoControl
(
intf_thread_t
*
p_intf
,
void
*
p_win
,
int
i_q
,
va_list
a
)
{
return
p_intf
->
p_sys
->
p_video
->
Control
(
p_win
,
i_q
,
a
);
}
}
int
VideoWidget
::
DrawBackground
()
{
QLabel
*
label
=
new
QLabel
(
"VLC Rulez d4 Worldz"
);
backgroundLayout
=
new
QHBoxLayout
;
backgroundLayout
->
addWidget
(
label
);
setLayout
(
backgroundLayout
);
return
0
;
}
int
VideoWidget
::
CleanBackground
()
{
backgroundLayout
->
takeAt
(
0
);
delete
backgroundLayout
;
return
0
;
}
int
VideoWidget
::
Control
(
void
*
p_window
,
int
i_query
,
va_list
args
)
{
...
...
@@ -160,16 +185,17 @@ int VideoWidget::Control( void *p_window, int i_query, va_list args )
if
(
!
i_width
&&
p_vout
)
i_width
=
p_vout
->
i_window_width
;
if
(
!
i_height
&&
p_vout
)
i_height
=
p_vout
->
i_window_height
;
frame
->
resize
(
i_width
,
i_height
);
p_intf
->
p_sys
->
p_mi
->
videoSize
=
QSize
(
i_width
,
i_height
);
updateGeometry
();
need_update
=
true
;
i_ret
=
VLC_SUCCESS
;
break
;
break
;
}
case
VOUT_SET_STAY_ON_TOP
:
{
/// \todo
break
;
}
}
default:
msg_Warn
(
p_intf
,
"unsupported control query"
);
break
;
...
...
modules/gui/qt4/components/video_widget.hpp
View file @
ba42d61b
...
...
@@ -29,11 +29,13 @@
#include <QWidget>
#include <QFrame>
class
QHBoxLayout
;
class
VideoWidget
:
public
QFrame
{
Q_OBJECT
public:
VideoWidget
(
intf_thread_t
*
);
VideoWidget
(
intf_thread_t
*
,
bool
);
virtual
~
VideoWidget
();
virtual
QSize
sizeHint
()
const
;
...
...
@@ -45,7 +47,11 @@ public:
int
i_video_height
,
i_video_width
;
vout_thread_t
*
p_vout
;
private:
int
DrawBackground
();
int
CleanBackground
();
bool
always
;
QWidget
*
frame
;
QHBoxLayout
*
backgroundLayout
;
intf_thread_t
*
p_intf
;
vlc_mutex_t
lock
;
private
slots
:
...
...
modules/gui/qt4/main_interface.cpp
View file @
ba42d61b
...
...
@@ -60,6 +60,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
ui
.
volLowLabel
->
setPixmap
(
QPixmap
(
":/pixmaps/volume-low.png"
)
);
ui
.
volHighLabel
->
setPixmap
(
QPixmap
(
":/pixmaps/volume-high.png"
)
);
ui
.
volumeSlider
->
setMaximum
(
100
);
ui
.
playlistButton
->
setIcon
(
QIcon
(
":/pixmaps/volume-low.png"
)
);
VolumeClickHandler
*
h
=
new
VolumeClickHandler
(
this
);
ui
.
volLowLabel
->
installEventFilter
(
h
);
...
...
@@ -76,7 +78,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
// if( config_GetInt( p_intf, "embedded" ) )
{
videoWidget
=
new
VideoWidget
(
p_intf
);
videoWidget
=
new
VideoWidget
(
p_intf
,
config_GetInt
(
p_intf
,
"qt-always-video"
)
?
true
:
false
);
if
(
config_GetInt
(
p_intf
,
"qt-always-video"
)
)
{
QSettings
settings
(
"VideoLAN"
,
"VLC"
);
...
...
@@ -92,12 +94,15 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
readSettings
(
"MainWindow"
);
addSize
=
QSize
(
ui
.
vboxLayout
->
margin
()
*
2
,
PREF_H
);
if
(
config_GetInt
(
p_intf
,
"qt-always-video"
)
)
mainSize
=
videoSize
+
addSize
;
else
mainSize
=
QSize
(
PREF_W
,
PREF_H
);
// if( config_GetInt( p_intf, "qt-always-video" ) )
mainSize
.
setWidth
(
videoSize
.
width
()
+
addSize
.
width
()
);
mainSize
.
setHeight
(
videoSize
.
height
()
+
addSize
.
height
()
);
// else
// mainSize = QSize( PREF_W, PREF_H );
fprintf
(
stderr
,
"Resulting size %ix%i"
,
mainSize
.
width
(),
mainSize
.
height
()
);
resize
(
mainSize
);
mainSize
=
size
();
fprintf
(
stderr
,
"After size %ix%i"
,
mainSize
.
width
(),
mainSize
.
height
()
);
setMinimumSize
(
PREF_W
,
addSize
.
height
()
);
...
...
modules/gui/qt4/ui/main_interface.ui
View file @
ba42d61b
...
...
@@ -219,7 +219,7 @@
<item>
<widget class="QPushButton" name="playlistButton" >
<property name="text" >
<string>
_("Playlist")
</string>
<string>
</string>
</property>
</widget>
</item>
...
...
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