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
2b2d0b8c
Commit
2b2d0b8c
authored
May 03, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the screenshot on media pause isn't more necessary
parent
5aa50c52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
43 deletions
+15
-43
UBMediaWidget.cpp
src/customWidgets/UBMediaWidget.cpp
+15
-39
UBMediaWidget.h
src/customWidgets/UBMediaWidget.h
+0
-4
No files found.
src/customWidgets/UBMediaWidget.cpp
View file @
2b2d0b8c
...
...
@@ -37,7 +37,6 @@ UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name)
,
mpMediaContainer
(
NULL
)
,
mMediaLayout
(
NULL
)
,
mpCover
(
NULL
)
,
mpSnapshotVideoWidget
(
NULL
)
{
SET_STYLE_SHEET
();
...
...
@@ -73,15 +72,13 @@ UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name)
UBMediaWidget
::~
UBMediaWidget
()
{
unsetActionsParent
();
DELETEPTR
(
mpMediaObject
);
DELETEPTR
(
mpSlider
);
DELETEPTR
(
mpPauseButton
);
DELETEPTR
(
mpPlayStopButton
);
DELETEPTR
(
mpAudioOutput
);
DELETEPTR
(
mpVideoWidget
);
DELETEPTR
(
mpMediaObject
);
DELETEPTR
(
mpCover
);
DELETEPTR
(
mpSnapshotVideoWidget
);
DELETEPTR
(
mpVideoStackedWidget
);
DELETEPTR
(
mpMediaContainer
);
DELETEPTR
(
mpSeekerLayout
);
DELETEPTR
(
mpLayout
);
...
...
@@ -116,13 +113,9 @@ eMediaType UBMediaWidget::mediaType()
void
UBMediaWidget
::
showEvent
(
QShowEvent
*
event
)
{
if
(
!
mpVideoWidget
){
mpSnapshotVideoWidget
=
new
QLabel
(
this
);
mpVideoWidget
=
new
Phonon
::
VideoWidget
(
this
);
mpVideoStackedWidget
=
new
QStackedWidget
(
this
);
mpVideoStackedWidget
->
addWidget
(
mpVideoWidget
);
mpVideoStackedWidget
->
addWidget
(
mpSnapshotVideoWidget
);
mMediaLayout
->
addStretch
(
1
);
mMediaLayout
->
addWidget
(
mpVideo
StackedWidget
,
0
);
mMediaLayout
->
addWidget
(
mpVideo
Widget
);
mMediaLayout
->
addStretch
(
1
);
Phonon
::
createPath
(
mpMediaObject
,
mpVideoWidget
);
adaptSizeToVideo
();
...
...
@@ -152,13 +145,9 @@ void UBMediaWidget::createMediaPlayer()
if
(
eMediaType_Video
==
mType
){
mMediaLayout
->
setContentsMargins
(
10
,
10
,
10
,
10
);
if
(
isVisible
()){
mpSnapshotVideoWidget
=
new
QLabel
(
this
);
mpVideoWidget
=
new
Phonon
::
VideoWidget
(
this
);
mpVideoStackedWidget
=
new
QStackedWidget
(
this
);
mpVideoStackedWidget
->
addWidget
(
mpVideoWidget
);
mpVideoStackedWidget
->
addWidget
(
mpSnapshotVideoWidget
);
mMediaLayout
->
addStretch
(
1
);
mMediaLayout
->
addWidget
(
mpVideo
StackedWidget
,
0
);
mMediaLayout
->
addWidget
(
mpVideo
Widget
);
mMediaLayout
->
addStretch
(
1
);
Phonon
::
createPath
(
mpMediaObject
,
mpVideoWidget
);
adaptSizeToVideo
();
...
...
@@ -197,20 +186,6 @@ void UBMediaWidget::adaptSizeToVideo()
}
}
void
UBMediaWidget
::
updateView
(
Phonon
::
State
nextState
)
{
if
(
isVisible
()
&&
eMediaType_Video
==
mType
){
if
(
nextState
!=
Phonon
::
PlayingState
){
const
QPixmap
&
snapshot
=
QPixmap
::
grabWindow
(
mpVideoWidget
->
winId
());
mpSnapshotVideoWidget
->
setPixmap
(
snapshot
);
mpVideoStackedWidget
->
setCurrentWidget
(
mpSnapshotVideoWidget
);
}
else
mpVideoStackedWidget
->
setCurrentWidget
(
mpVideoWidget
);
}
}
/**
* \brief Handle the media state change notification
* @param newState as the new state
...
...
@@ -239,9 +214,10 @@ void UBMediaWidget::onStateChanged(Phonon::State newState, Phonon::State oldStat
mpPauseButton
->
setEnabled
(
false
);
mpSlider
->
setValue
(
0
);
}
if
(
mType
==
eMediaType_Video
)
updateView
(
newState
);
}
// if(mType == eMediaType_Video)
// updateView(newState);
}
/**
...
...
@@ -281,16 +257,16 @@ void UBMediaWidget::onSliderChanged(int value)
void
UBMediaWidget
::
onPlayStopClicked
()
{
switch
(
mpMediaObject
->
state
()){
case
Phonon
:
:
PlayingState
:
mpMediaObject
->
stop
();
break
;
case
Phonon
:
:
PlayingState
:
mpMediaObject
->
stop
();
break
;
case
Phonon
:
:
StoppedState
:
case
Phonon
:
:
PausedState
:
mpMediaObject
->
play
();
break
;
default
:
break
;
case
Phonon
:
:
StoppedState
:
case
Phonon
:
:
PausedState
:
mpMediaObject
->
play
();
break
;
default
:
break
;
}
}
...
...
src/customWidgets/UBMediaWidget.h
View file @
2b2d0b8c
...
...
@@ -91,7 +91,6 @@ private slots:
private
:
void
createMediaPlayer
();
void
adaptSizeToVideo
();
void
updateView
(
Phonon
::
State
nextState
);
/** The current media type */
eMediaType
mType
;
...
...
@@ -125,9 +124,6 @@ private:
QLabel
*
mpCover
;
/** The media url */
QString
mUrl
;
QStackedWidget
*
mpVideoStackedWidget
;
QLabel
*
mpSnapshotVideoWidget
;
};
#endif // UBMEDIAWIDGET_H
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