Commit 17b0bc04 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix various timeremap inconsistencies

parent 14c98d92
This diff is collapsed.
......@@ -76,6 +76,7 @@ public slots:
void updateInPos(int pos);
void updateOutPos(int pos);
void slotSetPosition(int pos);
void slotSetBottomPosition(int pos);
void addKeyframe();
void goNext();
void goPrev();
......@@ -84,11 +85,13 @@ public slots:
void toggleMoveNext(bool moveNext);
void reloadProducer();
void centerCurrentKeyframe();
void centerCurrentTopKeyframe();
private:
enum MOVEMODE {NoMove, TopMove, BottomMove, CursorMove, CursorMoveBottom};
int m_duration;
int m_position;
int m_bottomPosition;
double m_scale;
QColor m_colSelected;
QColor m_colKeyframe;
......@@ -97,6 +100,7 @@ private:
int m_lineHeight;
double m_zoomFactor;
double m_zoomStart;
/** @brief the keyframes for the remap effect. first value is output, second is source time */
QMap<int, int>m_keyframes;
QMap<int, int>m_keyframesOrigin;
std::shared_ptr<ProjectClip> m_clip;
......@@ -121,12 +125,15 @@ private:
int m_clickEnd;
int m_offset;
QMap <int,int>m_selectedKeyframes;
int getClosestKeyframe(int pos, bool bottomKeyframe = false) const;
QMap<int,int>m_previousSelection;
std::pair<int,int> getClosestKeyframe(int pos, bool bottomKeyframe = false) const;
std::pair<double,double> getSpeed(std::pair<int,int>kf);
std::pair<int,int> getRange(std::pair<int,int>kf);
signals:
void seekToPos(int, int);
void selectedKf(std::pair<int,int>, std::pair<double,double>);
void updateSpeeds(std::pair<double,double>);
/** When the cursor position changes inform parent if we are on a keyframe or not. */
void atKeyframe(bool);
void updateKeyframes(bool resize);
......
......@@ -17,85 +17,14 @@
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Source clip</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<layout class="QVBoxLayout" name="remapLayout"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<item row="6" column="1" colspan="3">
<widget class="QCheckBox" name="frame_blending">
<property name="text">
<string>Output</string>
<string>Frame blending</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QToolButton" name="button_prev">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_add">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_next">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_center">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="align-horizontal-center">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>28</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="4" column="0" colspan="3">
<item row="4" column="0" colspan="4">
<widget class="QFrame" name="info_frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
......@@ -186,18 +115,22 @@
</layout>
</widget>
</item>
<item row="5" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="2" column="1">
<widget class="QToolButton" name="button_center">
<property name="text">
<string>...</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>39</height>
</size>
<property name="icon">
<iconset theme="align-horizontal-center">
<normaloff>.</normaloff>.</iconset>
</property>
</spacer>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="4">
<layout class="QVBoxLayout" name="remapLayout"/>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="pitch_compensate">
......@@ -212,10 +145,75 @@
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="QCheckBox" name="frame_blending">
<item row="7" column="3">
<widget class="QToolButton" name="button_del">
<property name="text">
<string>Frame blending</string>
<string>...</string>
</property>
<property name="icon">
<iconset theme="edit-delete">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Source clip</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QToolButton" name="button_prev">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_add">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_next">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>28</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Output</string>
</property>
</widget>
</item>
......@@ -229,14 +227,42 @@
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QToolButton" name="button_del">
<item row="5" 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="2" column="2" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="button_center_top">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="edit-delete">
<normaloff>.</normaloff>.</iconset>
<iconset theme="align-horizontal-center"/>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment