From 433ae494adbdb2779bd0089fe0f596c7b25ef3bd Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 9 Apr 2019 13:15:15 +1000 Subject: [PATCH] some cleanup --- dialogs/preferencesdialog.cpp | 2 +- effects/internal/audionoiseeffect.cpp | 3 +++ effects/internal/fillleftrighteffect.cpp | 24 +++++++++++------- effects/internal/paneffect.cpp | 2 ++ effects/internal/toneeffect.cpp | 3 +++ effects/internal/volumeeffect.cpp | 3 +++ global/global.cpp | 2 +- nodes/node.cpp | 7 ------ nodes/node.h | 31 ------------------------ olive.pro | 4 +-- panels/effectcontrols.cpp | 7 +----- timeline/clip.cpp | 9 ------- timeline/sequence.cpp | 7 +++++- ui/timelineview.cpp | 21 ++++++---------- 14 files changed, 45 insertions(+), 80 deletions(-) delete mode 100644 nodes/node.cpp delete mode 100644 nodes/node.h diff --git a/dialogs/preferencesdialog.cpp b/dialogs/preferencesdialog.cpp index f70a369b1..6fd5d609c 100644 --- a/dialogs/preferencesdialog.cpp +++ b/dialogs/preferencesdialog.cpp @@ -232,7 +232,7 @@ OCIO::ConstConfigRcPtr PreferencesDialog::TestOCIOConfig(const QString &url) // Check whether OCIO can load it OCIO::ConstConfigRcPtr config; try { - config = OCIO::Config::CreateFromFile(ocio_config_file->text().toUtf8()); + config = OCIO::Config::CreateFromFile(url.toUtf8()); } catch (OCIO::Exception& e) { QMessageBox::critical(this, tr("OpenColorIO Config Error"), diff --git a/effects/internal/audionoiseeffect.cpp b/effects/internal/audionoiseeffect.cpp index 91194f1c0..2ee515a22 100644 --- a/effects/internal/audionoiseeffect.cpp +++ b/effects/internal/audionoiseeffect.cpp @@ -41,6 +41,9 @@ void AudioNoiseEffect::process_audio(double timecode_start, int nb_samples, int channel_count, int type) { + + Q_UNUSED(type) + double interval = (timecode_end - timecode_start)/nb_samples; for (int i=0;iGetValueAt(timecode_start+(interval*i)) == FILL_TYPE_LEFT) { - samples[i+1] = samples[i+3]; - samples[i] = samples[i+2]; - } else { - samples[i+3] = samples[i+1]; - samples[i+2] = samples[i]; + + if (channel_count == 2) { + for (int i=0;iGetValueAt(timecode_start+(interval*i)) == FILL_TYPE_LEFT) { + samples[0][i] = samples[1][i]; + } else { + samples[1][i] = samples[0][i]; + } } } } diff --git a/effects/internal/paneffect.cpp b/effects/internal/paneffect.cpp index 3902bef29..72a988f5c 100644 --- a/effects/internal/paneffect.cpp +++ b/effects/internal/paneffect.cpp @@ -43,6 +43,8 @@ void PanEffect::process_audio(double timecode_start, int channel_count, int type) { + Q_UNUSED(type) + // This has no effect on mono sources if (channel_count < 2) { return; diff --git a/effects/internal/toneeffect.cpp b/effects/internal/toneeffect.cpp index c7b23e69c..914d8ef78 100644 --- a/effects/internal/toneeffect.cpp +++ b/effects/internal/toneeffect.cpp @@ -55,6 +55,9 @@ void ToneEffect::process_audio(double timecode_start, int nb_samples, int channel_count, int type) { + + Q_UNUSED(type) + double interval = (timecode_end - timecode_start)/nb_samples; for (int i=0;isetPalette(w->style()->standardPalette()); w->setStyle(QStyleFactory::create("windowsvista")); #else - Q_UNUSED(w); + Q_UNUSED(w) #endif } diff --git a/nodes/node.cpp b/nodes/node.cpp deleted file mode 100644 index c74e03749..000000000 --- a/nodes/node.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "node.h" - -Node::Node() : - max_inputs_(INT_MAX), - max_outputs_(INT_MAX) -{ -} diff --git a/nodes/node.h b/nodes/node.h deleted file mode 100644 index 752a55b34..000000000 --- a/nodes/node.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef NODE_H -#define NODE_H - -#include -#include - -class NodeInput { -public: - NodeInput(); - -private: - QString name_; - -}; - -class Node : public QObject -{ - Q_OBJECT -public: - Node(); - -private: - int max_inputs_; - QVector inputs_; - - int max_outputs_; - QVector outputs_; - -}; - -#endif // NODE_H diff --git a/olive.pro b/olive.pro index 1238fe7a6..fe3afc66e 100644 --- a/olive.pro +++ b/olive.pro @@ -48,6 +48,8 @@ system("which git") { CONFIG += c++11 +QMAKE_CXXFLAGS += -Wno-reorder + SOURCES += \ main.cpp \ ui/mainwindow.cpp \ @@ -188,7 +190,6 @@ SOURCES += \ panels/nodeeditor.cpp \ ui/nodeview.cpp \ nodes/medianode.cpp \ - nodes/node.cpp \ ui/nodeui.cpp \ panels/effectspanel.cpp @@ -335,7 +336,6 @@ HEADERS += \ panels/nodeeditor.h \ ui/nodeview.h \ nodes/medianode.h \ - nodes/node.h \ ui/nodeui.h \ panels/effectspanel.h diff --git a/panels/effectcontrols.cpp b/panels/effectcontrols.cpp index da37c1ef0..1c92954f8 100644 --- a/panels/effectcontrols.cpp +++ b/panels/effectcontrols.cpp @@ -117,12 +117,7 @@ void EffectControls::menu_select(QAction* q) { } } olive::undo_stack.push(ca); - if (effect_menu_type == EFFECT_TYPE_TRANSITION) { - update_ui(true); - } else { - Reload(); - panel_sequence_viewer->viewer_widget()->frame_update(); - } + update_ui(true); } void EffectControls::update_keyframes() { diff --git a/timeline/clip.cpp b/timeline/clip.cpp index 822847e0e..2dcdd9f76 100644 --- a/timeline/clip.cpp +++ b/timeline/clip.cpp @@ -418,15 +418,6 @@ Track *Clip::track() void Clip::set_track(Track *t) { - // Ensure this clip has already been added to this track - bool found = false; - for (int i=0;iClipCount();i++) { - if (t->GetClip(i).get() == this) { - found = true; - break; - } - } - track_ = t; } diff --git a/timeline/sequence.cpp b/timeline/sequence.cpp index bb72dc772..1a1d17fe3 100644 --- a/timeline/sequence.cpp +++ b/timeline/sequence.cpp @@ -1167,6 +1167,7 @@ ClipPtr Sequence::SplitClip(ComboAction *ca, bool transitions, Clip* pre, long f bool Sequence::SplitSelection(ComboAction *ca, QVector selections) { + bool ret = false; QVector all_clips = GetAllClips(); for (int i=0;i selections) } } - + if (SplitClipAtPositions(ca, c, points, false)) { + ret = true; + } } + + return ret; } diff --git a/ui/timelineview.cpp b/ui/timelineview.cpp index c18d30af5..91356b676 100644 --- a/ui/timelineview.cpp +++ b/ui/timelineview.cpp @@ -402,7 +402,7 @@ void TimelineView::insert_clips(ComboAction* ca, Sequence* s) { } } - QVector sequence_clips = sequence()->GetAllClips(); + QVector sequence_clips = s->GetAllClips(); for (int i=0;itimeline_in() < earliest_new_point && c->timeline_out() > earliest_new_point) { - sequence()->SplitClipAtPositions(ca, c, {earliest_new_point}, true); + s->SplitClipAtPositions(ca, c, {earliest_new_point}, true); } // determine if we should close the gap the old clips left behind @@ -429,13 +429,13 @@ void TimelineView::insert_clips(ComboAction* ca, Sequence* s) { long ripple_length = (latest_new_point - earliest_new_point); - sequence()->Ripple(ca, earliest_new_point, ripple_length, ignore_clips); + s->Ripple(ca, earliest_new_point, ripple_length, ignore_clips); if (ripple_old_point) { // works for moving later clips earlier but not earlier to later long second_ripple_length = (earliest_old_point - latest_old_point); - sequence()->Ripple(ca, latest_old_point, second_ripple_length, ignore_clips); + s->Ripple(ca, latest_old_point, second_ripple_length, ignore_clips); if (earliest_old_point < earliest_new_point) { for (int i=0;ighosts.size();i++) { @@ -444,13 +444,13 @@ void TimelineView::insert_clips(ComboAction* ca, Sequence* s) { g.out += second_ripple_length; } - QVector sequence_selections = sequence()->Selections(); + QVector sequence_selections = s->Selections(); for (int i=0;iSetSelections(sequence_selections); + s->SetSelections(sequence_selections); } } } @@ -694,7 +694,8 @@ void TimelineView::mousePressEvent(QMouseEvent *event) { link->track()->DeselectArea(link->timeline_in(), link->timeline_out()); } - long s_in, s_out; + long s_in = 0; + long s_out = 0; // select the transition only if (ParentTimeline()->transition_select == kTransitionOpening @@ -2504,9 +2505,6 @@ void TimelineView::mouseMoveEvent(QMouseEvent *event) { // used to determine whether we the cursor found a trim point or not bool found = false; - // used to determine whether the cursor is within the rect of a clip - bool cursor_contains_clip = false; - // used to determine how close the cursor is to a trim point // (and more specifically, whether another point is closer or not) long closeness = LONG_MAX; @@ -2532,9 +2530,6 @@ void TimelineView::mouseMoveEvent(QMouseEvent *event) { if (ParentTimeline()->cursor_frame >= c->timeline_in() && ParentTimeline()->cursor_frame <= c->timeline_out()) { - // acknowledge that we are hovering over a clip - cursor_contains_clip = true; - // start a timer to show a tooltip about this clip tooltip_timer.start(); tooltip_clip = c;