many changes, mostly to export

This commit is contained in:
itsmattkc
2018-06-06 03:30:22 -07:00
parent 81bf111037
commit 0ea7c43e53
26 changed files with 404 additions and 206 deletions
+24 -11
View File
@@ -21,6 +21,27 @@ EffectControls::EffectControls(QWidget *parent) :
clip = NULL;
set_clip(NULL);
effects_menu = new QMenu(this);
for (int i=0;i<VIDEO_EFFECT_COUNT;i++) {
QAction* action = new QAction();
action->setText(video_effect_names.at(i));
action->setData(i);
effects_menu->addAction(action);
}
effects_menu->addSeparator();
for (int i=0;i<AUDIO_EFFECT_COUNT;i++) {
QAction* action = new QAction();
action->setText(audio_effect_names.at(i));
action->setData(i);
effects_menu->addAction(action);
}
connect(effects_menu, SIGNAL(triggered(QAction*)), this, SLOT(menu_select(QAction*)));
}
void EffectControls::menu_select(QAction* q) {
clip->effects.append(create_effect(q->data().toInt(), clip));
set_clip(clip);
}
EffectControls::~EffectControls()
@@ -30,29 +51,21 @@ EffectControls::~EffectControls()
void EffectControls::on_pushButton_clicked()
{
QMenu effects_menu(this);
for (int i=0;i<video_effect_names.size();i++) {
effects_menu.addAction(video_effect_names.at(i));
}
effects_menu.addSeparator();
for (int i=0;i<audio_effect_names.size();i++) {
effects_menu.addAction(audio_effect_names.at(i));
}
effects_menu.exec(QCursor::pos());
effects_menu->exec(QCursor::pos());
}
void EffectControls::set_clip(Clip* c) {
// clear ui->scrollAreaWidgetContents
if (clip != NULL) {
for (int i=0;i<clip->effects.size();i++) {
clip->effects.at(i)->container->setParent(NULL);
clip->effects.at(i)->container->setParent(NULL);
}
}
ui->pushButton->setEnabled(c != NULL);
if (c != NULL) {
for (int i=0;i<c->effects.size();i++) {
static_cast<QVBoxLayout*>(ui->scrollAreaWidgetContents->layout())->insertWidget(i, c->effects.at(i)->container);
static_cast<QVBoxLayout*>(ui->scrollAreaWidgetContents->layout())->insertWidget(i, c->effects.at(i)->container);
}
}
clip = c;
+3
View File
@@ -4,6 +4,7 @@
#include <QDockWidget>
struct Clip;
class QMenu;
namespace Ui {
class EffectControls;
@@ -20,10 +21,12 @@ public:
private slots:
void on_pushButton_clicked();
void menu_select(QAction* q);
private:
Ui::EffectControls *ui;
Clip* clip;
QMenu* effects_menu;
};
#endif // EFFECTCONTROLS_H
+9 -1
View File
@@ -71,6 +71,7 @@ void Timeline::seek(long p) {
c.frame_sample_index = 0;
}
clear_cache(true, true);
audio_bytes_written = 0;
switch_audio_cache = true;
reading_audio_cache_A = false;
@@ -146,7 +147,7 @@ void Timeline::repaint_timeline() {
}
ui->video_area->update();
ui->audio_area->update();
if (last_frame != playhead) {
if (last_frame != playhead) {
panel_viewer->viewer_widget->update();
last_frame = playhead;
}
@@ -319,3 +320,10 @@ void Timeline::on_toolSlipButton_toggled(bool checked)
tool = TIMELINE_TOOL_SLIP;
}
}
void Timeline::on_snappingButton_toggled(bool checked)
{
snapping = checked;
qDebug() << "clips vector size:" << sizeof(Clip) * sequence->clip_count();
}
+2
View File
@@ -137,6 +137,8 @@ private slots:
void on_toolSlipButton_toggled(bool checked);
void on_snappingButton_toggled(bool checked);
private:
Ui::Timeline *ui;
QVector<QPushButton*> tool_buttons;