Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
a12cf2d6
Commit
a12cf2d6
authored
May 27, 2013
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
const'ify. Remove unimplemented function. Fix indent. Optimization
parent
cba3c6aa
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
235 additions
and
233 deletions
+235
-233
src/clipproperties.h
src/clipproperties.h
+3
-1
src/clipstabilize.h
src/clipstabilize.h
+1
-1
src/colorcorrection/histogramgenerator.cpp
src/colorcorrection/histogramgenerator.cpp
+3
-3
src/colorcorrection/histogramgenerator.h
src/colorcorrection/histogramgenerator.h
+3
-3
src/colorcorrection/rgbparadegenerator.cpp
src/colorcorrection/rgbparadegenerator.cpp
+2
-2
src/colorcorrection/rgbparadegenerator.h
src/colorcorrection/rgbparadegenerator.h
+1
-1
src/colorcorrection/vectorscopegenerator.cpp
src/colorcorrection/vectorscopegenerator.cpp
+1
-1
src/colorcorrection/vectorscopegenerator.h
src/colorcorrection/vectorscopegenerator.h
+2
-2
src/colorcorrection/waveformgenerator.cpp
src/colorcorrection/waveformgenerator.cpp
+1
-1
src/colorcorrection/waveformgenerator.h
src/colorcorrection/waveformgenerator.h
+1
-1
src/complexparameter.h
src/complexparameter.h
+2
-2
src/customtrackview.cpp
src/customtrackview.cpp
+6
-6
src/customtrackview.h
src/customtrackview.h
+6
-7
src/databackup/backupwidget.cpp
src/databackup/backupwidget.cpp
+4
-4
src/docclipbase.cpp
src/docclipbase.cpp
+118
-116
src/docclipbase.h
src/docclipbase.h
+6
-6
src/dragvalue.h
src/dragvalue.h
+6
-6
src/effectstack/abstractcollapsiblewidget.h
src/effectstack/abstractcollapsiblewidget.h
+3
-3
src/effectstack/collapsibleeffect.h
src/effectstack/collapsibleeffect.h
+5
-5
src/effectstack/collapsiblegroup.h
src/effectstack/collapsiblegroup.h
+3
-4
src/effectstack/effectstackview2.cpp
src/effectstack/effectstackview2.cpp
+4
-4
src/effectstack/effectstackview2.h
src/effectstack/effectstackview2.h
+11
-11
src/effectstack/parametercontainer.h
src/effectstack/parametercontainer.h
+3
-3
src/lib/audio/audioInfo.cpp
src/lib/audio/audioInfo.cpp
+2
-2
src/lib/audio/audioInfo.h
src/lib/audio/audioInfo.h
+0
-1
src/lib/audio/audioStreamInfo.cpp
src/lib/audio/audioStreamInfo.cpp
+1
-1
src/onmonitoritems/onmonitorcornersitem.cpp
src/onmonitoritems/onmonitorcornersitem.cpp
+7
-7
src/onmonitoritems/onmonitorpathitem.cpp
src/onmonitoritems/onmonitorpathitem.cpp
+5
-4
src/onmonitoritems/onmonitorpathitem.h
src/onmonitoritems/onmonitorpathitem.h
+1
-1
src/onmonitoritems/onmonitorrectitem.cpp
src/onmonitoritems/onmonitorrectitem.cpp
+2
-2
src/scopes/audioscopes/audiosignal.cpp
src/scopes/audioscopes/audiosignal.cpp
+1
-1
src/scopes/audioscopes/audiosignal.h
src/scopes/audioscopes/audiosignal.h
+1
-1
src/scopes/audioscopes/audiospectrum.cpp
src/scopes/audioscopes/audiospectrum.cpp
+20
-20
No files found.
src/clipproperties.h
View file @
a12cf2d6
...
...
@@ -32,7 +32,9 @@ class PropertiesViewDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
PropertiesViewDelegate
(
QWidget
*
parent
)
:
QStyledItemDelegate
(
parent
)
{
PropertiesViewDelegate
(
QWidget
*
parent
)
:
QStyledItemDelegate
(
parent
)
{
m_height
=
parent
->
fontMetrics
().
height
()
*
1.2
;
}
protected:
...
...
src/clipstabilize.h
View file @
a12cf2d6
...
...
@@ -68,7 +68,7 @@ private:
QStringList
m_fixedParams
;
signals:
void
addClip
(
KUrl
url
);
void
addClip
(
const
KUrl
&
url
);
};
...
...
src/colorcorrection/histogramgenerator.cpp
View file @
a12cf2d6
...
...
@@ -19,7 +19,7 @@ HistogramGenerator::HistogramGenerator()
}
QImage
HistogramGenerator
::
calculateHistogram
(
const
QSize
&
paradeSize
,
const
QImage
&
image
,
const
int
&
components
,
HistogramGenerator
::
Rec
rec
,
const
bool
&
unscaled
,
const
uint
&
accelFactor
)
const
HistogramGenerator
::
Rec
rec
,
bool
unscaled
,
uint
accelFactor
)
const
{
if
(
paradeSize
.
height
()
<=
0
||
paradeSize
.
width
()
<=
0
||
image
.
width
()
<=
0
||
image
.
height
()
<=
0
)
{
return
QImage
();
...
...
@@ -130,7 +130,7 @@ QImage HistogramGenerator::calculateHistogram(const QSize ¶deSize, const QIm
}
QImage
HistogramGenerator
::
drawComponent
(
const
int
*
y
,
const
QSize
&
size
,
const
float
&
scaling
,
const
QColor
&
color
,
const
bool
&
unscaled
,
const
uint
&
max
)
const
bool
unscaled
,
uint
max
)
const
{
QImage
component
(
max
,
size
.
height
(),
QImage
::
Format_ARGB32
);
component
.
fill
(
qRgba
(
0
,
0
,
0
,
0
));
...
...
@@ -159,7 +159,7 @@ QImage HistogramGenerator::drawComponent(const int *y, const QSize &size, const
}
void
HistogramGenerator
::
drawComponentFull
(
QPainter
*
davinci
,
const
int
*
y
,
const
float
&
scaling
,
const
QRect
&
rect
,
const
QColor
&
color
,
const
int
&
textSpace
,
const
bool
&
unscaled
,
const
uint
&
max
)
const
const
QColor
&
color
,
int
textSpace
,
bool
unscaled
,
uint
max
)
const
{
QImage
component
=
drawComponent
(
y
,
rect
.
size
()
-
QSize
(
0
,
textSpace
),
scaling
,
color
,
unscaled
,
max
);
davinci
->
drawImage
(
rect
.
topLeft
(),
component
);
...
...
src/colorcorrection/histogramgenerator.h
View file @
a12cf2d6
...
...
@@ -33,12 +33,12 @@ public:
components are OR-ed HistogramGenerator::Components flags and decide with components (Y, R, G, B) to paint.
unscaled = true leaves the width at 256 if the widget is wider (to avoid scaling). */
QImage
calculateHistogram
(
const
QSize
&
paradeSize
,
const
QImage
&
image
,
const
int
&
components
,
const
HistogramGenerator
::
Rec
rec
,
const
bool
&
unscaled
,
const
uint
&
accelFactor
=
1
)
const
;
bool
unscaled
,
uint
accelFactor
=
1
)
const
;
QImage
drawComponent
(
const
int
*
y
,
const
QSize
&
size
,
const
float
&
scaling
,
const
QColor
&
color
,
const
bool
&
unscaled
,
const
uint
&
max
)
const
;
QImage
drawComponent
(
const
int
*
y
,
const
QSize
&
size
,
const
float
&
scaling
,
const
QColor
&
color
,
bool
unscaled
,
uint
max
)
const
;
void
drawComponentFull
(
QPainter
*
davinci
,
const
int
*
y
,
const
float
&
scaling
,
const
QRect
&
rect
,
const
QColor
&
color
,
const
int
&
textSpace
,
const
bool
&
unscaled
,
const
uint
&
max
)
const
;
const
QColor
&
color
,
int
textSpace
,
bool
unscaled
,
uint
max
)
const
;
enum
Components
{
ComponentY
=
1
<<
0
,
ComponentR
=
1
<<
1
,
ComponentG
=
1
<<
2
,
ComponentB
=
1
<<
3
,
ComponentSum
=
1
<<
4
};
...
...
src/colorcorrection/rgbparadegenerator.cpp
View file @
a12cf2d6
...
...
@@ -37,8 +37,8 @@ RGBParadeGenerator::RGBParadeGenerator()
}
QImage
RGBParadeGenerator
::
calculateRGBParade
(
const
QSize
&
paradeSize
,
const
QImage
&
image
,
const
RGBParadeGenerator
::
PaintMode
paintMode
,
const
bool
&
drawAxis
,
const
bool
&
drawGradientRef
,
const
uint
&
accelFactor
)
const
RGBParadeGenerator
::
PaintMode
paintMode
,
bool
drawAxis
,
bool
drawGradientRef
,
uint
accelFactor
)
{
Q_ASSERT
(
accelFactor
>=
1
);
...
...
src/colorcorrection/rgbparadegenerator.h
View file @
a12cf2d6
...
...
@@ -23,7 +23,7 @@ public:
RGBParadeGenerator
();
QImage
calculateRGBParade
(
const
QSize
&
paradeSize
,
const
QImage
&
image
,
const
RGBParadeGenerator
::
PaintMode
paintMode
,
const
bool
&
drawAxis
,
const
bool
&
drawGradientRef
,
const
uint
&
accelFactor
=
1
);
bool
drawAxis
,
bool
drawGradientRef
,
uint
accelFactor
=
1
);
static
const
QColor
colHighlight
;
static
const
QColor
colLight
;
...
...
src/colorcorrection/vectorscopegenerator.cpp
View file @
a12cf2d6
...
...
@@ -118,7 +118,7 @@ QPoint VectorscopeGenerator::mapToCircle(const QSize &targetSize, const QPointF
QImage
VectorscopeGenerator
::
calculateVectorscope
(
const
QSize
&
vectorscopeSize
,
const
QImage
&
image
,
const
float
&
gain
,
const
VectorscopeGenerator
::
PaintMode
&
paintMode
,
const
VectorscopeGenerator
::
ColorSpace
&
colorSpace
,
const
bool
&
,
const
uint
&
accelFactor
)
const
bool
,
uint
accelFactor
)
const
{
if
(
vectorscopeSize
.
width
()
<=
0
||
vectorscopeSize
.
height
()
<=
0
||
image
.
width
()
<=
0
||
image
.
height
()
<=
0
)
{
// Invalid size
...
...
src/colorcorrection/vectorscopegenerator.h
View file @
a12cf2d6
...
...
@@ -30,13 +30,13 @@ public:
QImage
calculateVectorscope
(
const
QSize
&
vectorscopeSize
,
const
QImage
&
image
,
const
float
&
gain
,
const
VectorscopeGenerator
::
PaintMode
&
paintMode
,
const
VectorscopeGenerator
::
ColorSpace
&
colorSpace
,
const
bool
&
,
const
uint
&
accelFactor
=
1
)
const
;
bool
,
uint
accelFactor
=
1
)
const
;
QPoint
mapToCircle
(
const
QSize
&
targetSize
,
const
QPointF
&
point
)
const
;
static
const
float
scaling
;
signals:
void
signalCalculationFinished
(
QImage
image
,
const
uint
&
ms
);
void
signalCalculationFinished
(
const
QImage
&
image
,
uint
ms
);
};
...
...
src/colorcorrection/waveformgenerator.cpp
View file @
a12cf2d6
...
...
@@ -29,7 +29,7 @@ WaveformGenerator::~WaveformGenerator()
}
QImage
WaveformGenerator
::
calculateWaveform
(
const
QSize
&
waveformSize
,
const
QImage
&
image
,
WaveformGenerator
::
PaintMode
paintMode
,
const
bool
&
drawAxis
,
WaveformGenerator
::
Rec
rec
,
const
uint
&
accelFactor
)
bool
drawAxis
,
WaveformGenerator
::
Rec
rec
,
uint
accelFactor
)
{
Q_ASSERT
(
accelFactor
>=
1
);
...
...
src/colorcorrection/waveformgenerator.h
View file @
a12cf2d6
...
...
@@ -27,7 +27,7 @@ public:
~
WaveformGenerator
();
QImage
calculateWaveform
(
const
QSize
&
waveformSize
,
const
QImage
&
image
,
WaveformGenerator
::
PaintMode
paintMode
,
const
bool
&
drawAxis
,
const
WaveformGenerator
::
Rec
rec
,
const
uint
&
accelFactor
=
1
);
bool
drawAxis
,
const
WaveformGenerator
::
Rec
rec
,
uint
accelFactor
=
1
);
//signals:
//void signalCalculationFinished(QImage image, const uint &ms);
...
...
src/complexparameter.h
View file @
a12cf2d6
...
...
@@ -49,8 +49,8 @@ public slots:
void
slotUpdateEffectParams
(
const
QDomElement
&
e
);
void
slotUpdateParameterList
(
const
QStringList
&
);
signals:
void
removeEffect
(
ClipItem
*
,
QDomElement
);
void
updateClipEffect
(
ClipItem
*
,
QDomElement
);
void
removeEffect
(
ClipItem
*
,
const
QDomElement
&
);
void
updateClipEffect
(
ClipItem
*
,
const
QDomElement
&
);
void
parameterChanged
();
};
...
...
src/customtrackview.cpp
View file @
a12cf2d6
...
...
@@ -2020,7 +2020,7 @@ void CustomTrackView::slotDropEffect(ClipItem *clip, QDomElement effect, GenTime
}
}
void
CustomTrackView
::
slotAddEffect
(
QDomElement
effect
,
GenTime
pos
,
int
track
)
void
CustomTrackView
::
slotAddEffect
(
QDomElement
effect
,
const
GenTime
&
pos
,
int
track
)
{
QList
<
QGraphicsItem
*>
itemList
;
QUndoCommand
*
effectCommand
=
new
QUndoCommand
();
...
...
@@ -2432,7 +2432,7 @@ void CustomTrackView::slotUpdateClipRegion(ClipItem *clip, int ix, QString regio
m_commandStack
->
push
(
command
);
}
ClipItem
*
CustomTrackView
::
cutClip
(
ItemInfo
info
,
GenTime
cutTime
,
bool
cut
,
EffectsList
oldStack
,
bool
execute
)
ClipItem
*
CustomTrackView
::
cutClip
(
const
ItemInfo
&
info
,
const
GenTime
&
cutTime
,
bool
cut
,
const
EffectsList
&
oldStack
,
bool
execute
)
{
if
(
cut
)
{
// cut clip
...
...
@@ -2666,7 +2666,7 @@ void CustomTrackView::slotAddTransition(ClipItem* /*clip*/, ItemInfo transitionI
setDocumentModified
();
}
void
CustomTrackView
::
addTransition
(
ItemInfo
transitionInfo
,
int
endTrack
,
QDomElement
params
,
bool
refresh
)
void
CustomTrackView
::
addTransition
(
const
ItemInfo
&
transitionInfo
,
int
endTrack
,
const
QDomElement
&
params
,
bool
refresh
)
{
Transition
*
tr
=
new
Transition
(
transitionInfo
,
endTrack
,
m_document
->
fps
(),
params
,
true
);
//kDebug() << "---- ADDING transition " << params.attribute("value");
...
...
@@ -2679,7 +2679,7 @@ void CustomTrackView::addTransition(ItemInfo transitionInfo, int endTrack, QDomE
}
}
void
CustomTrackView
::
deleteTransition
(
ItemInfo
transitionInfo
,
int
endTrack
,
QDomElement
/*params*/
,
bool
refresh
)
void
CustomTrackView
::
deleteTransition
(
const
ItemInfo
&
transitionInfo
,
int
endTrack
,
QDomElement
/*params*/
,
bool
refresh
)
{
Transition
*
item
=
getTransitionItemAt
(
transitionInfo
.
startPos
,
transitionInfo
.
track
);
if
(
!
item
)
{
...
...
@@ -3049,7 +3049,7 @@ int CustomTrackView::duration() const
return
m_projectDuration
;
}
void
CustomTrackView
::
addTrack
(
TrackInfo
type
,
int
ix
)
void
CustomTrackView
::
addTrack
(
const
TrackInfo
&
type
,
int
ix
)
{
QList
<
TransitionInfo
>
transitionInfos
;
if
(
ix
==
-
1
||
ix
==
m_document
->
tracksCount
())
{
...
...
@@ -4830,7 +4830,7 @@ bool CustomTrackView::moveClip(const ItemInfo &start, const ItemInfo &end, bool
return
success
;
}
void
CustomTrackView
::
moveGroup
(
QList
<
ItemInfo
>
startClip
,
QList
<
ItemInfo
>
startTransition
,
const
GenTime
&
offset
,
const
int
trackOffset
,
bool
reverseMove
)
void
CustomTrackView
::
moveGroup
(
QList
<
ItemInfo
>
startClip
,
QList
<
ItemInfo
>
startTransition
,
const
GenTime
&
offset
,
const
int
trackOffset
,
bool
reverseMove
)
{
// Group Items
resetSelectionGroup
();
...
...
src/customtrackview.h
View file @
a12cf2d6
...
...
@@ -55,7 +55,7 @@ public:
virtual
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
virtual
void
mouseMoveEvent
(
QMouseEvent
*
event
);
virtual
void
mouseDoubleClickEvent
(
QMouseEvent
*
event
);
void
addTrack
(
TrackInfo
type
,
int
ix
=
-
1
);
void
addTrack
(
const
TrackInfo
&
type
,
int
ix
=
-
1
);
void
removeTrack
(
int
ix
);
/** @brief Makes the document use new track infos (name, type, ...). */
void
configTracks
(
const
QList
<
TrackInfo
>
&
trackInfos
);
...
...
@@ -68,7 +68,7 @@ public:
For example, attempting to move a clip to t = -1 s will actually move it to t = 0 s.
*/
bool
moveClip
(
const
ItemInfo
&
start
,
const
ItemInfo
&
end
,
bool
refresh
,
ItemInfo
*
out_actualEnd
=
NULL
);
void
moveGroup
(
QList
<
ItemInfo
>
startClip
,
QList
<
ItemInfo
>
startTransition
,
const
GenTime
&
offset
,
const
int
trackOffset
,
bool
reverseMove
=
false
);
void
moveGroup
(
QList
<
ItemInfo
>
startClip
,
QList
<
ItemInfo
>
startTransition
,
const
GenTime
&
offset
,
const
int
trackOffset
,
bool
reverseMove
=
false
);
/** move transition, startPos = (old start, old end), endPos = (new start, new end) */
void
moveTransition
(
const
ItemInfo
&
start
,
const
ItemInfo
&
end
,
bool
refresh
);
void
resizeClip
(
const
ItemInfo
&
start
,
const
ItemInfo
&
end
,
bool
dontWorry
=
false
);
...
...
@@ -83,7 +83,7 @@ public:
/** @brief An effect was dropped on @param clip */
void
slotDropEffect
(
ClipItem
*
clip
,
QDomElement
effect
,
GenTime
pos
,
int
track
);
/** @brief Add effect to current clip */
void
slotAddEffect
(
QDomElement
effect
,
GenTime
pos
,
int
track
);
void
slotAddEffect
(
QDomElement
effect
,
const
GenTime
&
pos
,
int
track
);
void
slotAddGroupEffect
(
QDomElement
effect
,
AbstractGroupItem
*
group
,
AbstractClipItem
*
dropTarget
=
NULL
);
void
addEffect
(
int
track
,
GenTime
pos
,
QDomElement
effect
);
void
deleteEffect
(
int
track
,
GenTime
pos
,
QDomElement
effect
);
...
...
@@ -91,10 +91,9 @@ public:
/** @brief Enable / disable a list of effects */
void
updateEffectState
(
int
track
,
GenTime
pos
,
QList
<
int
>
effectIndexes
,
bool
disable
,
bool
updateEffectStack
);
void
moveEffect
(
int
track
,
GenTime
pos
,
QList
<
int
>
oldPos
,
QList
<
int
>
newPos
);
void
addTransition
(
ItemInfo
transitionInfo
,
int
endTrack
,
QDomElement
params
,
bool
refresh
);
void
deleteTransition
(
ItemInfo
transitionInfo
,
int
endTrack
,
QDomElement
params
,
bool
refresh
);
void
addTransition
(
const
ItemInfo
&
transitionInfo
,
int
endTrack
,
const
QDomElement
&
params
,
bool
refresh
);
void
deleteTransition
(
const
ItemInfo
&
transitionInfo
,
int
endTrack
,
QDomElement
params
,
bool
refresh
);
void
updateTransition
(
int
track
,
GenTime
pos
,
QDomElement
oldTransition
,
QDomElement
transition
,
bool
updateTransitionWidget
);
void
moveTransition
(
GenTime
oldpos
,
GenTime
newpos
);
void
activateMonitor
();
int
duration
()
const
;
void
deleteSelectedClips
();
...
...
@@ -105,7 +104,7 @@ public:
void
updateSceneFrameWidth
();
//QList <TrackInfo> tracksList() const;
void
setTool
(
PROJECTTOOL
tool
);
ClipItem
*
cutClip
(
ItemInfo
info
,
GenTime
cutTime
,
bool
cut
,
EffectsList
oldStack
=
EffectsList
(),
bool
execute
=
true
);
ClipItem
*
cutClip
(
const
ItemInfo
&
info
,
const
GenTime
&
cutTime
,
bool
cut
,
const
EffectsList
&
oldStack
=
EffectsList
(),
bool
execute
=
true
);
void
slotSeekToPreviousSnap
();
void
slotSeekToNextSnap
();
double
getSnapPointForPos
(
double
pos
);
...
...
src/databackup/backupwidget.cpp
View file @
a12cf2d6
...
...
@@ -34,8 +34,7 @@ BackupWidget::BackupWidget(const KUrl &projectUrl, const KUrl &projectFolder, co
// No url, means we opened the backup dialog from an empty project
info_label
->
setText
(
i18n
(
"Showing all backup files in folder"
));
m_projectWildcard
=
'*'
;
}
else
{
}
else
{
info_label
->
setText
(
i18n
(
"Showing backup files for %1"
,
projectUrl
.
fileName
()));
m_projectWildcard
=
projectUrl
.
fileName
().
section
(
'.'
,
0
,
-
2
);
if
(
!
projectId
.
isEmpty
())
m_projectWildcard
.
append
(
'-'
+
projectId
);
...
...
@@ -83,7 +82,7 @@ void BackupWidget::slotParseBackupFiles()
QString
label
;
for
(
int
i
=
0
;
i
<
resultList
.
count
();
++
i
)
{
label
=
resultList
.
at
(
i
).
lastModified
().
toString
(
Qt
::
SystemLocaleLongDate
);
if
(
m_projectWildcard
.
startsWith
(
'*'
))
{
if
(
m_projectWildcard
.
startsWith
(
QLatin1Char
(
'*'
))
)
{
// Displaying all backup files, so add project name in the entries
label
.
prepend
(
resultList
.
at
(
i
).
fileName
().
section
(
'-'
,
0
,
-
7
)
+
".kdenlive - "
);
}
...
...
@@ -106,7 +105,8 @@ void BackupWidget::slotDisplayBackupPreview()
QString
BackupWidget
::
selectedFile
()
const
{
if
(
!
backup_list
->
currentItem
())
return
QString
();
if
(
!
backup_list
->
currentItem
())
return
QString
();
return
backup_list
->
currentItem
()
->
data
(
Qt
::
UserRole
).
toString
();
}
...
...
src/docclipbase.cpp
View file @
a12cf2d6
...
...
@@ -42,20 +42,20 @@
#include <kmessagebox.h>
DocClipBase
::
DocClipBase
(
ClipManager
*
clipManager
,
QDomElement
xml
,
const
QString
&
id
)
:
QObject
(),
lastSeekPosition
(
0
),
audioFrameCache
(),
m_refcount
(
0
),
m_baseTrackProducers
(),
m_videoTrackProducers
(),
m_audioTrackProducers
(),
m_snapMarkers
(
QList
<
CommentedTime
>
()),
m_duration
(),
m_thumbProd
(
NULL
),
m_audioThumbCreated
(
false
),
m_id
(
id
),
m_placeHolder
(
xml
.
hasAttribute
(
"placeholder"
)),
m_properties
()
QObject
(),
lastSeekPosition
(
0
),
audioFrameCache
(),
m_refcount
(
0
),
m_baseTrackProducers
(),
m_videoTrackProducers
(),
m_audioTrackProducers
(),
m_snapMarkers
(
QList
<
CommentedTime
>
()),
m_duration
(),
m_thumbProd
(
NULL
),
m_audioThumbCreated
(
false
),
m_id
(
id
),
m_placeHolder
(
xml
.
hasAttribute
(
"placeholder"
)),
m_properties
()
{
int
type
=
xml
.
attribute
(
"type"
).
toInt
();
m_clipType
=
(
CLIPTYPE
)
type
;
...
...
@@ -71,8 +71,8 @@ DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QStrin
for
(
int
i
=
0
;
i
<
metas
.
count
();
++
i
)
{
QDomElement
e
=
metas
.
item
(
i
).
toElement
();
if
(
!
e
.
isNull
())
{
m_metadata
.
insert
(
e
.
attribute
(
"name"
).
section
(
'.'
,
2
),
QStringList
()
<<
e
.
firstChild
().
nodeValue
()
<<
e
.
attribute
(
"tool"
));
}
m_metadata
.
insert
(
e
.
attribute
(
"name"
).
section
(
'.'
,
2
),
QStringList
()
<<
e
.
firstChild
().
nodeValue
()
<<
e
.
attribute
(
"tool"
));
}
}
if
(
xml
.
hasAttribute
(
"cutzones"
))
{
QStringList
cuts
=
xml
.
attribute
(
"cutzones"
).
split
(
';'
,
QString
::
SkipEmptyParts
);
...
...
@@ -83,9 +83,9 @@ DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QStrin
}
if
(
xml
.
hasAttribute
(
"analysisdata"
))
{
QStringList
adata
=
xml
.
attribute
(
"analysisdata"
).
split
(
'#'
,
QString
::
SkipEmptyParts
);
for
(
int
i
=
0
;
i
<
adata
.
count
();
++
i
)
m_analysisdata
.
insert
(
adata
.
at
(
i
).
section
(
'?'
,
0
,
0
),
adata
.
at
(
i
).
section
(
'?'
,
1
,
1
));
QStringList
adata
=
xml
.
attribute
(
"analysisdata"
).
split
(
'#'
,
QString
::
SkipEmptyParts
);
for
(
int
i
=
0
;
i
<
adata
.
count
();
++
i
)
m_analysisdata
.
insert
(
adata
.
at
(
i
).
section
(
'?'
,
0
,
0
),
adata
.
at
(
i
).
section
(
'?'
,
1
,
1
));
}
KUrl
url
=
KUrl
(
xml
.
attribute
(
"resource"
));
...
...
@@ -96,7 +96,7 @@ DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QStrin
}
else
{
int
out
=
xml
.
attribute
(
"out"
).
toInt
();
int
in
=
xml
.
attribute
(
"in"
).
toInt
();
if
(
out
>
in
)
setDuration
(
GenTime
(
out
-
in
+
1
,
KdenliveSettings
::
project_fps
()));
if
(
out
>
in
)
setDuration
(
GenTime
(
out
-
in
+
1
,
KdenliveSettings
::
project_fps
()));
}
if
(
!
m_properties
.
contains
(
"name"
))
m_properties
.
insert
(
"name"
,
url
.
fileName
());
...
...
@@ -125,7 +125,7 @@ DocClipBase::~DocClipBase()
m_videoTrackProducers
.
clear
();
}
void
DocClipBase
::
setZone
(
QPoint
zone
)
void
DocClipBase
::
setZone
(
const
QPoint
&
zone
)
{
m_properties
.
insert
(
"zone_in"
,
QString
::
number
(
zone
.
x
()));
m_properties
.
insert
(
"zone_out"
,
QString
::
number
(
zone
.
y
()));
...
...
@@ -267,14 +267,14 @@ QDomElement DocClipBase::toXML(bool hideTemporaryProperties) const
while
(
j
.
hasNext
())
{
j
.
next
();
if
(
!
j
.
value
().
isEmpty
())
{
QDomElement
property
=
doc
.
createElement
(
"metaproperty"
);
property
.
setAttribute
(
"name"
,
"meta.attr."
+
j
.
key
());
QStringList
values
=
j
.
value
();
QDomText
value
=
doc
.
createTextNode
(
values
.
at
(
0
));
if
(
values
.
count
()
>
1
)
property
.
setAttribute
(
"tool"
,
values
.
at
(
1
));
QDomElement
property
=
doc
.
createElement
(
"metaproperty"
);
property
.
setAttribute
(
"name"
,
"meta.attr."
+
j
.
key
());
QStringList
values
=
j
.
value
();
QDomText
value
=
doc
.
createTextNode
(
values
.
at
(
0
));
if
(
values
.
count
()
>
1
)
property
.
setAttribute
(
"tool"
,
values
.
at
(
1
));
property
.
appendChild
(
value
);
clip
.
appendChild
(
property
);
}
clip
.
appendChild
(
property
);
}
}
doc
.
appendChild
(
clip
);
if
(
!
m_cutZones
.
isEmpty
())
{
...
...
@@ -287,12 +287,12 @@ QDomElement DocClipBase::toXML(bool hideTemporaryProperties) const
}
QString
adata
;
if
(
!
m_analysisdata
.
isEmpty
())
{
QMapIterator
<
QString
,
QString
>
i
(
m_analysisdata
);
while
(
i
.
hasNext
())
{
i
.
next
();
//WARNING: a ? and # separator is not a good idea
adata
.
append
(
i
.
key
()
+
"?"
+
i
.
value
()
+
"#"
);
}
QMapIterator
<
QString
,
QString
>
i
(
m_analysisdata
);
while
(
i
.
hasNext
())
{
i
.
next
();
//WARNING: a ? and # separator is not a good idea
adata
.
append
(
i
.
key
()
+
"?"
+
i
.
value
()
+
"#"
);
}
}
clip
.
setAttribute
(
"analysisdata"
,
adata
);
//kDebug() << "/// CLIP XML: " << doc.toString();
...
...
@@ -301,17 +301,17 @@ QDomElement DocClipBase::toXML(bool hideTemporaryProperties) const
const
QString
DocClipBase
::
shortInfo
()
const
{
QString
info
;
if
(
m_clipType
==
AV
||
m_clipType
==
VIDEO
||
m_clipType
==
IMAGE
||
m_clipType
==
PLAYLIST
)
{
info
=
m_properties
.
value
(
"frame_size"
)
+
" "
;
if
(
m_properties
.
contains
(
"fps"
))
{
info
.
append
(
i18n
(
"%1 fps"
,
m_properties
.
value
(
"fps"
).
left
(
5
)));
}
if
(
!
info
.
simplified
().
isEmpty
())
info
.
prepend
(
" - "
);
info
=
m_properties
.
value
(
"frame_size"
)
+
" "
;
if
(
m_properties
.
contains
(
"fps"
))
{
info
.
append
(
i18n
(
"%1 fps"
,
m_properties
.
value
(
"fps"
).
left
(
5
)));
}
if
(
!
info
.
simplified
().
isEmpty
())
info
.
prepend
(
" - "
);
}
else
if
(
m_clipType
==
AUDIO
)
{
info
=
" - "
+
m_properties
.
value
(
"frequency"
)
+
i18n
(
"Hz"
);
info
=
" - "
+
m_properties
.
value
(
"frequency"
)
+
i18n
(
"Hz"
);
}
QString
tip
=
"<b>"
;
switch
(
m_clipType
)
{
...
...
@@ -390,7 +390,7 @@ void DocClipBase::addSnapMarker(const CommentedTime &marker)
if
((
it
!=
m_snapMarkers
.
end
())
&&
((
*
it
).
time
()
==
marker
.
time
()))
{
(
*
it
).
setComment
(
marker
.
comment
());
(
*
it
).
setMarkerType
(
marker
.
markerType
());
(
*
it
).
setMarkerType
(
marker
.
markerType
());
//kError() << "trying to add Snap Marker that already exists, this will cause inconsistancies with undo/redo";
}
else
{
m_snapMarkers
.
insert
(
it
,
marker
);
...
...
@@ -467,7 +467,7 @@ GenTime DocClipBase::findNextSnapMarker(const GenTime & currTime)
return
duration
();
}
QString
DocClipBase
::
markerComment
(
GenTime
t
)
const
QString
DocClipBase
::
markerComment
(
const
GenTime
&
t
)
const
{
QList
<
CommentedTime
>::
ConstIterator
itt
=
m_snapMarkers
.
begin
();
while
(
itt
!=
m_snapMarkers
.
end
())
{
...
...
@@ -518,7 +518,7 @@ void DocClipBase::deleteProducers()
}
else
{
qDeleteAll
(
m_baseTrackProducers
);
qDeleteAll
(
m_videoTrackProducers
);
qDeleteAll
(
m_videoTrackProducers
);
qDeleteAll
(
m_audioTrackProducers
);
m_replaceMutex
.
unlock
();
}
...
...
@@ -544,9 +544,9 @@ void DocClipBase::cleanupProducers()
}*/
if
(
!
isClean
())
{
qDeleteAll
(
m_toDeleteProducers
);
m_toDeleteProducers
.
clear
();
m_replaceMutex
.
unlock
();
qDeleteAll
(
m_toDeleteProducers
);
m_toDeleteProducers
.
clear
();
m_replaceMutex
.
unlock
();
}
}
...
...
@@ -602,9 +602,9 @@ void DocClipBase::setProducer(Mlt::Producer *producer, bool reset, bool readProp
else
delete
producer
;
return
;
}
else
if
(
id
.
endsWith
(
"video"
))
{
int
pos
=
0
;
// Keep compatibility with older projects where video only producers were not track specific
if
(
id
.
contains
(
'_'
))
pos
=
id
.
section
(
'_'
,
0
,
0
).
toInt
();
int
pos
=
0
;
// Keep compatibility with older projects where video only producers were not track specific
if
(
id
.
contains
(
'_'
))
pos
=
id
.
section
(
'_'
,
0
,
0
).
toInt
();
if
(
pos
>=
m_videoTrackProducers
.
count
())
{
while
(
m_videoTrackProducers
.
count
()
-
1
<
pos
)
{
m_videoTrackProducers
.
append
(
NULL
);
...
...
@@ -649,7 +649,7 @@ static double getPixelAspect(QMap<QString, QString>& props) {
int
aspectNumerator
=
props
.
value
(
"force_aspect_num"
).
toInt
();
int
aspectDenominator
=
props
.
value
(
"force_aspect_den"
).
toInt
();
if
(
aspectDenominator
!=
0
&&
width
!=
0
)
return
double
(
height
)
*
aspectNumerator
/
aspectDenominator
/
width
;
return
double
(
height
)
*
aspectNumerator
/
aspectDenominator
/
width
;
else
return
1.0
;
}
...
...
@@ -686,24 +686,24 @@ Mlt::Producer *DocClipBase::audioProducer(int track)
void
DocClipBase
::
adjustProducerProperties
(
Mlt
::
Producer
*
prod
,
const
QString
&
id
,
bool
mute
,
bool
blind
)
{
if
(
m_properties
.
contains
(
"force_aspect_num"
)
&&
m_properties
.
contains
(
"force_aspect_den"
)
&&
m_properties
.
contains
(
"frame_size"
))
prod
->
set
(
"force_aspect_ratio"
,
getPixelAspect
(
m_properties
));
if
(
m_properties
.
contains
(
"force_fps"
))
prod
->
set
(
"force_fps"
,
m_properties
.
value
(
"force_fps"
).
toDouble
());
if
(
m_properties
.
contains
(
"force_progressive"
))
prod
->
set
(
"force_progressive"
,
m_properties
.
value
(
"force_progressive"
).
toInt
());
if
(
m_properties
.
contains
(
"force_tff"
))
prod
->
set
(
"force_tff"
,
m_properties
.
value
(
"force_tff"
).
toInt
());
if
(
m_properties
.
contains
(
"threads"
))
prod
->
set
(
"threads"
,
m_properties
.
value
(
"threads"
).
toInt
());
if
(
mute
)
prod
->
set
(
"audio_index"
,
-
1
);
else
if
(
m_properties
.
contains
(
"audio_index"
))
prod
->
set
(
"audio_index"
,
m_properties
.
value
(
"audio_index"
).
toInt
());
if
(
blind
)
prod
->
set
(
"video_index"
,
-
1
);
else
if
(
m_properties
.
contains
(
"video_index"
))
prod
->
set
(
"video_index"
,
m_properties
.
value
(
"video_index"
).
toInt
());
prod
->
set
(
"id"
,
id
.
toUtf8
().
constData
());
if
(
m_properties
.
contains
(
"force_colorspace"
))
prod
->
set
(
"force_colorspace"
,
m_properties
.
value
(
"force_colorspace"
).
toInt
());
if
(
m_properties
.
contains
(
"full_luma"
))
prod
->
set
(
"set.force_full_luma"
,
m_properties
.
value
(
"full_luma"
).
toInt
());
if
(
m_properties
.
contains
(
"proxy_out"
))
{
// We have a proxy clip, make sure the proxy has same duration as original
prod
->
set
(
"length"
,
m_properties
.
value
(
"duration"
).
toInt
());
prod
->
set
(
"out"
,
m_properties
.
value
(
"proxy_out"
).
toInt
());
}
if
(
m_properties
.
contains
(
"force_aspect_num"
)
&&
m_properties
.
contains
(
"force_aspect_den"
)
&&
m_properties
.
contains
(
"frame_size"
))
prod
->
set
(
"force_aspect_ratio"
,
getPixelAspect
(
m_properties
));
if
(
m_properties
.
contains
(
"force_fps"
))
prod
->
set
(
"force_fps"
,
m_properties
.
value
(
"force_fps"
).
toDouble
());
if
(
m_properties
.
contains
(
"force_progressive"
))
prod
->
set
(
"force_progressive"
,
m_properties
.
value
(
"force_progressive"
).
toInt
());
if
(
m_properties
.
contains
(
"force_tff"
))
prod
->
set
(
"force_tff"
,
m_properties
.
value
(
"force_tff"
).
toInt
());
if
(
m_properties
.
contains
(
"threads"
))
prod
->
set
(
"threads"
,
m_properties
.
value
(
"threads"
).
toInt
());
if
(
mute
)
prod
->
set
(
"audio_index"
,
-
1
);
else
if
(
m_properties
.
contains
(
"audio_index"
))
prod
->
set
(
"audio_index"
,
m_properties
.
value
(
"audio_index"
).
toInt
());
if
(
blind
)
prod
->
set
(
"video_index"
,
-
1
);
else
if
(
m_properties
.
contains
(
"video_index"
))
prod
->
set
(
"video_index"
,
m_properties
.
value
(
"video_index"
).
toInt
());
prod
->
set
(
"id"
,
id
.
toUtf8
().
constData
());
if
(
m_properties
.
contains
(
"force_colorspace"
))
prod
->
set
(
"force_colorspace"
,
m_properties
.
value
(
"force_colorspace"
).
toInt
());
if
(
m_properties
.
contains
(
"full_luma"
))
prod
->
set
(
"set.force_full_luma"
,
m_properties
.
value
(
"full_luma"
).
toInt
());
if
(
m_properties
.
contains
(
"proxy_out"
))
{
// We have a proxy clip, make sure the proxy has same duration as original
prod
->
set
(
"length"
,
m_properties
.
value
(
"duration"
).
toInt
());
prod
->
set
(
"out"
,
m_properties
.
value
(
"proxy_out"
).
toInt
());
}
}
...
...
@@ -772,8 +772,8 @@ Mlt::Producer *DocClipBase::getCloneProducer()
if
(
m_properties
.
contains
(
"out"
))
prod
->
set
(
"out"
,
m_properties
.
value
(
"out"
).
toInt
());
}
if
(
m_clipType
==
AUDIO
)
{
prod
->
set
(
"_audioclip"
,
1
);
}
prod
->
set
(
"_audioclip"
,
1
);
}
}
return
prod
;
}
...
...
@@ -804,7 +804,7 @@ Mlt::Producer *DocClipBase::getProducer(int track)
if
(
m_baseTrackProducers
.
at
(
i
)
!=
NULL
)
break
;
if
(
i
>=
m_baseTrackProducers
.
count
())
{
// Could not find a valid producer for that clip, check in
// Could not find a valid producer for that clip, check in
return
NULL
;
}
Mlt
::
Producer
*
prod
=
cloneProducer
(
m_baseTrackProducers
.
at
(
i
));
...
...
@@ -820,8 +820,8 @@ Mlt::Producer *DocClipBase::cloneProducer(Mlt::Producer *source)
Mlt
::
Producer
*
result
=
NULL
;
QString
url
=
QString
::
fromUtf8
(
source
->
get
(
"resource"
));
if
(
url
==
"<playlist>"
||
url
==
"<tractor>"
||
url
==
"<producer>"
)
{
// Xml producer sometimes loses the correct url
url
=
m_properties
.
value
(
"resource"
);
// Xml producer sometimes loses the correct url
url
=
m_properties
.
value
(
"resource"
);
}
if
(
m_clipType
==
SLIDESHOW
||
KIO
::
NetAccess
::
exists
(
KUrl
(
url
),
KIO
::
NetAccess
::
SourceSide
,
0
))
{
result
=
new
Mlt
::
Producer
(
*
(
source
->
profile
()),
url
.
toUtf8
().
constData
());
...
...
@@ -1156,9 +1156,9 @@ void DocClipBase::setProperty(const QString &key, const QString &value)
if
(
key
==
"resource"
)
{
getFileHash
(
value
);
if
(
m_thumbProd
)
m_thumbProd
->
updateClipUrl
(
KUrl
(
value
),
m_properties
.
value
(
"file_hash"
));
//else if (key == "transparency") m_clipProducer->set("transparency", value.toInt());
//else if (key == "transparency") m_clipProducer->set("transparency", value.toInt());
}
else
if
(
key
==
"out"
)
{
setDuration
(
GenTime
(
value
.
toInt
()
+
1
,
KdenliveSettings
::
project_fps
()));
setDuration
(
GenTime
(
value
.
toInt
()
+
1
,
KdenliveSettings
::
project_fps
()));
}
else
if
(
key
==
"colour"
)
{
setProducerProperty
(
"colour"
,
value
.
toUtf8
().
data
());
...
...
@@ -1252,22 +1252,24 @@ bool DocClipBase::isPlaceHolder() const
return
m_placeHolder
;
}
void
DocClipBase
::
addCutZone
(
int
in
,
int
out
,
QString
desc
)
void
DocClipBase
::
addCutZone
(
int
in
,
int
out
,
const
QString
&
desc
)
{
CutZoneInfo
info
;
info
.
zone
=
QPoint
(
in
,
out
);
info
.
description
=
desc
;
for
(
int
i
=
0
;
i
<
m_cutZones
.
count
();
++
i
)
for
(
int
i
=
0
;
i
<
m_cutZones
.
count
();
++
i
)
{
if
(
m_cutZones
.
at
(
i
).
zone
==
info
.
zone
)
{
return
;
}
}
m_cutZones
.
append
(
info
);
}