From fdd19350932d648cfd1186b1697a83102ee59e7a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 2 Sep 2018 20:18:54 +1000 Subject: [PATCH] tweaks for gcc --- effects/effect.cpp | 4 ++-- effects/effect.h | 4 ++-- panels/effectcontrols.cpp | 6 +++--- panels/project.cpp | 11 ++++++++++- panels/timeline.cpp | 4 ++-- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/effects/effect.cpp b/effects/effect.cpp index 501375677..f1ab3cff7 100644 --- a/effects/effect.cpp +++ b/effects/effect.cpp @@ -358,7 +358,7 @@ Effect* Effect::copy(Clip* c) { void Effect::process_shader(double) {} void Effect::process_coords(double, GLTextureCoords&) {} -const GLuint Effect::process_superimpose(double) {return 0;} +GLuint Effect::process_superimpose(double) {return 0;} void Effect::process_audio(double, double, quint8*, int, int) {} SuperimposeEffect::SuperimposeEffect(Clip* c, int t, int i) : Effect(c, t, i), texture(NULL) { @@ -375,7 +375,7 @@ void SuperimposeEffect::close() { deleteTexture(); } -const GLuint SuperimposeEffect::process_superimpose(double timecode) { +GLuint SuperimposeEffect::process_superimpose(double timecode) { bool recreate_texture = false; int width = parent_clip->getWidth(); int height = parent_clip->getHeight(); diff --git a/effects/effect.h b/effects/effect.h index 9964cead9..2c223a26e 100644 --- a/effects/effect.h +++ b/effects/effect.h @@ -211,7 +211,7 @@ public: virtual void process_shader(double timecode); virtual void process_coords(double timecode, GLTextureCoords& coords); - virtual const GLuint process_superimpose(double timecode); + virtual GLuint process_superimpose(double timecode); virtual void process_audio(double timecode_start, double timecode_end, quint8* samples, int nb_bytes, int channel_count); public slots: void field_changed(); @@ -233,7 +233,7 @@ public: SuperimposeEffect(Clip* c, int t, int i); virtual void open(); virtual void close(); - virtual const GLuint process_superimpose(double timecode); + virtual GLuint process_superimpose(double timecode); virtual void redraw(double timecode); protected: QImage img; diff --git a/panels/effectcontrols.cpp b/panels/effectcontrols.cpp index dfcd2aec1..7d438dff3 100644 --- a/panels/effectcontrols.cpp +++ b/panels/effectcontrols.cpp @@ -22,8 +22,8 @@ EffectControls::EffectControls(QWidget *parent) : QDockWidget(parent), - ui(new Ui::EffectControls), - zoom(1) + zoom(1), + ui(new Ui::EffectControls) { ui->setupUi(this); init_effects(); @@ -62,7 +62,7 @@ void EffectControls::menu_select(QAction* q) { TimelineAction* ta = new TimelineAction(); for (int i=0;iget_clip(selected_clips.at(i)); - if (c->track < 0 == video_menu) { + if ((c->track < 0) == video_menu) { if (transition_menu) { if (c->opening_transition == NULL) { ta->add_transition(sequence, selected_clips.at(i), q->data().toInt(), TA_OPENING_TRANSITION); diff --git a/panels/project.cpp b/panels/project.cpp index 09c784a56..64928d8b1 100644 --- a/panels/project.cpp +++ b/panels/project.cpp @@ -528,7 +528,16 @@ int get_type_from_tree(QTreeWidgetItem* item) { } void Project::delete_media(QTreeWidgetItem* item) { - delete get_media_from_tree(item); + int type = get_type_from_tree(item); + void* media = get_media_from_tree(item); + switch (type) { + case MEDIA_TYPE_FOOTAGE: + delete static_cast(media); + break; + case MEDIA_TYPE_SEQUENCE: + delete static_cast(media); + break; + } } void Project::delete_clips_using_selected_media() { diff --git a/panels/timeline.cpp b/panels/timeline.cpp index 526a7f1a8..381db8cb5 100644 --- a/panels/timeline.cpp +++ b/panels/timeline.cpp @@ -54,9 +54,9 @@ Timeline::Timeline(QWidget *parent) : trim_in_point(false), splitting(false), importing(false), + zoomChanged(false), ui(new Ui::Timeline), - last_frame(0), - zoomChanged(false) + last_frame(0) { default_track_height = (QGuiApplication::primaryScreen()->logicalDotsPerInch() / 96) * TRACK_DEFAULT_HEIGHT;