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
74072058
Commit
74072058
authored
May 17, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When importing a project file as clip, deduce the empty seek space
BUG: #407081
parent
43ae922a
Pipeline
#3601
passed with stage
in 21 minutes and 26 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
17 deletions
+30
-17
src/doc/kdenlivedoc.cpp
src/doc/kdenlivedoc.cpp
+1
-0
src/jobs/loadjob.cpp
src/jobs/loadjob.cpp
+29
-3
src/monitor/monitor.cpp
src/monitor/monitor.cpp
+0
-13
src/monitor/monitor.h
src/monitor/monitor.h
+0
-1
No files found.
src/doc/kdenlivedoc.cpp
View file @
74072058
...
...
@@ -112,6 +112,7 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, QString projectFolder, QUndoGroup *und
m_documentProperties
[
QStringLiteral
(
"enableTimelineZone"
)]
=
QLatin1Char
(
'0'
);
m_documentProperties
[
QStringLiteral
(
"zonein"
)]
=
QLatin1Char
(
'0'
);
m_documentProperties
[
QStringLiteral
(
"zoneout"
)]
=
QStringLiteral
(
"75"
);
m_documentProperties
[
QStringLiteral
(
"seekOffset"
)]
=
QString
::
number
(
TimelineModel
::
seekDuration
);
// Load properties
QMapIterator
<
QString
,
QString
>
i
(
properties
);
...
...
src/jobs/loadjob.cpp
View file @
74072058
...
...
@@ -132,7 +132,7 @@ std::shared_ptr<Mlt::Producer> LoadJob::loadPlaylist(QString &resource)
if
(
pCore
->
getCurrentProfile
()
->
isCompatible
(
xmlProfile
.
get
()))
{
// We can use the "xml" producer since profile is the same (using it with different profiles corrupts the project.
// Beware that "consumer" currently crashes on audio mixes!
resource
.
prepend
(
QStringLiteral
(
"xml:"
));
//
resource.prepend(QStringLiteral("xml:"));
}
else
{
// This is currently crashing so I guess we'd better reject it for now
qDebug
()
<<
"////// ERROR, INCOMPATIBLE PROFILE: "
<<
resource
;
...
...
@@ -140,7 +140,7 @@ std::shared_ptr<Mlt::Producer> LoadJob::loadPlaylist(QString &resource)
// path.prepend(QStringLiteral("consumer:"));
}
pCore
->
getCurrentProfile
()
->
set_explicit
(
1
);
return
std
::
make_shared
<
Mlt
::
Producer
>
(
pCore
->
getCurrentProfile
()
->
profile
(),
nullptr
,
resource
.
toUtf8
().
constData
());
return
std
::
make_shared
<
Mlt
::
Producer
>
(
pCore
->
getCurrentProfile
()
->
profile
(),
"xml"
,
resource
.
toUtf8
().
constData
());
}
void
LoadJob
::
checkProfile
(
const
QString
&
clipId
,
const
QDomElement
&
xml
,
const
std
::
shared_ptr
<
Mlt
::
Producer
>
&
producer
)
...
...
@@ -267,9 +267,35 @@ bool LoadJob::startJob()
case
ClipType
::
QText
:
m_producer
=
loadResource
(
m_resource
,
QStringLiteral
(
"qtext:"
));
break
;
case
ClipType
::
Playlist
:
case
ClipType
::
Playlist
:
{
m_producer
=
loadPlaylist
(
m_resource
);
if
(
m_resource
.
endsWith
(
QLatin1String
(
".kdenlive"
)))
{
QFile
f
(
m_resource
);
QDomDocument
doc
;
doc
.
setContent
(
&
f
,
false
);
f
.
close
();
QDomElement
pl
=
doc
.
documentElement
().
firstChildElement
(
QStringLiteral
(
"playlist"
));
if
(
!
pl
.
isNull
())
{
QString
offsetData
=
Xml
::
getXmlProperty
(
pl
,
QStringLiteral
(
"kdenlive:docproperties.seekOffset"
));
if
(
offsetData
.
isEmpty
()
&&
Xml
::
getXmlProperty
(
pl
,
QStringLiteral
(
"kdenlive:docproperties.version"
))
==
QLatin1String
(
"0.98"
))
{
offsetData
=
QStringLiteral
(
"30000"
);
}
if
(
!
offsetData
.
isEmpty
())
{
bool
ok
=
false
;
int
offset
=
offsetData
.
toInt
(
&
ok
);
qDebug
()
<<
" / / /GET OFFSET DATA: "
<<
offset
;
if
(
ok
)
{
offset
=
m_producer
->
get_playtime
()
-
offset
-
1
;
m_producer
->
set
(
"out"
,
offset
-
1
);
m_producer
->
set
(
"length"
,
offset
);
}
}
}
else
{
qDebug
()
<<
":_______
\n
______<nEMPTY PLAYLIST
\n
----"
;
}
}
break
;
}
case
ClipType
::
SlideShow
:
default:
if
(
!
service
.
isEmpty
())
{
...
...
src/monitor/monitor.cpp
View file @
74072058
...
...
@@ -1217,19 +1217,6 @@ void Monitor::slotForwardOneFrame(int diff)
m_glMonitor
->
seek
(
m_glMonitor
->
getCurrentPos
()
+
diff
);
}
void
Monitor
::
seekCursor
(
int
pos
)
{
Q_UNUSED
(
pos
)
// Deprecated should not be used, instead requestSeek
/*if (m_ruler->slotNewValue(pos)) {
m_timePos->setValue(pos);
checkOverlay(pos);
if (m_id != Kdenlive::ClipMonitor) {
emit renderPosition(pos);
}
}*/
}
void
Monitor
::
adjustRulerSize
(
int
length
,
const
std
::
shared_ptr
<
MarkerListModel
>
&
markerModel
)
{
if
(
m_controller
!=
nullptr
)
{
...
...
src/monitor/monitor.h
View file @
74072058
...
...
@@ -237,7 +237,6 @@ private:
void
buildSplitEffect
(
Mlt
::
Producer
*
original
);
private
slots
:
Q_DECL_DEPRECATED
void
seekCursor
(
int
pos
);
void
slotSetThumbFrame
();
void
slotSaveZone
();
void
slotSeek
();
...
...
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