Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Heiko Becker
kdenlive
Commits
9afab23a
Commit
9afab23a
authored
Apr 11, 2019
by
Nicolas Carion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix project loading with bin effects
parent
81658caa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
src/bin/projectclip.cpp
src/bin/projectclip.cpp
+18
-12
src/bin/projectclip.h
src/bin/projectclip.h
+5
-2
src/bin/projectitemmodel.cpp
src/bin/projectitemmodel.cpp
+1
-0
No files found.
src/bin/projectclip.cpp
View file @
9afab23a
...
...
@@ -27,10 +27,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "doc/kdenlivedoc.h"
#include "doc/kthumb.h"
#include "effects/effectstack/model/effectstackmodel.hpp"
#include "jobs/audiothumbjob.hpp"
#include "jobs/jobmanager.h"
#include "jobs/loadjob.hpp"
#include "jobs/thumbjob.hpp"
#include "jobs/audiothumbjob.hpp"
#include "kdenlivesettings.h"
#include "lib/audio/audioStreamInfo.h"
#include "mltcontroller/clipcontroller.h"
...
...
@@ -111,11 +111,15 @@ std::shared_ptr<ProjectClip> ProjectClip::construct(const QString &id, const QIc
{
std
::
shared_ptr
<
ProjectClip
>
self
(
new
ProjectClip
(
id
,
thumb
,
model
,
producer
));
baseFinishConstruct
(
self
);
self
->
m_effectStack
->
importEffects
(
producer
,
PlaylistState
::
Disabled
,
true
);
model
->
loadSubClips
(
id
,
self
->
getPropertiesFromPrefix
(
QStringLiteral
(
"kdenlive:clipzone."
)));
return
self
;
}
void
ProjectClip
::
importEffects
(
const
std
::
shared_ptr
<
Mlt
::
Producer
>
&
producer
)
{
m_effectStack
->
importEffects
(
producer
,
PlaylistState
::
Disabled
,
true
);
}
ProjectClip
::
ProjectClip
(
const
QString
&
id
,
const
QDomElement
&
description
,
const
QIcon
&
thumb
,
const
std
::
shared_ptr
<
ProjectItemModel
>
&
model
)
:
AbstractProjectItem
(
AbstractProjectItem
::
ClipItem
,
id
,
model
)
,
ClipController
(
id
)
...
...
@@ -194,14 +198,14 @@ QString ProjectClip::getXmlProperty(const QDomElement &producer, const QString &
return
value
;
}
void
ProjectClip
::
updateAudioThumbnail
(
QList
<
double
>
audioLevels
)
void
ProjectClip
::
updateAudioThumbnail
(
QList
<
double
>
audioLevels
)
{
audioFrameCache
=
audioLevels
;
m_audioThumbCreated
=
true
;
if
(
auto
ptr
=
m_model
.
lock
())
{
emit
std
::
static_pointer_cast
<
ProjectItemModel
>
(
ptr
)
->
refreshAudioThumbs
(
m_binId
);
}
qDebug
()
<<
" * ** * YOP AUDIO LEF CHANGED"
;
qDebug
()
<<
" * ** * YOP AUDIO LEF CHANGED"
;
updateTimelineClips
({
TimelineModel
::
AudioLevelsRole
});
}
...
...
@@ -547,7 +551,8 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int
}
if
(
qFuzzyCompare
(
speed
,
1.0
))
{
// we are requesting a normal speed producer
if
(
trackId
==
-
1
||
(
state
==
PlaylistState
::
VideoOnly
&&
(
m_clipType
==
ClipType
::
Color
||
m_clipType
==
ClipType
::
Image
||
m_clipType
==
ClipType
::
Text
)))
{
if
(
trackId
==
-
1
||
(
state
==
PlaylistState
::
VideoOnly
&&
(
m_clipType
==
ClipType
::
Color
||
m_clipType
==
ClipType
::
Image
||
m_clipType
==
ClipType
::
Text
)))
{
// Temporary copy, return clone of master
int
duration
=
m_masterProducer
->
time_to_frames
(
m_masterProducer
->
get
(
"kdenlive:duration"
));
return
std
::
shared_ptr
<
Mlt
::
Producer
>
(
m_masterProducer
->
cut
(
-
1
,
duration
>
0
?
duration
:
-
1
));
...
...
@@ -939,14 +944,15 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
refreshPanel
=
true
;
}
// Some properties also need to be passed to track producers
QStringList
timelineProperties
{
QStringLiteral
(
"force_aspect_ratio"
),
QStringLiteral
(
"set.force_full_luma"
),
QStringLiteral
(
"full_luma"
),
QStringLiteral
(
"threads"
),
QStringLiteral
(
"force_colorspace"
),
QStringLiteral
(
"force_tff"
),
QStringLiteral
(
"force_progressive"
),
};
QStringList
forceReloadProperties
{
QStringLiteral
(
"autorotate"
),
QStringLiteral
(
"templatetext"
),
QStringLiteral
(
"resource"
),
QStringLiteral
(
"force_fps"
),
QStringLiteral
(
"set.test_image"
),
QStringLiteral
(
"set.test_audio"
),
QStringLiteral
(
"audio_index"
),
QStringLiteral
(
"video_index"
)};
QStringList
timelineProperties
{
QStringLiteral
(
"force_aspect_ratio"
),
QStringLiteral
(
"set.force_full_luma"
),
QStringLiteral
(
"full_luma"
),
QStringLiteral
(
"threads"
),
QStringLiteral
(
"force_colorspace"
),
QStringLiteral
(
"force_tff"
),
QStringLiteral
(
"force_progressive"
),
};
QStringList
forceReloadProperties
{
QStringLiteral
(
"autorotate"
),
QStringLiteral
(
"templatetext"
),
QStringLiteral
(
"resource"
),
QStringLiteral
(
"force_fps"
),
QStringLiteral
(
"set.test_image"
),
QStringLiteral
(
"set.test_audio"
),
QStringLiteral
(
"audio_index"
),
QStringLiteral
(
"video_index"
)};
QStringList
keys
{
QStringLiteral
(
"luma_duration"
),
QStringLiteral
(
"luma_file"
),
QStringLiteral
(
"fade"
),
QStringLiteral
(
"ttl"
),
QStringLiteral
(
"softness"
),
QStringLiteral
(
"crop"
),
QStringLiteral
(
"animation"
)
};
QStringLiteral
(
"softness"
),
QStringLiteral
(
"crop"
),
QStringLiteral
(
"animation"
)};
QVector
<
int
>
updateRoles
;
while
(
i
.
hasNext
())
{
i
.
next
();
...
...
src/bin/projectclip.h
View file @
9afab23a
...
...
@@ -172,7 +172,7 @@ public:
/** Cache for every audio Frame with 10 Bytes */
/** format is frame -> channel ->bytes */
QList
<
double
>
audioFrameCache
;
QList
<
double
>
audioFrameCache
;
bool
audioThumbCreated
()
const
;
void
setWaitingStatus
(
const
QString
&
id
);
...
...
@@ -244,12 +244,15 @@ protected:
public
slots
:
/* @brief Store the audio thumbnails once computed. Note that the parameter is a value and not a reference, fill free to use it as a sink (use std::move to
* avoid copy). */
void
updateAudioThumbnail
(
QList
<
double
>
audioLevels
);
void
updateAudioThumbnail
(
QList
<
double
>
audioLevels
);
/** @brief Extract image thumbnails for timeline. */
void
slotExtractImage
(
const
QList
<
int
>
&
frames
);
/** @brief Delete the proxy file */
void
deleteProxy
();
/** @brief imports effect from a given producer */
void
importEffects
(
const
std
::
shared_ptr
<
Mlt
::
Producer
>
&
producer
);
private:
/** @brief Generate and store file hash if not available. */
const
QString
getFileHash
();
...
...
src/bin/projectitemmodel.cpp
View file @
9afab23a
...
...
@@ -647,6 +647,7 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const std::shared_ptr<Mlt:
std
::
shared_ptr
<
ProjectClip
>
new_clip
=
ProjectClip
::
construct
(
id
,
m_blankThumb
,
std
::
static_pointer_cast
<
ProjectItemModel
>
(
shared_from_this
()),
producer
);
bool
res
=
addItem
(
new_clip
,
parentId
,
undo
,
redo
);
if
(
res
)
{
new_clip
->
importEffects
(
producer
);
int
blocking
=
pCore
->
jobManager
()
->
getBlockingJobId
(
id
,
AbstractClipJob
::
LOADJOB
);
pCore
->
jobManager
()
->
startJob
<
ThumbJob
>
({
id
},
blocking
,
QString
(),
150
,
-
1
,
true
);
pCore
->
jobManager
()
->
startJob
<
AudioThumbJob
>
({
id
},
blocking
,
QString
());
...
...
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