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
261
Issues
261
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
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
9dd4a529
Commit
9dd4a529
authored
May 03, 2016
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add button to toggle use of timeline zone in insert editing (next to bigger/smaller tracks)
Ref: T1961
parent
2627e885
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
5 deletions
+49
-5
src/doc/kdenlivedoc.cpp
src/doc/kdenlivedoc.cpp
+4
-0
src/doc/kdenlivedoc.h
src/doc/kdenlivedoc.h
+1
-0
src/kdenlivesettings.kcfg
src/kdenlivesettings.kcfg
+6
-1
src/timeline/customruler.cpp
src/timeline/customruler.cpp
+9
-2
src/timeline/customruler.h
src/timeline/customruler.h
+2
-0
src/timeline/customtrackview.cpp
src/timeline/customtrackview.cpp
+8
-2
src/timeline/timeline.cpp
src/timeline/timeline.cpp
+17
-0
src/timeline/timeline.h
src/timeline/timeline.h
+2
-0
No files found.
src/doc/kdenlivedoc.cpp
View file @
9dd4a529
...
...
@@ -1600,3 +1600,7 @@ void KdenliveDoc::getFileProperties(const QDomElement &xml, const QString &clipI
pCore
->
producerQueue
()
->
getFileProperties
(
xml
,
clipId
,
imageHeight
,
replaceProducer
);
}
void
KdenliveDoc
::
doAddAction
(
const
QString
&
name
,
QAction
*
a
)
{
pCore
->
window
()
->
actionCollection
()
->
addAction
(
name
,
a
);
}
src/doc/kdenlivedoc.h
View file @
9dd4a529
...
...
@@ -158,6 +158,7 @@ public:
void
getFileProperties
(
const
QDomElement
&
xml
,
const
QString
&
clipId
,
int
imageHeight
,
bool
replaceProducer
=
true
);
/** @brief Returns true if the profile file has changed. */
bool
profileChanged
(
const
QString
&
profile
)
const
;
void
doAddAction
(
const
QString
&
name
,
QAction
*
a
);
private:
QUrl
m_url
;
...
...
src/kdenlivesettings.kcfg
View file @
9dd4a529
...
...
@@ -198,7 +198,7 @@
<label>
Vertical drag in timeline ruler zooms.
</label>
<default>
false
</default>
</entry>
<entry
name=
"trackheight"
type=
"Int"
>
<label>
Tracks height in pixel.
</label>
<default>
0
</default>
...
...
@@ -208,6 +208,11 @@
<label>
Automatically split audio and video.
</label>
<default>
false
</default>
</entry>
<entry
name=
"useTimelineZoneToEdit"
type=
"Bool"
>
<label>
Use timeline zone as in/out editing points.
</label>
<default>
false
</default>
</entry>
</group>
<group
name=
"sdl"
>
...
...
src/timeline/customruler.cpp
View file @
9dd4a529
...
...
@@ -93,6 +93,8 @@ CustomRuler::CustomRuler(const Timecode &tc, CustomTrackView *parent) :
m_goMenu
=
m_contextMenu
->
addMenu
(
i18n
(
"Go To"
));
connect
(
m_goMenu
,
SIGNAL
(
triggered
(
QAction
*
)),
this
,
SLOT
(
slotGoToGuide
(
QAction
*
)));
setMouseTracking
(
true
);
m_zoneBG
=
palette
().
color
(
QPalette
::
Highlight
);
m_zoneBG
.
setAlpha
(
KdenliveSettings
::
useTimelineZoneToEdit
()
?
180
:
60
);
}
void
CustomRuler
::
updateProjectFps
(
const
Timecode
&
t
)
...
...
@@ -396,7 +398,7 @@ void CustomRuler::paintEvent(QPaintEvent *e)
// Draw zone background
const
int
zoneStart
=
(
int
)(
m_zoneStart
*
m_factor
);
const
int
zoneEnd
=
(
int
)(
m_zoneEnd
*
m_factor
);
p
.
fillRect
(
zoneStart
-
m_offset
,
LABEL_SIZE
+
2
,
zoneEnd
-
zoneStart
,
MAX_HEIGHT
-
LABEL_SIZE
-
2
,
palette
().
color
(
QPalette
::
Highlight
)
);
p
.
fillRect
(
zoneStart
-
m_offset
,
LABEL_SIZE
+
2
,
zoneEnd
-
zoneStart
,
MAX_HEIGHT
-
LABEL_SIZE
-
2
,
m_zoneBG
);
double
f
,
fend
;
const
int
offsetmax
=
((
paintRect
.
right
()
+
m_offset
)
/
FRAME_SIZE
+
1
)
*
FRAME_SIZE
;
...
...
@@ -471,7 +473,7 @@ void CustomRuler::paintEvent(QPaintEvent *e)
pa
.
setPoints
(
4
,
zoneEnd
-
m_offset
-
FONT_WIDTH
/
2
,
LABEL_SIZE
+
2
,
zoneEnd
-
m_offset
,
LABEL_SIZE
+
2
,
zoneEnd
-
m_offset
,
MAX_HEIGHT
-
1
,
zoneEnd
-
m_offset
-
FONT_WIDTH
/
2
,
MAX_HEIGHT
-
1
);
p
.
drawPolyline
(
pa
);
}
// draw pointer
const
int
value
=
m_view
->
cursorPos
()
*
m_factor
-
m_offset
;
QPolygon
pa
(
3
);
...
...
@@ -488,4 +490,9 @@ void CustomRuler::paintEvent(QPaintEvent *e)
}
void
CustomRuler
::
activateZone
()
{
m_zoneBG
.
setAlpha
(
KdenliveSettings
::
useTimelineZoneToEdit
()
?
180
:
60
);
update
();
}
src/timeline/customruler.h
View file @
9dd4a529
...
...
@@ -49,6 +49,7 @@ public:
int
offset
()
const
;
void
updateProjectFps
(
const
Timecode
&
t
);
void
updateFrameSize
();
void
activateZone
();
protected:
void
paintEvent
(
QPaintEvent
*
/*e*/
);
...
...
@@ -69,6 +70,7 @@ private:
int
m_offset
;
/** @brief the position of the seek point */
int
m_headPosition
;
QColor
m_zoneBG
;
RULER_MOVE
m_moveCursor
;
QMenu
*
m_contextMenu
;
QAction
*
m_editGuide
;
...
...
src/timeline/customtrackview.cpp
View file @
9dd4a529
...
...
@@ -8069,13 +8069,19 @@ void CustomTrackView::insertZone(TimelineMode::EditMode sceneMode, const QString
return
;
}
if
(
binZone
.
isNull
())
return
;
QPoint
timelineZone
=
m_document
->
zone
();
QPoint
timelineZone
;
if
(
KdenliveSettings
::
useTimelineZoneToEdit
())
timelineZone
=
m_document
->
zone
();
else
{
timelineZone
.
setX
(
seekPosition
());
timelineZone
.
setY
(
-
1
);
}
ItemInfo
info
;
int
binLength
=
binZone
.
y
()
-
binZone
.
x
();
int
timelineLength
=
timelineZone
.
y
()
-
timelineZone
.
x
();
info
.
startPos
=
GenTime
(
timelineZone
.
x
(),
m_document
->
fps
());
info
.
cropStart
=
GenTime
(
binZone
.
x
(),
m_document
->
fps
());
info
.
endPos
=
info
.
startPos
+
GenTime
(
timelineLength
>
binLength
?
binLength
:
timeline
Length
,
m_document
->
fps
());
info
.
endPos
=
info
.
startPos
+
GenTime
(
KdenliveSettings
::
useTimelineZoneToEdit
()
?
timelineLength
:
bin
Length
,
m_document
->
fps
());
info
.
cropDuration
=
info
.
endPos
-
info
.
startPos
;
info
.
track
=
m_selectedTrack
;
QUndoCommand
*
addCommand
=
new
QUndoCommand
();
...
...
src/timeline/timeline.cpp
View file @
9dd4a529
...
...
@@ -103,6 +103,16 @@ Timeline::Timeline(KdenliveDoc *doc, const QList<QAction *> &actions, bool *ok,
connect
(
butLarge
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
slotVerticalZoomUp
()));
sizeLayout
->
addWidget
(
butLarge
);
QToolButton
*
enableZone
=
new
QToolButton
(
this
);
QAction
*
ac
=
new
QAction
(
KoIconUtils
::
themedIcon
(
QStringLiteral
(
"measure"
)),
i18n
(
"Use Timeline Zone for Insert"
),
this
);
enableZone
->
setAutoRaise
(
true
);
ac
->
setCheckable
(
true
);
ac
->
setChecked
(
KdenliveSettings
::
useTimelineZoneToEdit
());
enableZone
->
setDefaultAction
(
ac
);
connect
(
ac
,
&
QAction
::
toggled
,
this
,
&
Timeline
::
slotEnableZone
);
sizeLayout
->
addWidget
(
enableZone
);
m_doc
->
doAddAction
(
QStringLiteral
(
"use_timeline_zone_in_edit"
),
ac
);
QHBoxLayout
*
tracksLayout
=
new
QHBoxLayout
;
tracksLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
tracksLayout
->
setSpacing
(
0
);
...
...
@@ -866,6 +876,7 @@ void Timeline::updatePalette()
}
}
}
m_ruler
->
activateZone
();
}
void
Timeline
::
updateHeaders
()
...
...
@@ -1654,3 +1665,9 @@ void Timeline::switchTrackTarget()
}
}
}
void
Timeline
::
slotEnableZone
(
bool
enable
)
{
KdenliveSettings
::
setUseTimelineZoneToEdit
(
enable
);
m_ruler
->
activateZone
();
}
src/timeline/timeline.h
View file @
9dd4a529
...
...
@@ -229,6 +229,8 @@ private slots:
void
slotUpdateVerticalScroll
(
int
min
,
int
max
);
/** @brief Update the track label showing applied effects.*/
void
slotUpdateTrackEffectState
(
int
);
/** @brief Toggle use of timeline zone for editing.*/
void
slotEnableZone
(
bool
enable
);
signals:
void
mousePosition
(
int
);
...
...
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