various improvements

This commit is contained in:
itsmattkc
2018-09-12 17:40:16 +10:00
parent cc8056842c
commit 706238590b
11 changed files with 133 additions and 68 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ ToneEffect::ToneEffect(Clip* c) : Effect(c, EFFECT_TYPE_AUDIO, AUDIO_TONE_EFFECT
amount_val = add_row("Amount:")->add_field(EFFECT_FIELD_DOUBLE);
amount_val->set_double_minimum_value(0);
amount_val->set_double_maximum_value(100);
amount_val->set_double_default_value(80);
amount_val->set_double_default_value(25);
mix_val = add_row("Mix:")->add_field(EFFECT_FIELD_BOOL);
mix_val->set_bool_value(true);
+31
View File
@@ -0,0 +1,31 @@
IDI_ICON1 ICON DISCARDABLE "olive.ico"
#include <windows.h>
#include "version.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", VER_INTERNALNAME_STR
VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR
VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
+21
View File
@@ -0,0 +1,21 @@
#ifndef VERSION_H
#define VERSION_H
#define VER_FILEVERSION 1,0,0,0
#define VER_FILEVERSION_STR "1.0.0.0\0"
#define VER_PRODUCTVERSION 1,0,0,0
#define VER_PRODUCTVERSION_STR "1.0\0"
#define VER_COMPANYNAME_STR "Olive Team"
#define VER_FILEDESCRIPTION_STR "Olive"
#define VER_INTERNALNAME_STR "Olive"
#define VER_LEGALCOPYRIGHT_STR "Copyright © 2018 Olive Team"
#define VER_LEGALTRADEMARKS1_STR "All Rights Reserved"
#define VER_LEGALTRADEMARKS2_STR VER_LEGALTRADEMARKS1_STR
#define VER_ORIGINALFILENAME_STR "Olive.exe"
#define VER_PRODUCTNAME_STR "Olive"
#define VER_COMPANYDOMAIN_STR "www.olivevideoeditor.org"
#endif // VERSION_H
+1 -1
View File
@@ -150,7 +150,7 @@ FORMS += \
dialogs/demonotice.ui
win32 {
RC_ICONS = icons/olive.ico
RC_FILE = icons/resources.rc
LIBS += -lavutil -lavformat -lavcodec -lswscale -lswresample -lopengl32
}
+2 -1
View File
@@ -778,7 +778,6 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
//<clip id="0" name="Brock_Drying_Pan.gif" clipin="0" in="44" out="144" track="-1" r="192" g="128" b="128" media="2" stream="0">
int media_id, stream_id;
Clip* c = new Clip(s);
c->media_type = MEDIA_TYPE_SOLID;
c->media = NULL;
for (int j=0;j<stream.attributes().size();j++) {
const QXmlStreamAttribute& attr = stream.attributes().at(j);
@@ -800,6 +799,8 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
c->color_g = attr.value().toInt();
} else if (attr.name() == "b") {
c->color_b = attr.value().toInt();
} else if (attr.name() == "type") {
c->media_type = attr.value().toInt();
} else if (attr.name() == "media") {
c->media_type = MEDIA_TYPE_FOOTAGE;
media_id = attr.value().toInt();
+9
View File
@@ -1118,24 +1118,28 @@ void Timeline::on_toolArrowButton_clicked() {
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::ArrowCursor);
tool = TIMELINE_TOOL_POINTER;
creating = false;
}
void Timeline::on_toolEditButton_clicked() {
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::IBeamCursor);
tool = TIMELINE_TOOL_EDIT;
creating = false;
}
void Timeline::on_toolRippleButton_clicked() {
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::ArrowCursor);
tool = TIMELINE_TOOL_RIPPLE;
creating = false;
}
void Timeline::on_toolRollingButton_clicked() {
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::ArrowCursor);
tool = TIMELINE_TOOL_ROLLING;
creating = false;
}
void Timeline::on_toolRazorButton_clicked()
@@ -1143,6 +1147,7 @@ void Timeline::on_toolRazorButton_clicked()
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::IBeamCursor);
tool = TIMELINE_TOOL_RAZOR;
creating = false;
}
void Timeline::on_toolSlipButton_clicked()
@@ -1150,6 +1155,7 @@ void Timeline::on_toolSlipButton_clicked()
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::ArrowCursor);
tool = TIMELINE_TOOL_SLIP;
creating = false;
}
void Timeline::on_toolSlideButton_clicked()
@@ -1157,6 +1163,7 @@ void Timeline::on_toolSlideButton_clicked()
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::ArrowCursor);
tool = TIMELINE_TOOL_SLIDE;
creating = false;
}
void Timeline::on_addButton_clicked() {
@@ -1177,6 +1184,8 @@ void Timeline::on_addButton_clicked() {
barsMenuItem->setData(ADD_OBJ_BARS);
add_menu.addAction(barsMenuItem);
add_menu.addSeparator();
QAction* toneMenuItem = new QAction(&add_menu);
toneMenuItem->setText("Tone...");
toneMenuItem->setData(ADD_OBJ_TONE);
-2
View File
@@ -361,7 +361,6 @@ void open_clip_worker(Clip* clip) {
if (av_frame_get_buffer(clip->cache_A.frames[i], 0)) {
qDebug() << "[ERROR] Could not allocate buffer for sws_frame";
}
// clip->cache_A.frames[i]->linesize[0] = dstW*4;
clip->cache_B.frames[i] = av_frame_alloc();
av_frame_make_writable(clip->cache_B.frames[i]);
@@ -371,7 +370,6 @@ void open_clip_worker(Clip* clip) {
if (av_frame_get_buffer(clip->cache_B.frames[i], 0)) {
qDebug() << "[ERROR] Could not allocate buffer for sws_frame";
}
// clip->cache_B.frames[i]->linesize[0] = dstW*4;
}
} else if (clip->stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
// if FFmpeg can't pick up the channel layout (usually WAV), assume
+2 -4
View File
@@ -179,12 +179,10 @@ long Clip::getMediaLength(double framerate) {
{
Sequence* s = static_cast<Sequence*>(media);
return refactor_frame_number(s->getEndFrame(), s->frame_rate, framerate);
}
break;
}
case MEDIA_TYPE_SOLID:
case MEDIA_TYPE_TONE:
return timeline_out - timeline_in;
break;
return LONG_MAX;
}
return 0;
}
+5 -1
View File
@@ -30,7 +30,7 @@ void LabelSlider::set_value(double v, bool userSet) {
internal_value = v;
}
setText(QString::number(internal_value, 'f', 1));
setText(valueToString(internal_value));
if (userSet) emit valueChanged();
}
}
@@ -43,6 +43,10 @@ bool LabelSlider::is_dragging() {
return drag_proc;
}
QString LabelSlider::valueToString(double v) {
return QString::number(v, 'f', 1);
}
double LabelSlider::value() {
return internal_value;
}
+1
View File
@@ -17,6 +17,7 @@ public:
bool is_set();
double get_drag_start_value();
bool is_dragging();
virtual QString valueToString(double v);
protected:
void mousePressEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *ev);
+60 -58
View File
@@ -548,74 +548,76 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
if (panel_timeline->ghosts.size() > 0) {
const Ghost& g = panel_timeline->ghosts.at(0);
TimelineAction* ta = new TimelineAction();
if (g.in != g.out) {
TimelineAction* ta = new TimelineAction();
Clip* c = new Clip(sequence);
c->media = NULL;
c->timeline_in = qMin(g.in, g.out);
c->timeline_out = qMax(g.in, g.out);
c->clip_in = 0;
c->color_r = 192;
c->color_g = 192;
c->color_b = 64;
c->track = g.track;
Clip* c = new Clip(sequence);
c->media = NULL;
c->timeline_in = qMin(g.in, g.out);
c->timeline_out = qMax(g.in, g.out);
c->clip_in = 0;
c->color_r = 192;
c->color_g = 192;
c->color_b = 64;
c->track = g.track;
QVector<Clip*> add;
add.append(c);
ta->add_clips(sequence, add);
QVector<Clip*> add;
add.append(c);
ta->add_clips(sequence, add);
int clipIndex = sequence->clip_count();
if (c->track < 0) {
// default video effects (before custom effects)
ta->add_effect(sequence, clipIndex, VIDEO_TRANSFORM_EFFECT);
c->media_type = MEDIA_TYPE_SOLID;
}
int clipIndex = sequence->clip_count();
if (c->track < 0) {
// default video effects (before custom effects)
ta->add_effect(sequence, clipIndex, VIDEO_TRANSFORM_EFFECT);
c->media_type = MEDIA_TYPE_SOLID;
}
switch (panel_timeline->creatingObject) {
case ADD_OBJ_TITLE:
c->name = "Title";
ta->add_effect(sequence, clipIndex, VIDEO_TEXT_EFFECT);
break;
case ADD_OBJ_SOLID:
c->name = "Solid Color";
ta->add_effect(sequence, clipIndex, VIDEO_SOLID_EFFECT);
break;
case ADD_OBJ_BARS:
c->name = "Bars";
ta->add_effect(sequence, clipIndex, VIDEO_SOLID_EFFECT);
break;
case ADD_OBJ_TONE:
c->name = "Tone";
ta->add_effect(sequence, clipIndex, AUDIO_TONE_EFFECT);
break;
}
switch (panel_timeline->creatingObject) {
case ADD_OBJ_TITLE:
c->name = "Title";
ta->add_effect(sequence, clipIndex, VIDEO_TEXT_EFFECT);
break;
case ADD_OBJ_SOLID:
c->name = "Solid Color";
ta->add_effect(sequence, clipIndex, VIDEO_SOLID_EFFECT);
break;
case ADD_OBJ_BARS:
c->name = "Bars";
ta->add_effect(sequence, clipIndex, VIDEO_SOLID_EFFECT);
break;
case ADD_OBJ_TONE:
c->name = "Tone";
ta->add_effect(sequence, clipIndex, AUDIO_TONE_EFFECT);
break;
}
if (c->track >= 0) {
// default audio effects (after custom effects)
ta->add_effect(sequence, clipIndex, AUDIO_VOLUME_EFFECT);
ta->add_effect(sequence, clipIndex, AUDIO_PAN_EFFECT);
c->media_type = MEDIA_TYPE_TONE;
}
if (c->track >= 0) {
// default audio effects (after custom effects)
ta->add_effect(sequence, clipIndex, AUDIO_VOLUME_EFFECT);
ta->add_effect(sequence, clipIndex, AUDIO_PAN_EFFECT);
c->media_type = MEDIA_TYPE_TONE;
}
Selection s;
s.in = c->timeline_in;
s.out = c->timeline_out;
s.track = c->track;
QVector<Selection> areas;
areas.append(s);
panel_timeline->delete_areas_and_relink(ta, areas);
Selection s;
s.in = c->timeline_in;
s.out = c->timeline_out;
s.track = c->track;
QVector<Selection> areas;
areas.append(s);
panel_timeline->delete_areas_and_relink(ta, areas);
undo_stack.push(ta);
undo_stack.push(ta);
// pretty hacky (and doesn't survive undo/redo)
if (panel_timeline->creatingObject == ADD_OBJ_BARS) {
sequence->get_clip(clipIndex)->effects.at(1)->row(0)->field(0)->set_combo_index(1);
}
// pretty hacky (and doesn't survive undo/redo)
if (panel_timeline->creatingObject == ADD_OBJ_BARS) {
sequence->get_clip(clipIndex)->effects.at(1)->row(0)->field(0)->set_combo_index(1);
}
panel_timeline->redraw_all_clips(true);
panel_timeline->redraw_all_clips(true);
if (!shift) {
panel_timeline->creating = false;
if (!shift) {
panel_timeline->creating = false;
}
}
}
} else if (panel_timeline->moving_proc) {