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
dad66868
Commit
dad66868
authored
Mar 12, 2013
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unsed code
parent
b3c94fd3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
66 deletions
+11
-66
UBGraphicsAudioItem.h
src/domain/UBGraphicsAudioItem.h
+0
-22
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+4
-30
UBGraphicsMediaItem.h
src/domain/UBGraphicsMediaItem.h
+0
-1
UBGraphicsMediaItemDelegate.cpp
src/domain/UBGraphicsMediaItemDelegate.cpp
+7
-13
No files found.
src/domain/UBGraphicsAudioItem.h
deleted
100644 → 0
View file @
b3c94fd3
/*
* Copyright (C) 2012 Webdoc SA
*
* This file is part of Open-Sankoré.
*
* Open-Sankoré is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library).
*
* Open-Sankoré is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
*/
src/domain/UBGraphicsMediaItem.cpp
View file @
dad66868
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
UBAudioPresentationWidget
::
UBAudioPresentationWidget
(
QWidget
*
parent
)
UBAudioPresentationWidget
::
UBAudioPresentationWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
:
QWidget
(
parent
)
,
mBorderSize
(
10
)
,
mBorderSize
(
10
)
,
mTitleSize
(
10
)
{
{
}
}
...
@@ -44,7 +43,7 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event)
...
@@ -44,7 +43,7 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event)
{
{
QPainter
painter
(
this
);
QPainter
painter
(
this
);
painter
.
fillRect
(
rect
(),
QBrush
(
Qt
::
white
));
painter
.
fillRect
(
rect
(),
QBrush
(
Qt
::
white
));
QPen
borderPen
;
QPen
borderPen
;
borderPen
.
setWidth
(
2
);
borderPen
.
setWidth
(
2
);
borderPen
.
setColor
(
QColor
(
Qt
::
black
));
borderPen
.
setColor
(
QColor
(
Qt
::
black
));
...
@@ -52,16 +51,6 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event)
...
@@ -52,16 +51,6 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event)
painter
.
setPen
(
borderPen
);
painter
.
setPen
(
borderPen
);
painter
.
drawRect
(
0
,
0
,
width
(),
height
());
painter
.
drawRect
(
0
,
0
,
width
(),
height
());
if
(
QString
()
!=
mTitle
)
{
painter
.
setPen
(
QPen
(
Qt
::
black
));
QRect
titleRect
=
rect
();
titleRect
.
setX
(
mBorderSize
);
titleRect
.
setY
(
2
);
titleRect
.
setHeight
(
15
);
painter
.
drawText
(
titleRect
,
mTitle
);
}
QWidget
::
paintEvent
(
event
);
QWidget
::
paintEvent
(
event
);
}
}
...
@@ -112,9 +101,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
...
@@ -112,9 +101,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
int
borderSize
=
0
;
int
borderSize
=
0
;
UBAudioPresentationWidget
*
pAudioWidget
=
dynamic_cast
<
UBAudioPresentationWidget
*>
(
mAudioWidget
);
UBAudioPresentationWidget
*
pAudioWidget
=
dynamic_cast
<
UBAudioPresentationWidget
*>
(
mAudioWidget
);
if
(
pAudioWidget
)
if
(
pAudioWidget
)
{
borderSize
=
pAudioWidget
->
borderSize
();
borderSize
=
pAudioWidget
->
borderSize
();
}
mAudioWidget
->
resize
(
320
,
26
+
2
*
borderSize
);
//3*border size with enabled title
mAudioWidget
->
resize
(
320
,
26
+
2
*
borderSize
);
//3*border size with enabled title
mAudioWidget
->
setMinimumSize
(
150
,
26
+
borderSize
);
mAudioWidget
->
setMinimumSize
(
150
,
26
+
borderSize
);
...
@@ -166,26 +153,19 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
...
@@ -166,26 +153,19 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
||
(
change
==
QGraphicsItem
::
ItemVisibleChange
))
||
(
change
==
QGraphicsItem
::
ItemVisibleChange
))
{
{
if
(
mMediaObject
&&
(
!
isEnabled
()
||
!
isVisible
()
||
!
scene
()))
if
(
mMediaObject
&&
(
!
isEnabled
()
||
!
isVisible
()
||
!
scene
()))
{
mMediaObject
->
pause
();
mMediaObject
->
pause
();
}
}
}
else
if
(
change
==
QGraphicsItem
::
ItemSceneHasChanged
)
else
if
(
change
==
QGraphicsItem
::
ItemSceneHasChanged
)
{
{
if
(
!
scene
())
if
(
!
scene
())
{
mMediaObject
->
stop
();
mMediaObject
->
stop
();
}
else
{
else
{
QString
absoluteMediaFilename
;
QString
absoluteMediaFilename
;
if
(
mMediaFileUrl
.
toLocalFile
().
startsWith
(
"audios/"
)
||
mMediaFileUrl
.
toLocalFile
().
startsWith
(
"videos/"
))
{
if
(
mMediaFileUrl
.
toLocalFile
().
startsWith
(
"audios/"
)
||
mMediaFileUrl
.
toLocalFile
().
startsWith
(
"videos/"
))
absoluteMediaFilename
=
scene
()
->
document
()
->
persistencePath
()
+
"/"
+
mMediaFileUrl
.
toLocalFile
();
absoluteMediaFilename
=
scene
()
->
document
()
->
persistencePath
()
+
"/"
+
mMediaFileUrl
.
toLocalFile
();
}
else
else
{
absoluteMediaFilename
=
mMediaFileUrl
.
toLocalFile
();
absoluteMediaFilename
=
mMediaFileUrl
.
toLocalFile
();
}
if
(
absoluteMediaFilename
.
length
()
>
0
)
if
(
absoluteMediaFilename
.
length
()
>
0
)
mMediaObject
->
setCurrentSource
(
Phonon
::
MediaSource
(
absoluteMediaFilename
));
mMediaObject
->
setCurrentSource
(
Phonon
::
MediaSource
(
absoluteMediaFilename
));
...
@@ -199,12 +179,6 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
...
@@ -199,12 +179,6 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
void
UBGraphicsMediaItem
::
setSourceUrl
(
const
QUrl
&
pSourceUrl
)
void
UBGraphicsMediaItem
::
setSourceUrl
(
const
QUrl
&
pSourceUrl
)
{
{
UBAudioPresentationWidget
*
pAudioWidget
=
dynamic_cast
<
UBAudioPresentationWidget
*>
(
mAudioWidget
);
if
(
pAudioWidget
)
{
pAudioWidget
->
setTitle
(
UBFileSystemUtils
::
lastPathComponent
(
pSourceUrl
.
toString
()));
}
UBItem
::
setSourceUrl
(
pSourceUrl
);
UBItem
::
setSourceUrl
(
pSourceUrl
);
}
}
...
...
src/domain/UBGraphicsMediaItem.h
View file @
dad66868
...
@@ -45,7 +45,6 @@ private:
...
@@ -45,7 +45,6 @@ private:
virtual
void
paintEvent
(
QPaintEvent
*
event
);
virtual
void
paintEvent
(
QPaintEvent
*
event
);
int
mBorderSize
;
int
mBorderSize
;
int
mTitleSize
;
QString
mTitle
;
QString
mTitle
;
};
};
...
...
src/domain/UBGraphicsMediaItemDelegate.cpp
View file @
dad66868
...
@@ -60,10 +60,9 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
...
@@ -60,10 +60,9 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
connect
(
mToolBarShowTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
hideToolBar
()));
connect
(
mToolBarShowTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
hideToolBar
()));
mToolBarShowTimer
->
setInterval
(
m_iToolBarShowingInterval
);
mToolBarShowTimer
->
setInterval
(
m_iToolBarShowingInterval
);
}
}
if
(
delegated
()
->
isMuted
())
if
(
delegated
()
->
isMuted
())
{
delegated
()
->
setMute
(
true
);
delegated
()
->
setMute
(
true
);
}
//Wrapper function. Use it to set correct data() to QGraphicsItem as well
//Wrapper function. Use it to set correct data() to QGraphicsItem as well
setFlippable
(
false
);
setFlippable
(
false
);
...
@@ -97,13 +96,13 @@ void UBGraphicsMediaItemDelegate::buildButtons()
...
@@ -97,13 +96,13 @@ void UBGraphicsMediaItemDelegate::buildButtons()
mMediaControl
=
new
DelegateMediaControl
(
delegated
(),
mToolBarItem
);
mMediaControl
=
new
DelegateMediaControl
(
delegated
(),
mToolBarItem
);
mMediaControl
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
mMediaControl
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
UBGraphicsItem
::
assignZValue
(
mMediaControl
,
delegated
()
->
zValue
());
UBGraphicsItem
::
assignZValue
(
mMediaControl
,
delegated
()
->
zValue
());
if
(
delegated
()
->
isMuted
())
if
(
delegated
()
->
isMuted
())
mMuteButton
=
new
DelegateButton
(
":/images/soundOff.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
mMuteButton
=
new
DelegateButton
(
":/images/soundOff.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
else
else
mMuteButton
=
new
DelegateButton
(
":/images/soundOn.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
mMuteButton
=
new
DelegateButton
(
":/images/soundOn.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
connect
(
mMuteButton
,
SIGNAL
(
clicked
(
bool
)),
delegated
(),
SLOT
(
toggleMute
()));
connect
(
mMuteButton
,
SIGNAL
(
clicked
(
bool
)),
delegated
(),
SLOT
(
toggleMute
()));
connect
(
mMuteButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleMute
()));
// for changing button image
connect
(
mMuteButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleMute
()));
// for changing button image
mToolBarButtons
<<
mPlayPauseButton
<<
mStopButton
<<
mMuteButton
;
mToolBarButtons
<<
mPlayPauseButton
<<
mStopButton
<<
mMuteButton
;
...
@@ -145,7 +144,7 @@ void UBGraphicsMediaItemDelegate::positionHandles()
...
@@ -145,7 +144,7 @@ void UBGraphicsMediaItemDelegate::positionHandles()
{
{
QRectF
toolBarRect
=
mToolBarItem
->
rect
();
QRectF
toolBarRect
=
mToolBarItem
->
rect
();
if
(
mediaItem
->
getMediaType
()
==
UBGraphicsMediaItem
::
mediaType_Video
)
if
(
mediaItem
->
getMediaType
()
==
UBGraphicsMediaItem
::
mediaType_Video
)
{
{
mToolBarItem
->
setPos
(
0
,
delegated
()
->
boundingRect
().
height
()
-
mToolBarItem
->
rect
().
height
());
mToolBarItem
->
setPos
(
0
,
delegated
()
->
boundingRect
().
height
()
-
mToolBarItem
->
rect
().
height
());
toolBarRect
.
setWidth
(
delegated
()
->
boundingRect
().
width
());
toolBarRect
.
setWidth
(
delegated
()
->
boundingRect
().
width
());
...
@@ -186,15 +185,10 @@ void UBGraphicsMediaItemDelegate::positionHandles()
...
@@ -186,15 +185,10 @@ void UBGraphicsMediaItemDelegate::positionHandles()
mMediaControl
->
setRect
(
mediaItemRect
);
mMediaControl
->
setRect
(
mediaItemRect
);
mToolBarItem
->
positionHandles
();
mToolBarItem
->
positionHandles
();
mMediaControl
->
positionHandles
();
mMediaControl
->
positionHandles
();
if
(
mediaItem
)
if
(
mediaItem
&&
mediaItem
->
getMediaType
()
==
UBGraphicsMediaItem
::
mediaType_Audio
)
{
mToolBarItem
->
show
();
if
(
mediaItem
->
getMediaType
()
==
UBGraphicsMediaItem
::
mediaType_Audio
)
{
mToolBarItem
->
show
();
}
}
}
}
void
UBGraphicsMediaItemDelegate
::
remove
(
bool
canUndo
)
void
UBGraphicsMediaItemDelegate
::
remove
(
bool
canUndo
)
...
...
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