Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
ff7fe04f
Commit
ff7fe04f
authored
Jan 13, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the video widget rendering
parent
432af59c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
style.qss
resources/style.qss
+0
-2
UBMediaWidget.cpp
src/customWidgets/UBMediaWidget.cpp
+7
-6
UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp
+2
-2
No files found.
resources/style.qss
View file @
ff7fe04f
...
@@ -18,8 +18,6 @@ QWidget#UBMediaVideoContainer
...
@@ -18,8 +18,6 @@ QWidget#UBMediaVideoContainer
background: #000000;
background: #000000;
border-radius: 10px;
border-radius: 10px;
border: 2px solid #999999;
border: 2px solid #999999;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
}
QWidget#UBTeacherBarPreviewWidget
QWidget#UBTeacherBarPreviewWidget
...
...
src/customWidgets/UBMediaWidget.cpp
View file @
ff7fe04f
...
@@ -35,6 +35,7 @@ UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name)
...
@@ -35,6 +35,7 @@ UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name)
mSeekerLayout
.
addWidget
(
mpPlayStopButton
,
0
);
mSeekerLayout
.
addWidget
(
mpPlayStopButton
,
0
);
mSeekerLayout
.
addWidget
(
mpPauseButton
,
0
);
mSeekerLayout
.
addWidget
(
mpPauseButton
,
0
);
mSeekerLayout
.
addWidget
(
mpSlider
,
1
);
mSeekerLayout
.
addWidget
(
mpSlider
,
1
);
mSeekerLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
);
connect
(
mpPlayStopButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onPlayStopClicked
()));
connect
(
mpPlayStopButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onPlayStopClicked
()));
connect
(
mpPauseButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onPauseClicked
()));
connect
(
mpPauseButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onPauseClicked
()));
...
@@ -74,9 +75,9 @@ void UBMediaWidget::createMediaPlayer()
...
@@ -74,9 +75,9 @@ void UBMediaWidget::createMediaPlayer()
{
{
if
(
eMediaType_Video
==
mType
){
if
(
eMediaType_Video
==
mType
){
mpVideoWidget
=
new
Phonon
::
VideoWidget
(
this
);
mpVideoWidget
=
new
Phonon
::
VideoWidget
(
this
);
mpVideoWidget
->
setStyleSheet
(
QString
(
"margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;"
));
mpVideoContainer
=
new
QWidget
(
this
);
mpVideoContainer
=
new
QWidget
(
this
);
mpVideoContainer
->
setObjectName
(
"UBMediaVideoContainer"
);
mpVideoContainer
->
setObjectName
(
"UBMediaVideoContainer"
);
mVideoLayout
.
setContentsMargins
(
10
,
10
,
25
,
10
);
mpVideoContainer
->
setLayout
(
&
mVideoLayout
);
mpVideoContainer
->
setLayout
(
&
mVideoLayout
);
mVideoLayout
.
addWidget
(
mpVideoWidget
,
1
);
mVideoLayout
.
addWidget
(
mpVideoWidget
,
1
);
Phonon
::
createPath
(
mpMediaObject
,
mpVideoWidget
);
Phonon
::
createPath
(
mpMediaObject
,
mpVideoWidget
);
...
@@ -93,13 +94,13 @@ void UBMediaWidget::createMediaPlayer()
...
@@ -93,13 +94,13 @@ void UBMediaWidget::createMediaPlayer()
void
UBMediaWidget
::
adaptSizeToVideo
()
void
UBMediaWidget
::
adaptSizeToVideo
()
{
{
if
(
NULL
!=
mpVideo
Widget
){
if
(
NULL
!=
mpVideo
Container
){
int
origW
=
mpVideo
Widget
->
width
();
int
origW
=
mpVideo
Container
->
width
();
int
origH
=
mpVideo
Widget
->
height
();
int
origH
=
mpVideo
Container
->
height
();
int
newW
=
width
();
int
newW
=
width
();
float
scaleFactor
=
(
float
)
origW
/
(
float
)
newW
;
float
scaleFactor
=
(
float
)
origW
/
(
float
)
newW
;
int
newH
=
origH
/
scaleFactor
;
int
newH
=
origH
/
scaleFactor
;
resize
(
width
()
,
height
()
+
newH
);
resize
(
newW
,
height
()
+
newH
);
}
}
}
}
...
@@ -185,7 +186,7 @@ UBMediaButton::UBMediaButton(QWidget *parent, const char *name):QLabel(parent)
...
@@ -185,7 +186,7 @@ UBMediaButton::UBMediaButton(QWidget *parent, const char *name):QLabel(parent)
{
{
setObjectName
(
name
);
setObjectName
(
name
);
resize
(
UBMEDIABUTTON_SIZE
,
UBMEDIABUTTON_SIZE
);
resize
(
UBMEDIABUTTON_SIZE
,
UBMEDIABUTTON_SIZE
);
setStyleSheet
(
QString
(
"padding:0px 0px 0px 0px;"
));
setStyleSheet
(
QString
(
"padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
"
));
}
}
UBMediaButton
::~
UBMediaButton
()
UBMediaButton
::~
UBMediaButton
()
...
...
src/gui/UBTeacherBarWidget.cpp
View file @
ff7fe04f
...
@@ -1235,8 +1235,8 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url)
...
@@ -1235,8 +1235,8 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url)
pW
=
label
;
pW
=
label
;
}
}
else
if
(
mimeType
.
contains
(
"video"
)
||
mimeType
.
contains
(
"audio"
)){
else
if
(
mimeType
.
contains
(
"video"
)
||
mimeType
.
contains
(
"audio"
)){
UBMediaPlayer
*
mediaPlayer
=
new
UBMediaPlayer
();
//
UBMediaPlayer* mediaPlayer = new UBMediaPlayer();
//
UBMediaWidget* mediaPlayer = new UBMediaWidget(mimeType.contains("audio")?eMediaType_Audio:eMediaType_Video);
UBMediaWidget
*
mediaPlayer
=
new
UBMediaWidget
(
mimeType
.
contains
(
"audio"
)
?
eMediaType_Audio
:
eMediaType_Video
);
mediaPlayer
->
setFile
(
url
);
mediaPlayer
->
setFile
(
url
);
pW
=
mediaPlayer
;
pW
=
mediaPlayer
;
}
}
...
...
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