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
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
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
Multimedia
Kdenlive
Commits
575506f6
Commit
575506f6
authored
Jul 30, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve subclips visual info (display zone over thumbnail), minor cleanup
parent
02920d3a
Pipeline
#6032
passed with stage
in 15 minutes and 35 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
11 deletions
+35
-11
src/bin/abstractprojectitem.cpp
src/bin/abstractprojectitem.cpp
+6
-0
src/bin/abstractprojectitem.h
src/bin/abstractprojectitem.h
+7
-1
src/bin/bin.cpp
src/bin/bin.cpp
+12
-1
src/bin/bin.h
src/bin/bin.h
+1
-1
src/bin/bincommands.cpp
src/bin/bincommands.cpp
+2
-2
src/bin/projectclip.cpp
src/bin/projectclip.cpp
+1
-0
src/bin/projectsubclip.cpp
src/bin/projectsubclip.cpp
+6
-5
src/bin/projectsubclip.h
src/bin/projectsubclip.h
+0
-1
No files found.
src/bin/abstractprojectitem.cpp
View file @
575506f6
...
...
@@ -136,9 +136,15 @@ QVariant AbstractProjectItem::getData(DataType type) const
case
DataDuration
:
data
=
QVariant
(
m_duration
);
break
;
case
ParentDuration
:
data
=
QVariant
(
m_parentDuration
);
break
;
case
DataInPoint
:
data
=
QVariant
(
m_inPoint
);
break
;
case
DataOutPoint
:
data
=
QVariant
(
m_outPoint
);
break
;
case
DataDate
:
data
=
QVariant
(
m_date
);
break
;
...
...
src/bin/abstractprojectitem.h
View file @
575506f6
...
...
@@ -121,10 +121,14 @@ public:
IconOverlay
,
// item type (clip, subclip, folder)
ItemTypeRole
,
// Duration of the clip
// Duration of the clip
as displayabe string
DataDuration
,
// Duration of the clip in frames
ParentDuration
,
// Inpoint of the subclip (0 for clips)
DataInPoint
,
// Outpoint of the subclip (0 for clips)
DataOutPoint
,
// If there is a running job, which type
JobType
,
// Current progress of the job
...
...
@@ -201,7 +205,9 @@ protected:
QString
m_description
;
QIcon
m_thumbnail
;
QString
m_duration
;
int
m_parentDuration
;
int
m_inPoint
;
int
m_outPoint
;
QDateTime
m_date
;
QString
m_binId
;
uint
m_usage
;
...
...
src/bin/bin.cpp
View file @
575506f6
...
...
@@ -285,6 +285,17 @@ public:
QIcon
warning
=
QIcon
::
fromTheme
(
QStringLiteral
(
"process-stop"
));
warning
.
paint
(
painter
,
r2
);
}
}
else
{
// Subclip, overlay zone rect
QRect
zoneRect
=
m_thumbRect
;
int
duration
=
index
.
data
(
AbstractProjectItem
::
ParentDuration
).
toInt
();
double
factor
=
((
double
)
m_thumbRect
.
width
())
/
duration
;
int
zoneIn
=
index
.
data
(
AbstractProjectItem
::
DataInPoint
).
toInt
();
int
zoneOut
=
index
.
data
(
AbstractProjectItem
::
DataOutPoint
).
toInt
()
-
duration
;
zoneRect
.
adjust
(
0
,
zoneRect
.
height
()
*
0.96
,
0
,
0
);
painter
->
fillRect
(
zoneRect
,
Qt
::
darkGreen
);
zoneRect
.
adjust
(
zoneIn
*
factor
,
0
,
zoneOut
*
factor
,
0
);
painter
->
fillRect
(
zoneRect
,
Qt
::
green
);
}
}
else
{
// Folder or Folder Up items
...
...
@@ -2470,7 +2481,7 @@ void Bin::renameSubClipCommand(const QString &id, const QString &newName, const
m_doc
->
commandStack
()
->
push
(
command
);
}
void
Bin
::
renameSubClip
(
const
QString
&
id
,
const
QString
&
newName
,
const
QString
&
oldName
,
int
in
,
int
out
)
void
Bin
::
renameSubClip
(
const
QString
&
id
,
const
QString
&
newName
,
int
in
,
int
out
)
{
std
::
shared_ptr
<
ProjectClip
>
clip
=
m_itemModel
->
getClipByBinID
(
id
);
if
(
!
clip
)
{
...
...
src/bin/bin.h
View file @
575506f6
...
...
@@ -223,7 +223,7 @@ public:
/** @brief Build a rename subclip command. */
void
renameSubClipCommand
(
const
QString
&
id
,
const
QString
&
newName
,
const
QString
&
oldName
,
int
in
,
int
out
);
/** @brief Rename a clip zone (subclip). */
void
renameSubClip
(
const
QString
&
id
,
const
QString
&
newName
,
const
QString
&
oldName
,
int
in
,
int
out
);
void
renameSubClip
(
const
QString
&
id
,
const
QString
&
newName
,
int
in
,
int
out
);
/** @brief Returns current project's timecode. */
Timecode
projectTimecode
()
const
;
/** @brief Trigger timecode format refresh where needed. */
...
...
src/bin/bincommands.cpp
View file @
575506f6
...
...
@@ -77,12 +77,12 @@ RenameBinSubClipCommand::RenameBinSubClipCommand(Bin *bin, QString clipId, QStri
// virtual
void
RenameBinSubClipCommand
::
undo
()
{
m_bin
->
renameSubClip
(
m_clipId
,
m_oldName
,
m_
newName
,
m_
in
,
m_out
);
m_bin
->
renameSubClip
(
m_clipId
,
m_oldName
,
m_in
,
m_out
);
}
// virtual
void
RenameBinSubClipCommand
::
redo
()
{
m_bin
->
renameSubClip
(
m_clipId
,
m_newName
,
m_
oldName
,
m_
in
,
m_out
);
m_bin
->
renameSubClip
(
m_clipId
,
m_newName
,
m_in
,
m_out
);
}
EditClipCommand
::
EditClipCommand
(
Bin
*
bin
,
QString
id
,
QMap
<
QString
,
QString
>
oldparams
,
QMap
<
QString
,
QString
>
newparams
,
bool
doIt
,
QUndoCommand
*
parent
)
...
...
src/bin/projectclip.cpp
View file @
575506f6
...
...
@@ -88,6 +88,7 @@ ProjectClip::ProjectClip(const QString &id, const QIcon &thumb, const std::share
m_name
=
clipName
();
m_duration
=
getStringDuration
();
m_inPoint
=
0
;
m_outPoint
=
0
;
m_date
=
date
;
m_description
=
ClipController
::
description
();
if
(
m_clipType
==
ClipType
::
Audio
)
{
...
...
src/bin/projectsubclip.cpp
View file @
575506f6
...
...
@@ -37,10 +37,11 @@ ProjectSubClip::ProjectSubClip(const QString &id, const std::shared_ptr<ProjectC
const
QString
&
timecode
,
const
QString
&
name
)
:
AbstractProjectItem
(
AbstractProjectItem
::
SubClipItem
,
id
,
model
)
,
m_masterClip
(
parent
)
,
m_out
(
out
)
{
m_inPoint
=
in
;
m_outPoint
=
out
;
m_duration
=
timecode
;
m_parentDuration
=
m_masterClip
->
frameDuration
();
QPixmap
pix
(
64
,
36
);
pix
.
fill
(
Qt
::
lightGray
);
m_thumbnail
=
QIcon
(
pix
);
...
...
@@ -103,7 +104,7 @@ GenTime ProjectSubClip::duration() const
QPoint
ProjectSubClip
::
zone
()
const
{
return
{
m_inPoint
,
m_out
};
return
{
m_inPoint
,
m_out
Point
};
}
std
::
shared_ptr
<
ProjectClip
>
ProjectSubClip
::
clipAt
(
int
ix
)
...
...
@@ -117,13 +118,13 @@ QDomElement ProjectSubClip::toXml(QDomDocument &document, bool, bool)
QDomElement
sub
=
document
.
createElement
(
QStringLiteral
(
"subclip"
));
sub
.
setAttribute
(
QStringLiteral
(
"id"
),
m_masterClip
->
AbstractProjectItem
::
clipId
());
sub
.
setAttribute
(
QStringLiteral
(
"in"
),
m_inPoint
);
sub
.
setAttribute
(
QStringLiteral
(
"out"
),
m_out
);
sub
.
setAttribute
(
QStringLiteral
(
"out"
),
m_out
Point
);
return
sub
;
}
std
::
shared_ptr
<
ProjectSubClip
>
ProjectSubClip
::
subClip
(
int
in
,
int
out
)
{
if
(
m_inPoint
==
in
&&
m_out
==
out
)
{
if
(
m_inPoint
==
in
&&
m_out
Point
==
out
)
{
return
std
::
static_pointer_cast
<
ProjectSubClip
>
(
shared_from_this
());
}
return
std
::
shared_ptr
<
ProjectSubClip
>
();
...
...
@@ -151,7 +152,7 @@ bool ProjectSubClip::rename(const QString &name, int column)
return
false
;
}
// Rename folder
auto
*
command
=
new
RenameBinSubClipCommand
(
pCore
->
bin
(),
m_masterClip
->
clipId
(),
name
,
m_name
,
m_inPoint
,
m_out
);
auto
*
command
=
new
RenameBinSubClipCommand
(
pCore
->
bin
(),
m_masterClip
->
clipId
(),
name
,
m_name
,
m_inPoint
,
m_out
Point
);
pCore
->
currentDoc
()
->
commandStack
()
->
push
(
command
);
return
true
;
}
...
...
src/bin/projectsubclip.h
View file @
575506f6
...
...
@@ -86,7 +86,6 @@ public:
private:
std
::
shared_ptr
<
ProjectClip
>
m_masterClip
;
int
m_out
;
private
slots
:
void
gotThumb
(
int
pos
,
const
QImage
&
img
);
...
...
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