code cleanup

This commit is contained in:
itsmattkc
2018-07-20 19:06:57 +01:00
parent 4a6e261fe2
commit 8845ba0577
20 changed files with 296 additions and 125 deletions
+16 -7
View File
@@ -5,27 +5,36 @@
#include "ui/viewerwidget.h"
#include "ui/collapsiblewidget.h"
#include "effects/effects.h"
#include "panels/project.h"
#include "project/undo.h"
#include <QCheckBox>
#include <QGridLayout>
Effect::Effect(Clip* c) : parent_clip(c) {
type = EFFECT_TYPE_INVALID;
}
void Effect::setup_effect(int t, int i) {
type = t;
id = i;
Effect::Effect(Clip* c, int t, int i) : parent_clip(c), type(t), id(i) {
container = new CollapsibleWidget();
if (type == EFFECT_TYPE_VIDEO) {
container->setText(video_effect_names[i]);
} else if (type == EFFECT_TYPE_AUDIO) {
container->setText(audio_effect_names[i]);
}
connect(container->enabled_check, SIGNAL(clicked(bool)), this, SLOT(checkbox_command()));
connect(container->enabled_check, SIGNAL(clicked(bool)), this, SLOT(field_changed()));
ui = new QWidget();
ui_layout = new QGridLayout();
ui->setLayout(ui_layout);
container->setContents(ui);
}
void Effect::field_changed() {
panel_viewer->viewer_widget->update();
project_changed = true;
}
void Effect::checkbox_command() {
CheckboxCommand* c = new CheckboxCommand(static_cast<QCheckBox*>(sender()));
undo_stack.push(c);
}
bool Effect::is_enabled() {