diff --git a/effects/internal/voideffect.cpp b/effects/internal/voideffect.cpp index 70762cff2..867c08bc5 100644 --- a/effects/internal/voideffect.cpp +++ b/effects/internal/voideffect.cpp @@ -18,6 +18,16 @@ VoidEffect::VoidEffect(Clip *c, const QString& n) : Effect(c, nullptr) { EffectRow* row = add_row(tr("Missing Effect"), false, false); row->add_widget(new QLabel(display_name)); container->setText(display_name); + + void_meta.type = EFFECT_TYPE_EFFECT; + meta = &void_meta; +} + +Effect *VoidEffect::copy(Clip *c) { + Effect* copy = new VoidEffect(c, name); + copy->set_enabled(is_enabled()); + copy_field_keyframes(copy); + return copy; } void VoidEffect::load(QXmlStreamReader &stream) { diff --git a/effects/internal/voideffect.h b/effects/internal/voideffect.h index 340030998..0376b6a73 100644 --- a/effects/internal/voideffect.h +++ b/effects/internal/voideffect.h @@ -11,11 +11,14 @@ class VoidEffect : public Effect { public: - VoidEffect(Clip* c, const QString& n); - void load(QXmlStreamReader &stream) override; - void save(QXmlStreamWriter &stream) override; + VoidEffect(Clip* c, const QString& n); + + virtual Effect* copy(Clip* c) override; + virtual void load(QXmlStreamReader &stream) override; + virtual void save(QXmlStreamWriter &stream) override; private: - QByteArray bytes; + QByteArray bytes; + EffectMeta void_meta; }; #endif // VOIDEFFECT_H diff --git a/mainwindow.h b/mainwindow.h index f74655704..bd83a9436 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -42,8 +42,8 @@ public slots: void toggle_bool_action(); protected: - void closeEvent(QCloseEvent *); - void paintEvent(QPaintEvent *event); + virtual void closeEvent(QCloseEvent *) override; + virtual void paintEvent(QPaintEvent *event) override; private slots: void clear_undo_stack(); diff --git a/panels/viewer.cpp b/panels/viewer.cpp index 999bb882c..6b014db3b 100644 --- a/panels/viewer.cpp +++ b/panels/viewer.cpp @@ -618,6 +618,7 @@ void Viewer::setup_ui() { current_timecode_container_layout->setSpacing(0); current_timecode_container_layout->setMargin(0); current_timecode_slider = new LabelSlider(); + current_timecode_container_layout->addWidget(current_timecode_slider); lower_control_layout->addWidget(current_timecode_container); QWidget* playback_controls = new QWidget(); diff --git a/project/clip.cpp b/project/clip.cpp index 57041333d..e76e162cd 100644 --- a/project/clip.cpp +++ b/project/clip.cpp @@ -227,7 +227,7 @@ double Clip::getMediaFrameRate() { } void Clip::recalculateMaxLength() { - if (sequence != nullptr) { + if (this->sequence != nullptr) { double fr = this->sequence->frame_rate; fr /= speed; diff --git a/project/effect.h b/project/effect.h index fc045bda9..6db358d8e 100644 --- a/project/effect.h +++ b/project/effect.h @@ -165,7 +165,7 @@ public: virtual void refresh(); - Effect* copy(Clip* c); + virtual Effect* copy(Clip* c); void copy_field_keyframes(Effect *e); virtual void load(QXmlStreamReader& stream); diff --git a/ui/timelinewidget.cpp b/ui/timelinewidget.cpp index bf0ee5e55..a3e848631 100644 --- a/ui/timelinewidget.cpp +++ b/ui/timelinewidget.cpp @@ -1187,6 +1187,7 @@ void TimelineWidget::init_ghosts() { } // used for trim ops + c->recalculateMaxLength(); g.media_length = c->getMaximumLength(); } for (int i=0;iselections.size();i++) { diff --git a/ui/viewerwindow.cpp b/ui/viewerwindow.cpp index d988a86ed..ca4b47c41 100644 --- a/ui/viewerwindow.cpp +++ b/ui/viewerwindow.cpp @@ -3,6 +3,12 @@ #include #include #include +#include +#include + +#include + +#include "mainwindow.h" ViewerWindow::ViewerWindow(QOpenGLContext *share) : QOpenGLWindow(share), @@ -12,6 +18,8 @@ ViewerWindow::ViewerWindow(QOpenGLContext *share) : { fullscreen_msg_timer.setInterval(2000); connect(&fullscreen_msg_timer, SIGNAL(timeout()), this, SLOT(fullscreen_msg_timeout())); + + installEventFilter(mainWindow); } void ViewerWindow::set_texture(GLuint t, double iar, QMutex* imutex) { diff --git a/ui/viewerwindow.h b/ui/viewerwindow.h index cdd099d07..573687736 100644 --- a/ui/viewerwindow.h +++ b/ui/viewerwindow.h @@ -12,11 +12,11 @@ public: ViewerWindow(QOpenGLContext* share); void set_texture(GLuint t, double iar, QMutex *imutex); protected: - void keyPressEvent(QKeyEvent*); - void mousePressEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); + virtual void keyPressEvent(QKeyEvent*) override; + virtual void mousePressEvent(QMouseEvent*) override; + virtual void mouseMoveEvent(QMouseEvent*) override; private: - void paintGL(); + virtual void paintGL() override; GLuint texture; double ar; QMutex* mutex;