Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
4e7a52a9
Commit
4e7a52a9
authored
Feb 19, 2010
by
Hugo Beauzee-Luyssen
Browse files
applying HACKING on Media.{h,cpp}
parent
331a9524
Changes
20
Hide whitespace changes
Inline
Side-by-side
src/Gui/ClipProperty.cpp
View file @
4e7a52a9
...
...
@@ -42,20 +42,20 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
//Duration
ui
->
durationValueLabel
->
setText
(
duration
.
toString
(
"hh:mm:ss"
)
);
//Filename || title
ui
->
nameValueLabel
->
setText
(
m_clip
->
getParent
()
->
getF
ileInfo
()
->
fileName
()
);
setWindowTitle
(
m_clip
->
getParent
()
->
getF
ileInfo
()
->
fileName
()
+
" "
+
tr
(
"properties"
)
);
ui
->
nameValueLabel
->
setText
(
m_clip
->
getParent
()
->
f
ileInfo
()
->
fileName
()
);
setWindowTitle
(
m_clip
->
getParent
()
->
f
ileInfo
()
->
fileName
()
+
" "
+
tr
(
"properties"
)
);
//Resolution
ui
->
resolutionValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
getW
idth
()
)
+
" x "
+
QString
::
number
(
m_clip
->
getParent
()
->
getH
eight
()
)
);
ui
->
resolutionValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
w
idth
()
)
+
" x "
+
QString
::
number
(
m_clip
->
getParent
()
->
h
eight
()
)
);
//FPS
ui
->
fpsValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
getF
ps
()
)
);
ui
->
fpsValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
f
ps
()
)
);
//Snapshot
ui
->
snapshotLabel
->
setPixmap
(
m_clip
->
getParent
()
->
getS
napshot
().
scaled
(
128
,
128
,
Qt
::
KeepAspectRatio
)
);
ui
->
snapshotLabel
->
setPixmap
(
m_clip
->
getParent
()
->
s
napshot
().
scaled
(
128
,
128
,
Qt
::
KeepAspectRatio
)
);
//nb tracks :
ui
->
nbVideoTracksValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
getN
bVideoTracks
()
)
);
QString
::
number
(
m_clip
->
getParent
()
->
n
bVideoTracks
()
)
);
ui
->
nbAudioTracksValueLabel
->
setText
(
QString
::
number
(
m_clip
->
getParent
()
->
getN
bAudioTracks
()
)
);
QString
::
number
(
m_clip
->
getParent
()
->
n
bAudioTracks
()
)
);
//Metatags
const
QPushButton
*
button
=
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
Apply
);
Q_ASSERT
(
button
!=
NULL
);
...
...
src/Gui/TagWidget.cpp
View file @
4e7a52a9
...
...
@@ -73,7 +73,7 @@ void TagWidget::mediaSelected( Media* media )
for
(
int
i
=
0
;
i
<
m_buttonList
.
count
();
i
++
)
{
static_cast
<
QPushButton
*>
(
m_buttonList
[
i
])
->
setEnabled
(
true
);
if
(
m_currentMedia
->
getM
etaTags
().
contains
(
static_cast
<
QPushButton
*>
(
m_buttonList
[
i
])
->
text
()
)
)
if
(
m_currentMedia
->
m
etaTags
().
contains
(
static_cast
<
QPushButton
*>
(
m_buttonList
[
i
])
->
text
()
)
)
static_cast
<
QPushButton
*>
(
m_buttonList
[
i
])
->
setChecked
(
true
);
else
static_cast
<
QPushButton
*>
(
m_buttonList
[
i
])
->
setChecked
(
false
);
...
...
@@ -93,7 +93,7 @@ void TagWidget:: buttonTagClicked()
{
if
(
m_currentMedia
!=
NULL
)
{
QStringList
tagList
=
m_currentMedia
->
getM
etaTags
();
QStringList
tagList
=
m_currentMedia
->
m
etaTags
();
for
(
int
i
=
0
;
i
<
m_buttonList
.
count
();
i
++
)
{
QPushButton
*
button
=
static_cast
<
QPushButton
*>
(
m_buttonList
[
i
]);
...
...
@@ -112,11 +112,11 @@ void TagWidget::setTagTextEdit()
QString
tags
;
if
(
m_currentMedia
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
m_currentMedia
->
getM
etaTags
().
count
();
i
++
)
for
(
int
i
=
0
;
i
<
m_currentMedia
->
m
etaTags
().
count
();
i
++
)
if
(
i
==
0
)
tags
+=
m_currentMedia
->
getM
etaTags
()[
i
];
tags
+=
m_currentMedia
->
m
etaTags
()[
i
];
else
tags
+=
","
+
m_currentMedia
->
getM
etaTags
()[
i
];
tags
+=
","
+
m_currentMedia
->
m
etaTags
()[
i
];
m_ui
->
TagTextEdit
->
setText
(
tags
);
setButtonList
(
m_defaultTagList
);
}
...
...
src/Gui/import/ImportController.cpp
View file @
4e7a52a9
...
...
@@ -175,13 +175,13 @@ ImportController::clipSelection( const QUuid& uuid )
void
ImportController
::
updateMediaRequested
(
Media
*
media
)
{
if
(
m_temporaryMedias
.
contains
(
media
->
getU
uid
()
)
==
false
)
if
(
m_temporaryMedias
.
contains
(
media
->
u
uid
()
)
==
false
)
return
;
ImportMediaCellView
*
cell
=
m_mediaListController
->
cell
(
media
->
getU
uid
()
);
ImportMediaCellView
*
cell
=
m_mediaListController
->
cell
(
media
->
u
uid
()
);
if
(
cell
==
NULL
)
return
;
cell
->
setThumbnail
(
media
->
getS
napshot
()
);
cell
->
setLength
(
media
->
getL
engthMS
()
);
cell
->
setThumbnail
(
media
->
s
napshot
()
);
cell
->
setLength
(
media
->
l
engthMS
()
);
}
void
...
...
@@ -191,17 +191,17 @@ ImportController::setUIMetaData( Media* media )
{
//Duration
QTime
duration
;
duration
=
duration
.
addMSecs
(
media
->
getL
engthMS
()
);
duration
=
duration
.
addMSecs
(
media
->
l
engthMS
()
);
m_ui
->
durationValueLabel
->
setText
(
duration
.
toString
(
"hh:mm:ss"
)
);
//Filename || title
m_ui
->
nameValueLabel
->
setText
(
media
->
getF
ileInfo
()
->
fileName
()
);
m_ui
->
nameValueLabel
->
setText
(
media
->
f
ileInfo
()
->
fileName
()
);
m_ui
->
nameValueLabel
->
setWordWrap
(
true
);
setWindowTitle
(
media
->
getF
ileInfo
()
->
fileName
()
+
" "
+
tr
(
"properties"
)
);
setWindowTitle
(
media
->
f
ileInfo
()
->
fileName
()
+
" "
+
tr
(
"properties"
)
);
//Resolution
m_ui
->
resolutionValueLabel
->
setText
(
QString
::
number
(
media
->
getW
idth
()
)
+
" x "
+
QString
::
number
(
media
->
getH
eight
()
)
);
m_ui
->
resolutionValueLabel
->
setText
(
QString
::
number
(
media
->
w
idth
()
)
+
" x "
+
QString
::
number
(
media
->
h
eight
()
)
);
//FPS
m_ui
->
fpsValueLabel
->
setText
(
QString
::
number
(
media
->
getF
ps
()
)
);
m_ui
->
fpsValueLabel
->
setText
(
QString
::
number
(
media
->
f
ps
()
)
);
}
else
{
...
...
@@ -219,13 +219,13 @@ ImportController::setUIMetaData( Clip* clip )
qint64
length
=
clip
->
getLengthSecond
();
time
=
time
.
addSecs
(
length
);
m_ui
->
durationValueLabel
->
setText
(
time
.
toString
(
"hh:mm:ss"
)
);
m_ui
->
nameValueLabel
->
setText
(
clip
->
getParent
()
->
getF
ileInfo
()
->
fileName
()
);
m_ui
->
nameValueLabel
->
setText
(
clip
->
getParent
()
->
f
ileInfo
()
->
fileName
()
);
m_ui
->
nameValueLabel
->
setWordWrap
(
true
);
setWindowTitle
(
clip
->
getParent
()
->
getF
ileInfo
()
->
fileName
()
+
" "
+
setWindowTitle
(
clip
->
getParent
()
->
f
ileInfo
()
->
fileName
()
+
" "
+
tr
(
"properties"
)
);
m_ui
->
resolutionValueLabel
->
setText
(
QString
::
number
(
clip
->
getParent
()
->
getW
idth
()
)
+
" x "
+
QString
::
number
(
clip
->
getParent
()
->
getH
eight
()
)
);
m_ui
->
fpsValueLabel
->
setText
(
QString
::
number
(
clip
->
getParent
()
->
getF
ps
()
)
);
m_ui
->
resolutionValueLabel
->
setText
(
QString
::
number
(
clip
->
getParent
()
->
w
idth
()
)
+
" x "
+
QString
::
number
(
clip
->
getParent
()
->
h
eight
()
)
);
m_ui
->
fpsValueLabel
->
setText
(
QString
::
number
(
clip
->
getParent
()
->
f
ps
()
)
);
}
void
...
...
@@ -234,7 +234,7 @@ ImportController::importMedia( const QString &filePath )
++
m_nbMediaToLoad
;
m_ui
->
progressBar
->
setMaximum
(
m_nbMediaToLoad
);
foreach
(
Media
*
media
,
m_temporaryMedias
.
values
()
)
if
(
media
->
getF
ileInfo
()
->
filePath
()
==
filePath
)
if
(
media
->
f
ileInfo
()
->
filePath
()
==
filePath
)
return
;
if
(
Library
::
getInstance
()
->
mediaAlreadyLoaded
(
filePath
)
==
true
)
return
;
...
...
@@ -246,7 +246,7 @@ ImportController::importMedia( const QString &filePath )
this
,
SLOT
(
updateMediaRequested
(
Media
*
)
)
);
connect
(
media
,
SIGNAL
(
snapshotComputed
(
Media
*
)
),
this
,
SLOT
(
mediaLoaded
()
)
);
m_temporaryMedias
[
media
->
getU
uid
()]
=
media
;
m_temporaryMedias
[
media
->
u
uid
()]
=
media
;
MetaDataManager
::
getInstance
()
->
computeMediaMetadata
(
media
);
m_mediaListController
->
addMedia
(
media
);
}
...
...
@@ -454,11 +454,11 @@ void
ImportController
::
failedToLoad
(
Media
*
media
)
{
m_ui
->
errorLabel
->
setText
(
tr
(
"Failed to load %1"
).
arg
(
media
->
getF
ileInfo
()
->
fileName
()
)
);
media
->
f
ileInfo
()
->
fileName
()
)
);
m_ui
->
errorLabelImg
->
show
();
m_ui
->
errorLabel
->
show
();
QTimer
::
singleShot
(
3000
,
this
,
SLOT
(
hideErrors
()
)
);
mediaDeletion
(
media
->
getU
uid
()
);
mediaDeletion
(
media
->
u
uid
()
);
}
void
...
...
src/Gui/import/ImportMediaListController.cpp
View file @
4e7a52a9
...
...
@@ -39,7 +39,7 @@ ImportMediaListController::~ImportMediaListController()
void
ImportMediaListController
::
addMedia
(
Media
*
media
)
{
ImportMediaCellView
*
cell
=
new
ImportMediaCellView
(
media
->
getU
uid
()
);
ImportMediaCellView
*
cell
=
new
ImportMediaCellView
(
media
->
u
uid
()
);
connect
(
cell
,
SIGNAL
(
cellSelected
(
const
QUuid
&
)
),
this
,
SIGNAL
(
mediaSelected
(
const
QUuid
&
)
)
);
connect
(
cell
,
SIGNAL
(
cellDeleted
(
const
QUuid
&
)
),
...
...
@@ -47,11 +47,11 @@ ImportMediaListController::addMedia( Media* media )
connect
(
cell
,
SIGNAL
(
arrowClicked
(
const
QUuid
&
)
),
this
,
SIGNAL
(
showClipListAsked
(
const
QUuid
&
)
)
);
cell
->
setTitle
(
media
->
getF
ileName
()
);
cell
->
setThumbnail
(
media
->
getS
napshot
()
);
cell
->
setTitle
(
media
->
f
ileName
()
);
cell
->
setThumbnail
(
media
->
s
napshot
()
);
addCell
(
cell
);
m_mediaCellList
->
insert
(
media
->
getU
uid
(),
cell
);
m_mediaCellList
->
insert
(
media
->
u
uid
(),
cell
);
if
(
media
->
baseClip
()
==
NULL
)
connect
(
media
,
SIGNAL
(
metaDataComputed
(
Media
*
)
),
cell
,
SLOT
(
enableCell
()
)
);
}
...
...
@@ -59,7 +59,7 @@ ImportMediaListController::addMedia( Media* media )
void
ImportMediaListController
::
metaDataComputed
(
Media
*
media
)
{
m_mediaCellList
->
value
(
media
->
getU
uid
()
)
->
setThumbnail
(
media
->
getS
napshot
()
);
m_mediaCellList
->
value
(
media
->
u
uid
()
)
->
setThumbnail
(
media
->
s
napshot
()
);
}
ImportMediaCellView
*
...
...
@@ -98,8 +98,8 @@ ImportMediaListController::addClip( Clip* clip )
size
.
setNum
(
m_mediaCellList
->
size
()
+
1
);
cell
->
setTitle
(
clip
->
getParent
()
->
getF
ileName
()
+
"_"
+
size
);
cell
->
setThumbnail
(
clip
->
getParent
()
->
getS
napshot
()
);
cell
->
setTitle
(
clip
->
getParent
()
->
f
ileName
()
+
"_"
+
size
);
cell
->
setThumbnail
(
clip
->
getParent
()
->
s
napshot
()
);
cell
->
setLength
(
clip
->
getLengthSecond
(),
false
);
cell
->
setEnabled
(
true
);
addCell
(
cell
);
...
...
@@ -147,7 +147,7 @@ ImportMediaListController::clipAdded( Clip* clip )
{
if
(
clip
->
getParent
()
==
0
)
return
;
const
QUuid
&
uuid
=
clip
->
getParent
()
->
getU
uid
();
const
QUuid
&
uuid
=
clip
->
getParent
()
->
u
uid
();
if
(
m_mediaCellList
->
contains
(
uuid
)
)
m_mediaCellList
->
value
(
uuid
)
->
incrementClipCount
();
}
...
...
src/Gui/library/ClipListViewController.cpp
View file @
4e7a52a9
...
...
@@ -66,10 +66,10 @@ void ClipListViewController::addClip( Clip* clip )
connect
(
cell
,
SIGNAL
(
cellSelected
(
QUuid
)
),
this
,
SLOT
(
cellSelection
(
const
QUuid
&
)
)
);
connect
(
cell
,
SIGNAL
(
cellDeleted
(
const
QUuid
&
)
),
this
,
SLOT
(
clipDeletion
(
const
QUuid
&
)
)
);
cell
->
setThumbnail
(
clip
->
getParent
()
->
getS
napshot
()
);
cell
->
setThumbnail
(
clip
->
getParent
()
->
s
napshot
()
);
QString
number
;
number
.
setNum
(
m_cells
.
size
()
+
1
);
cell
->
setTitle
(
clip
->
getParent
()
->
getF
ileName
()
+
number
);
cell
->
setTitle
(
clip
->
getParent
()
->
f
ileName
()
+
number
);
cell
->
setLength
(
clip
->
getLengthSecond
(),
false
);
addCell
(
cell
);
m_cells
.
insert
(
clip
->
getUuid
(),
cell
);
...
...
src/Gui/library/MediaCellView.cpp
View file @
4e7a52a9
...
...
@@ -139,7 +139,8 @@ void MediaCellView::mouseMoveEvent( QMouseEvent* event )
Media
*
parent
=
Library
::
getInstance
()
->
clip
(
m_uuid
)
->
getParent
();
if
(
0
==
parent
)
return
;
drag
->
setPixmap
(
Library
::
getInstance
()
->
clip
(
m_uuid
)
->
getParent
()
->
getSnapshot
().
scaled
(
100
,
100
,
Qt
::
KeepAspectRatio
)
);
drag
->
setPixmap
(
Library
::
getInstance
()
->
clip
(
m_uuid
)
->
getParent
()
->
snapshot
().
scaled
(
100
,
100
,
Qt
::
KeepAspectRatio
)
);
drag
->
exec
(
Qt
::
CopyAction
|
Qt
::
MoveAction
,
Qt
::
CopyAction
);
}
...
...
src/Gui/library/MediaListViewController.cpp
View file @
4e7a52a9
...
...
@@ -40,7 +40,7 @@ MediaListViewController::~MediaListViewController()
void
MediaListViewController
::
newMediaLoaded
(
Media
*
media
)
{
MediaCellView
*
cell
=
new
MediaCellView
(
media
->
getU
uid
()
);
MediaCellView
*
cell
=
new
MediaCellView
(
media
->
u
uid
()
);
connect
(
cell
,
SIGNAL
(
cellSelected
(
QUuid
)
),
this
,
SLOT
(
cellSelection
(
QUuid
)
)
);
...
...
@@ -51,13 +51,13 @@ void MediaListViewController::newMediaLoaded( Media* media )
connect
(
media
,
SIGNAL
(
snapshotComputed
(
Media
*
)
),
this
,
SLOT
(
updateCell
(
Media
*
)
)
);
cell
->
setNbClips
(
media
->
clips
()
->
size
()
);
cell
->
setThumbnail
(
media
->
getS
napshot
()
);
cell
->
setTitle
(
media
->
getF
ileName
()
);
cell
->
setLength
(
media
->
getL
engthMS
()
);
cell
->
setThumbnail
(
media
->
s
napshot
()
);
cell
->
setTitle
(
media
->
f
ileName
()
);
cell
->
setLength
(
media
->
l
engthMS
()
);
if
(
media
->
baseClip
()
!=
NULL
)
cell
->
setEnabled
(
true
);
addCell
(
cell
);
m_cells
->
insert
(
media
->
getU
uid
(),
cell
);
m_cells
->
insert
(
media
->
u
uid
(),
cell
);
}
void
MediaListViewController
::
cellSelection
(
const
QUuid
&
uuid
)
...
...
@@ -90,12 +90,12 @@ void MediaListViewController::mediaRemoved( const QUuid& uuid )
void
MediaListViewController
::
updateCell
(
Media
*
media
)
{
MediaCellView
*
cell
=
qobject_cast
<
MediaCellView
*>
(
m_cells
->
value
(
media
->
getU
uid
(),
NULL
)
);
MediaCellView
*
cell
=
qobject_cast
<
MediaCellView
*>
(
m_cells
->
value
(
media
->
u
uid
(),
NULL
)
);
if
(
cell
!=
NULL
)
{
cell
->
setNbClips
(
media
->
clips
()
->
size
()
);
cell
->
setLength
(
media
->
getL
engthMS
()
);
cell
->
setThumbnail
(
media
->
getS
napshot
()
);
cell
->
setLength
(
media
->
l
engthMS
()
);
cell
->
setThumbnail
(
media
->
s
napshot
()
);
cell
->
setEnabled
(
true
);
}
}
...
...
@@ -119,7 +119,7 @@ void MediaListViewController::newClipAdded( Clip* clip )
{
if
(
clip
->
getParent
()
==
0
)
return
;
const
QUuid
&
uuid
=
clip
->
getParent
()
->
getU
uid
();
const
QUuid
&
uuid
=
clip
->
getParent
()
->
u
uid
();
if
(
m_cells
->
contains
(
uuid
)
)
{
...
...
src/Gui/timeline/AbstractGraphicsMediaItem.cpp
View file @
4e7a52a9
...
...
@@ -208,13 +208,13 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
if
(
size
<
1
)
return
;
if
(
clip
()
->
getParent
()
->
getF
ileType
()
!=
Media
::
Image
)
if
(
clip
()
->
getParent
()
->
f
ileType
()
!=
Media
::
Image
)
if
(
size
>
clip
()
->
getMaxEnd
()
)
return
;
if
(
from
==
BEGINNING
)
{
if
(
clip
()
->
getParent
()
->
getF
ileType
()
!=
Media
::
Image
)
if
(
clip
()
->
getParent
()
->
f
ileType
()
!=
Media
::
Image
)
if
(
clip
()
->
getBegin
()
+
size
>
clip
()
->
getMaxEnd
()
)
return
;
//FIXME
...
...
@@ -223,7 +223,7 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
}
else
{
if
(
clip
()
->
getParent
()
->
getF
ileType
()
!=
Media
::
Image
)
if
(
clip
()
->
getParent
()
->
f
ileType
()
!=
Media
::
Image
)
{
qint64
newBegin
=
qMax
(
clip
()
->
getEnd
()
-
size
,
(
qint64
)
0
);
if
(
clip
()
->
getMaxBegin
()
>
newBegin
)
...
...
src/Gui/timeline/GraphicsAudioItem.cpp
View file @
4e7a52a9
...
...
@@ -33,10 +33,10 @@ GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) : m_clip( clip )
{
setFlags
(
QGraphicsItem
::
ItemIsSelectable
);
QTime
length
=
QTime
().
addMSecs
(
clip
->
getParent
()
->
getL
engthMS
()
);
QTime
length
=
QTime
().
addMSecs
(
clip
->
getParent
()
->
l
engthMS
()
);
QString
tooltip
(
tr
(
"<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2"
)
.
arg
(
clip
->
getParent
()
->
getF
ileName
()
)
.
arg
(
clip
->
getParent
()
->
f
ileName
()
)
.
arg
(
length
.
toString
(
"hh:mm:ss.zzz"
)
)
);
setToolTip
(
tooltip
);
setAcceptHoverEvents
(
true
);
...
...
@@ -157,7 +157,7 @@ void GraphicsAudioItem::paintTitle( QPainter* painter, const QStyleOptionGraphic
// Initiate the font metrics calculation
QFontMetrics
fm
(
painter
->
font
()
);
QString
text
=
m_clip
->
getParent
()
->
getF
ileName
();
QString
text
=
m_clip
->
getParent
()
->
f
ileName
();
// Get the transformations required to map the text on the viewport
QTransform
viewPortTransform
=
Timeline
::
getInstance
()
->
tracksView
()
->
viewportTransform
();
...
...
src/Gui/timeline/GraphicsMovieItem.cpp
View file @
4e7a52a9
...
...
@@ -33,10 +33,10 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : m_clip( clip )
{
setFlags
(
QGraphicsItem
::
ItemIsSelectable
);
QTime
length
=
QTime
().
addMSecs
(
clip
->
getParent
()
->
getL
engthMS
()
);
QTime
length
=
QTime
().
addMSecs
(
clip
->
getParent
()
->
l
engthMS
()
);
QString
tooltip
(
tr
(
"<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2"
)
.
arg
(
clip
->
getParent
()
->
getF
ileName
()
)
.
arg
(
clip
->
getParent
()
->
f
ileName
()
)
.
arg
(
length
.
toString
(
"hh:mm:ss.zzz"
)
)
);
setToolTip
(
tooltip
);
setAcceptHoverEvents
(
true
);
...
...
@@ -156,7 +156,7 @@ void GraphicsMovieItem::paintTitle( QPainter* painter, const QStyleOptionGraphic
// Initiate the font metrics calculation
QFontMetrics
fm
(
painter
->
font
()
);
QString
text
=
m_clip
->
getParent
()
->
getF
ileName
();
QString
text
=
m_clip
->
getParent
()
->
f
ileName
();
// Get the transformations required to map the text on the viewport
QTransform
viewPortTransform
=
Timeline
::
getInstance
()
->
tracksView
()
->
viewportTransform
();
...
...
src/Gui/timeline/TracksView.cpp
View file @
4e7a52a9
...
...
@@ -196,7 +196,7 @@ TracksView::deleteMedia( const QUuid &uuid )
// is the one we would like to remove.
foreach
(
item
,
items
)
{
if
(
item
->
clip
()
->
getParent
()
->
getU
uid
()
==
if
(
item
->
clip
()
->
getParent
()
->
u
uid
()
==
uuid
)
{
// This item needs to be removed.
...
...
src/Library/Library.cpp
View file @
4e7a52a9
...
...
@@ -106,7 +106,7 @@ Library::addMedia( const QFileInfo& fileInfo, const QString& uuid )
foreach
(
Media
*
it
,
m_medias
.
values
()
)
{
if
(
it
->
getF
ileInfo
()
->
filePath
()
==
media
->
getF
ileInfo
()
->
filePath
()
)
if
(
it
->
f
ileInfo
()
->
filePath
()
==
media
->
f
ileInfo
()
->
filePath
()
)
{
delete
media
;
return
;
...
...
@@ -120,14 +120,14 @@ Library::addMedia( const QFileInfo& fileInfo, const QString& uuid )
void
Library
::
addMedia
(
Media
*
media
)
{
m_medias
[
media
->
getU
uid
()]
=
media
;
m_medias
[
media
->
u
uid
()]
=
media
;
emit
newMediaLoaded
(
media
);
}
void
Library
::
addClip
(
Clip
*
clip
)
{
Media
*
media
=
m_medias
[
clip
->
getParent
()
->
getU
uid
()];
Media
*
media
=
m_medias
[
clip
->
getParent
()
->
u
uid
()];
media
->
addClip
(
clip
);
}
...
...
@@ -136,7 +136,7 @@ Library::mediaAlreadyLoaded( const QFileInfo& fileInfo )
{
foreach
(
Media
*
media
,
m_medias
.
values
()
)
{
if
(
media
->
getF
ileInfo
()
->
filePath
()
==
fileInfo
.
filePath
()
)
if
(
media
->
f
ileInfo
()
->
filePath
()
==
fileInfo
.
filePath
()
)
return
true
;
}
return
false
;
...
...
@@ -188,12 +188,12 @@ Library::loadProject( const QDomElement& medias )
for
(
;
it
!=
end
;
++
it
)
{
if
(
it
.
value
()
->
getF
ileInfo
()
->
absoluteFilePath
()
==
path
)
if
(
it
.
value
()
->
f
ileInfo
()
->
absoluteFilePath
()
==
path
)
{
media
=
it
.
value
();
media
->
setUuid
(
QUuid
(
uuid
)
);
m_medias
.
erase
(
it
);
m_medias
[
media
->
getU
uid
()]
=
media
;
m_medias
[
media
->
u
uid
()]
=
media
;
break
;
}
}
...
...
@@ -246,10 +246,10 @@ Library::saveProject( QDomDocument& doc, QDomElement& rootNode )
QDomElement
mrl
=
doc
.
createElement
(
"path"
);
QDomCharacterData
text
;
text
=
doc
.
createTextNode
(
it
.
value
()
->
getF
ileInfo
()
->
absoluteFilePath
()
);
text
=
doc
.
createTextNode
(
it
.
value
()
->
f
ileInfo
()
->
absoluteFilePath
()
);
QDomElement
uuid
=
doc
.
createElement
(
"uuid"
);
QDomCharacterData
text2
=
doc
.
createTextNode
(
it
.
value
()
->
getU
uid
().
toString
()
);
QDomCharacterData
text2
=
doc
.
createTextNode
(
it
.
value
()
->
u
uid
().
toString
()
);
mrl
.
appendChild
(
text
);
uuid
.
appendChild
(
text2
);
...
...
@@ -266,7 +266,7 @@ Library::saveProject( QDomDocument& doc, QDomElement& rootNode )
clip
.
setAttribute
(
"begin"
,
c
->
getBegin
()
);
clip
.
setAttribute
(
"end"
,
c
->
getEnd
()
);
clip
.
setAttribute
(
"uuid"
,
c
->
getUuid
()
);
clip
.
setAttribute
(
"parentUuid"
,
c
->
getParent
()
->
getU
uid
()
);
clip
.
setAttribute
(
"parentUuid"
,
c
->
getParent
()
->
u
uid
()
);
clips
.
appendChild
(
clip
);
}
media
.
appendChild
(
clips
);
...
...
src/Media/Clip.cpp
View file @
4e7a52a9
...
...
@@ -34,9 +34,9 @@ const int Clip::DefaultFPS = 30;
Clip
::
Clip
(
Media
*
parent
)
:
m_parent
(
parent
),
m_begin
(
0
),
m_end
(
parent
->
getN
bFrames
()
),
m_end
(
parent
->
n
bFrames
()
),
m_maxBegin
(
0
),
m_maxEnd
(
parent
->
getN
bFrames
()
)
m_maxEnd
(
parent
->
n
bFrames
()
)
{
m_Uuid
=
QUuid
::
createUuid
();
computeLength
();
...
...
@@ -61,11 +61,11 @@ Clip::Clip( Media* parent, qint64 begin, qint64 end /*= -1*/ ) :
m_maxEnd
(
end
)
{
//FIXME: WTF ?
Q_ASSERT
(
parent
->
getI
nputType
()
==
Media
::
File
||
(
begin
==
0
&&
end
==
m_parent
->
getN
bFrames
()
)
);
Q_ASSERT
(
parent
->
i
nputType
()
==
Media
::
File
||
(
begin
==
0
&&
end
==
m_parent
->
n
bFrames
()
)
);
if
(
parent
->
getI
nputType
()
==
Media
::
File
&&
end
<
0
)
if
(
parent
->
i
nputType
()
==
Media
::
File
&&
end
<
0
)
{
m_end
=
parent
->
getN
bFrames
();
m_end
=
parent
->
n
bFrames
();
m_maxEnd
=
m_end
;
}
m_Uuid
=
QUuid
::
createUuid
();
...
...
@@ -141,9 +141,9 @@ qint64 Clip::getLengthSecond() const
void
Clip
::
computeLength
()
{
if
(
m_parent
->
getI
nputType
()
==
Media
::
File
)
if
(
m_parent
->
i
nputType
()
==
Media
::
File
)
{
float
fps
=
m_parent
->
getF
ps
();
float
fps
=
m_parent
->
f
ps
();
if
(
fps
<
0.1
f
)
fps
=
Clip
::
DefaultFPS
;
m_length
=
m_end
-
m_begin
;
...
...
src/Media/Media.cpp
View file @
4e7a52a9
...
...
@@ -134,7 +134,7 @@ void Media::setSnapshot( QPixmap* snapshot )
m_snapshot
=
snapshot
;
}
const
QPixmap
&
Media
::
getS
napshot
()
const
const
QPixmap
&
Media
::
s
napshot
()
const
{
if
(
m_snapshot
!=
NULL
)
return
*
m_snapshot
;
...
...
@@ -143,12 +143,12 @@ const QPixmap& Media::getSnapshot() const
return
*
Media
::
defaultSnapshot
;
}
const
QUuid
&
Media
::
getU
uid
()
const
const
QUuid
&
Media
::
u
uid
()
const
{
return
m_uuid
;
}
const
QFileInfo
*
Media
::
getF
ileInfo
()
const
const
QFileInfo
*
Media
::
f
ileInfo
()
const
{
return
m_fileInfo
;
}
...
...
@@ -158,12 +158,12 @@ void Media::setLength( qint64 length )
m_lengthMS
=
length
;
}
qint64
Media
::
getL
engthMS
()
const
qint64
Media
::
l
engthMS
()
const
{
return
m_lengthMS
;
}
int
Media
::
getW
idth
()
const
int
Media
::
w
idth
()
const
{
return
m_width
;
}
...
...
@@ -173,7 +173,7 @@ void Media::setWidth( int width )
m_width
=
width
;
}
int
Media
::
getH
eight
()
const
int
Media
::
h
eight
()
const
{
return
m_height
;
}
...
...
@@ -183,7 +183,7 @@ void Media::setHeight( int height )
m_height
=
height
;
}
float
Media
::
getF
ps
()
const
float
Media
::
f
ps
()
const
{
return
m_fps
;
}
...
...
@@ -193,7 +193,7 @@ void Media::setFps( float fps )
m_fps
=
fps
;
}
Media
::
FileType
Media
::
getF
ileType
()
const
Media
::
FileType
Media
::
f
ileType
()
const
{
return
m_fileType
;
}
...
...
@@ -212,10 +212,10 @@ void Media::emitSnapshotComputed()
void
Media
::
emitAudioSpectrumComuted
()
{
emit
audioSpectrumComputed
(
this
->
getU
uid
()
);
emit
audioSpectrumComputed
(
this
->
u
uid
()
);
}
Media
::
InputType
Media
::
getI
nputType
()
const
Media
::
InputType
Media
::
i
nputType
()
const
{
return
m_inputType
;
}
...
...
@@ -230,22 +230,22 @@ void Media::setNbFrames( qint64 nbFrames )
m_nbFrames
=
nbFrames
;
}
qint64
Media
::
getN
bFrames
()
const
qint64
Media
::
n
bFrames
()
const
{
return
m_nbFrames
;
}
const
QString
&
Media
::
getM
rl
()
const
const
QString
&
Media
::
m
rl
()
const
{
return
m_mrl
;
}
const
QString
&
Media
::
getF
ileName
()
const
const
QString
&
Media
::
f
ileName
()
const
{
return
m_fileName
;
}
const
QStringList
&
Media
::
getM
etaTags
()
const
const
QStringList
&
Media
::
m
etaTags
()
const
{
return
m_metaTags
;
}
...
...
@@ -303,13 +303,13 @@ Media::setNbVideoTrack( int nbTracks )
}
int
Media
::
getN
bAudioTracks
()
const
Media
::
n
bAudioTracks
()
const
{
return
m_nbAudioTracks
;
}
int
Media
::
getN
bVideoTracks
()
const
Media
::
n
bVideoTracks
()
const
{
return
m_nbVideoTracks
;
}
src/Media/Media.h
View file @
4e7a52a9
...
...
@@ -70,7 +70,8 @@ public:
virtual
~
Media
();