some cleanup

This commit is contained in:
itsmattkc
2019-04-09 13:15:15 +10:00
parent b1bbcca88b
commit 433ae494ad
14 changed files with 45 additions and 80 deletions
+1 -1
View File
@@ -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"),
+3
View File
@@ -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;i<nb_samples;i+=4) {
double timecode = timecode_start+(interval*i);
+15 -9
View File
@@ -20,8 +20,10 @@
#include "fillleftrighteffect.h"
#define FILL_TYPE_LEFT 0
#define FILL_TYPE_RIGHT 1
enum FillType {
FILL_TYPE_LEFT,
FILL_TYPE_RIGHT
};
FillLeftRightEffect::FillLeftRightEffect(Clip* c, const EffectMeta *em) : Effect(c, em) {
EffectRow* type_row = new EffectRow(this, tr("Type"));
@@ -36,14 +38,18 @@ void FillLeftRightEffect::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;i<nb_samples;i+=4) {
if (fill_type->GetValueAt(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;i<nb_samples;i++) {
if (fill_type->GetValueAt(timecode_start+(interval*i)) == FILL_TYPE_LEFT) {
samples[0][i] = samples[1][i];
} else {
samples[1][i] = samples[0][i];
}
}
}
}
+2
View File
@@ -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;
+3
View File
@@ -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;i<nb_samples;i++) {
+3
View File
@@ -43,6 +43,9 @@ void VolumeEffect::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;i<nb_samples;i++) {
+1 -1
View File
@@ -180,7 +180,7 @@ void OliveGlobal::SetNativeStyling(QWidget *w)
w->setPalette(w->style()->standardPalette());
w->setStyle(QStyleFactory::create("windowsvista"));
#else
Q_UNUSED(w);
Q_UNUSED(w)
#endif
}
-7
View File
@@ -1,7 +0,0 @@
#include "node.h"
Node::Node() :
max_inputs_(INT_MAX),
max_outputs_(INT_MAX)
{
}
-31
View File
@@ -1,31 +0,0 @@
#ifndef NODE_H
#define NODE_H
#include <QObject>
#include <QVector>
class NodeInput {
public:
NodeInput();
private:
QString name_;
};
class Node : public QObject
{
Q_OBJECT
public:
Node();
private:
int max_inputs_;
QVector<Node*> inputs_;
int max_outputs_;
QVector<Node*> outputs_;
};
#endif // NODE_H
+2 -2
View File
@@ -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
+1 -6
View File
@@ -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() {
-9
View File
@@ -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;i<t->ClipCount();i++) {
if (t->GetClip(i).get() == this) {
found = true;
break;
}
}
track_ = t;
}
+6 -1
View File
@@ -1167,6 +1167,7 @@ ClipPtr Sequence::SplitClip(ComboAction *ca, bool transitions, Clip* pre, long f
bool Sequence::SplitSelection(ComboAction *ca, QVector<Selection> selections)
{
bool ret = false;
QVector<Clip*> all_clips = GetAllClips();
for (int i=0;i<all_clips.size();i++) {
@@ -1187,6 +1188,10 @@ bool Sequence::SplitSelection(ComboAction *ca, QVector<Selection> selections)
}
}
if (SplitClipAtPositions(ca, c, points, false)) {
ret = true;
}
}
return ret;
}
+8 -13
View File
@@ -402,7 +402,7 @@ void TimelineView::insert_clips(ComboAction* ca, Sequence* s) {
}
}
QVector<Clip*> sequence_clips = sequence()->GetAllClips();
QVector<Clip*> sequence_clips = s->GetAllClips();
for (int i=0;i<sequence_clips.size();i++) {
Clip* c = sequence_clips.at(i);
// don't split any clips that are moving
@@ -415,7 +415,7 @@ void TimelineView::insert_clips(ComboAction* ca, Sequence* s) {
}
if (!found) {
if (c->timeline_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;i<ParentTimeline()->ghosts.size();i++) {
@@ -444,13 +444,13 @@ void TimelineView::insert_clips(ComboAction* ca, Sequence* s) {
g.out += second_ripple_length;
}
QVector<Selection> sequence_selections = sequence()->Selections();
QVector<Selection> sequence_selections = s->Selections();
for (int i=0;i<sequence_selections.size();i++) {
Selection& s = sequence_selections[i];
s.set_in(s.in() + second_ripple_length);
s.set_out(s.out() + second_ripple_length);
}
sequence()->SetSelections(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;