Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
25ef3917
Commit
25ef3917
authored
Jul 13, 2021
by
Jean-Baptiste Mardelle
Browse files
cleaner remap ui
parent
feffd144
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/dialogs/timeremap.cpp
View file @
25ef3917
...
...
@@ -317,14 +317,14 @@ void RemapView::mouseMoveEvent(QMouseEvent *event)
if
(
m_moveKeyframeMode
==
CursorMove
||
(
event
->
y
()
<
2
*
m_lineHeight
))
{
if
(
pos
!=
m_position
)
{
slotSetPosition
(
pos
,
true
);
emit
seekToPos
(
pos
);
emit
seekToPos
(
pos
,
-
1
);
}
}
if
(
m_moveKeyframeMode
==
CursorMoveBottom
||
(
event
->
y
()
>
m_bottomView
))
{
pos
=
GenTime
(
m_remapLink
->
anim_get_double
(
"map"
,
pos
)).
frames
(
pCore
->
getCurrentFps
());
if
(
pos
!=
getKeyframePosition
())
{
slotSetPosition
(
pos
,
true
);
emit
seekToPos
2
(
getKeyframePosition
());
emit
seekToPos
(
-
1
,
getKeyframePosition
());
}
}
return
;
...
...
@@ -491,8 +491,7 @@ void RemapView::mousePressEvent(QMouseEvent *event)
m_moveKeyframeMode
=
TopMove
;
if
(
KdenliveSettings
::
keyframeseek
())
{
slotSetPosition
(
m_currentKeyframeOriginal
.
first
,
true
);
emit
seekToPos
(
m_currentKeyframeOriginal
.
first
);
emit
seekToPos2
(
getKeyframePosition
());
emit
seekToPos
(
m_currentKeyframeOriginal
.
first
,
getKeyframePosition
());
}
else
{
update
();
}
...
...
@@ -538,8 +537,7 @@ void RemapView::mousePressEvent(QMouseEvent *event)
m_moveKeyframeMode
=
BottomMove
;
if
(
KdenliveSettings
::
keyframeseek
())
{
slotSetPosition
(
m_currentKeyframeOriginal
.
first
,
true
);
emit
seekToPos
(
m_currentKeyframeOriginal
.
first
);
emit
seekToPos2
(
getKeyframePosition
());
emit
seekToPos
(
m_currentKeyframeOriginal
.
first
,
getKeyframePosition
());
}
else
{
update
();
}
...
...
@@ -556,7 +554,7 @@ void RemapView::mousePressEvent(QMouseEvent *event)
if
(
pos
!=
m_position
)
{
m_moveKeyframeMode
=
CursorMove
;
slotSetPosition
(
pos
,
true
);
emit
seekToPos
(
pos
);
emit
seekToPos
(
pos
,
-
1
);
update
();
}
}
else
if
(
event
->
y
()
>
m_bottomView
)
{
...
...
@@ -565,7 +563,7 @@ void RemapView::mousePressEvent(QMouseEvent *event)
if
(
topPos
!=
m_position
)
{
m_moveKeyframeMode
=
CursorMoveBottom
;
slotSetPosition
(
topPos
,
true
);
emit
seekToPos
2
(
pos
);
emit
seekToPos
(
-
1
,
pos
);
update
();
}
}
...
...
@@ -624,8 +622,7 @@ void RemapView::goNext()
if
(
i
.
key
()
>
m_position
)
{
m_currentKeyframe
=
{
i
.
key
(),
i
.
value
()};
slotSetPosition
(
i
.
key
());
emit
seekToPos
(
i
.
key
());
emit
seekToPos2
(
getKeyframePosition
());
emit
seekToPos
(
i
.
key
(),
getKeyframePosition
());
std
::
pair
<
double
,
double
>
speeds
=
getSpeed
(
m_currentKeyframe
);
emit
selectedKf
(
m_currentKeyframe
,
speeds
);
break
;
...
...
@@ -647,8 +644,7 @@ void RemapView::goPrev()
}
m_currentKeyframe
=
{
it
.
key
(),
it
.
value
()};
slotSetPosition
(
m_currentKeyframe
.
first
);
emit
seekToPos
(
m_currentKeyframe
.
first
);
emit
seekToPos2
(
getKeyframePosition
());
emit
seekToPos
(
m_currentKeyframe
.
first
,
getKeyframePosition
());
std
::
pair
<
double
,
double
>
speeds
=
getSpeed
(
m_currentKeyframe
);
emit
selectedKf
(
m_currentKeyframe
,
speeds
);
previousFound
=
true
;
...
...
@@ -658,8 +654,7 @@ void RemapView::goPrev()
// We are after the last keyframe
m_currentKeyframe
=
{
m_keyframes
.
lastKey
(),
m_keyframes
.
value
(
m_keyframes
.
lastKey
())};
slotSetPosition
(
m_currentKeyframe
.
first
);
emit
seekToPos
(
m_currentKeyframe
.
first
);
emit
seekToPos2
(
getKeyframePosition
());
emit
seekToPos
(
m_currentKeyframe
.
first
,
getKeyframePosition
());
std
::
pair
<
double
,
double
>
speeds
=
getSpeed
(
m_currentKeyframe
);
emit
selectedKf
(
m_currentKeyframe
,
speeds
);
}
...
...
@@ -1149,11 +1144,13 @@ void TimeRemap::selectedClip(int cid)
m_seekConnection3
=
connect
(
pCore
->
getMonitor
(
Kdenlive
::
ClipMonitor
),
&
Monitor
::
seekPosition
,
[
this
](
int
pos
)
{
m_view
->
slotSetPosition
(
pos
);
});
m_seekConnection1
=
connect
(
m_view
,
&
RemapView
::
seekToPos
,
[
this
](
int
pos
)
{
pCore
->
getMonitor
(
Kdenlive
::
ClipMonitor
)
->
requestSeek
(
pos
);
});
connect
(
m_view
,
&
RemapView
::
seekToPos2
,
[
this
](
int
pos
)
{
pCore
->
getMonitor
(
Kdenlive
::
ProjectMonitor
)
->
requestSeek
(
pos
+
m_view
->
m_startPos
);
m_seekConnection1
=
connect
(
m_view
,
&
RemapView
::
seekToPos
,
[
this
](
int
topPos
,
int
bottomPos
)
{
if
(
topPos
>
-
1
&&
source_seek
->
isChecked
())
{
pCore
->
getMonitor
(
Kdenlive
::
ClipMonitor
)
->
requestSeek
(
topPos
);
}
if
(
bottomPos
>
-
1
&&
output_seek
->
isChecked
())
{
pCore
->
getMonitor
(
Kdenlive
::
ProjectMonitor
)
->
requestSeek
(
bottomPos
+
m_view
->
m_startPos
);
}
});
m_seekConnection2
=
connect
(
pCore
->
getMonitor
(
Kdenlive
::
ProjectMonitor
),
&
Monitor
::
seekPosition
,
[
this
](
int
pos
)
{
qDebug
()
<<
"=== PROJECT SEEK: "
<<
pos
<<
", START: "
<<
m_view
->
m_startPos
<<
", MAPPED: "
<<
GenTime
(
m_view
->
m_remapLink
->
anim_get_double
(
"map"
,
pos
-
m_view
->
m_startPos
)).
frames
(
pCore
->
getCurrentFps
());
...
...
src/dialogs/timeremap.h
View file @
25ef3917
...
...
@@ -116,8 +116,7 @@ private:
std
::
pair
<
double
,
double
>
getSpeed
(
std
::
pair
<
int
,
int
>
kf
);
signals:
void
seekToPos
(
int
);
void
seekToPos2
(
int
);
void
seekToPos
(
int
,
int
);
void
selectedKf
(
std
::
pair
<
int
,
int
>
,
std
::
pair
<
double
,
double
>
);
/** When the cursor position changes inform parent if we are on a keyframe or not. */
void
atKeyframe
(
bool
);
...
...
src/ui/timeremap_ui.ui
View file @
25ef3917
...
...
@@ -7,23 +7,65 @@
<x>
0
</x>
<y>
0
</y>
<width>
319
</width>
<height>
200
</height>
<height>
327
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<property
name=
"leftMargin"
>
<number>
6
</number>
</property>
<property
name=
"verticalSpacing"
>
<number>
0
</number>
</property>
<item
row=
"0"
column=
"0"
colspan=
"5"
>
<item
row=
"0"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_6"
>
<property
name=
"text"
>
<string>
Source clip
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"2"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"source_seek"
>
<property
name=
"text"
>
<string>
Seek monitor
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
colspan=
"4"
>
<layout
class=
"QVBoxLayout"
name=
"remapLayout"
/>
</item>
<item
row=
"1"
column=
"2"
>
<item
row=
"2"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
Output
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"2"
colspan=
"2"
>
<widget
class=
"QCheckBox"
name=
"output_seek"
>
<property
name=
"text"
>
<string>
Seek monitor
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QToolButton"
name=
"button_prev"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
<property
name=
"icon"
>
<iconset
theme=
"go-previous"
>
<normaloff>
../../../../.designer/backup
</normaloff>
../../../../.designer/backup
</iconset>
</property>
<property
name=
"autoRaise"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QToolButton"
name=
"button_next"
>
<property
name=
"text"
>
<string>
...
</string>
...
...
@@ -37,7 +79,21 @@
</property>
</widget>
</item>
<item
row=
"1"
column=
"4"
>
<item
row=
"3"
column=
"2"
>
<widget
class=
"QToolButton"
name=
"button_add"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
<property
name=
"icon"
>
<iconset
theme=
"list-add"
>
<normaloff>
../../../../.designer/backup
</normaloff>
../../../../.designer/backup
</iconset>
</property>
<property
name=
"autoRaise"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"3"
column=
"3"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
...
...
@@ -50,7 +106,7 @@
</property>
</spacer>
</item>
<item
row=
"
2
"
column=
"0"
colspan=
"
5
"
>
<item
row=
"
4
"
column=
"0"
colspan=
"
4
"
>
<widget
class=
"QGroupBox"
name=
"time_box"
>
<property
name=
"title"
>
<string>
Time
</string>
...
...
@@ -79,48 +135,7 @@
</layout>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QToolButton"
name=
"button_prev"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
<property
name=
"icon"
>
<iconset
theme=
"go-previous"
>
<normaloff>
../../../../.designer/backup
</normaloff>
../../../../.designer/backup
</iconset>
</property>
<property
name=
"autoRaise"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"1"
column=
"3"
>
<widget
class=
"QToolButton"
name=
"button_add"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
<property
name=
"icon"
>
<iconset
theme=
"list-add"
>
<normaloff>
../../../../.designer/backup
</normaloff>
../../../../.designer/backup
</iconset>
</property>
<property
name=
"autoRaise"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
39
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"3"
column=
"0"
colspan=
"5"
>
<item
row=
"5"
column=
"0"
colspan=
"4"
>
<widget
class=
"QGroupBox"
name=
"speed_box"
>
<property
name=
"title"
>
<string>
Speed
</string>
...
...
@@ -157,7 +172,20 @@
</layout>
</widget>
</item>
<item
row=
"5"
column=
"0"
colspan=
"5"
>
<item
row=
"6"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
39
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"7"
column=
"0"
colspan=
"4"
>
<widget
class=
"QCheckBox"
name=
"move_next"
>
<property
name=
"text"
>
<string>
Preserve speed of next keyframes
</string>
...
...
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