made all keyframes editable and undoable

This commit is contained in:
itsmattkc
2018-08-20 23:35:56 +10:00
parent 33d3cc34c8
commit 263bf090b4
22 changed files with 470 additions and 156 deletions
+4
View File
@@ -89,6 +89,10 @@ void EffectControls::update_keyframes() {
ui->keyframeView->update();
}
void EffectControls::delete_selected_keyframes() {
ui->keyframeView->delete_selected_keyframes();
}
void EffectControls::show_effect_menu(bool video, bool transitions) {
video_menu = video;
transition_menu = transitions;
+1
View File
@@ -38,6 +38,7 @@ public:
void reload_clips();
void set_zoom(bool in);
bool keyframe_focus();
void delete_selected_keyframes();
double zoom;
public slots:
+7
View File
@@ -22,12 +22,19 @@
#include <QtMath>
#include <QGuiApplication>
#include <QScreen>
#include <QPainter>
long refactor_frame_number(long framenumber, double source_frame_rate, double target_frame_rate) {
if (source_frame_rate == target_frame_rate) return framenumber;
return qRound(((double)framenumber/source_frame_rate)*target_frame_rate);
}
void draw_selection_rectangle(QPainter& painter, const QRect& rect) {
painter.setPen(QColor(204, 204, 204));
painter.setBrush(QColor(0, 0, 0, 32));
painter.drawRect(rect);
}
Timeline::Timeline(QWidget *parent) :
QDockWidget(parent),
playhead(0),
+1
View File
@@ -24,6 +24,7 @@ int lerp(int a, int b, double t);
long refactor_frame_number(long framenumber, double source_frame_rate, double target_frame_rate);
int getScreenPointFromFrame(double zoom, long frame);
long getFrameFromScreenPoint(double zoom, int x);
void draw_selection_rectangle(QPainter& painter, const QRect& rect);
struct Ghost {
int clip;