diff --git a/effects/audio/toneeffect.cpp b/effects/audio/toneeffect.cpp index b6a213112..d1efed9af 100644 --- a/effects/audio/toneeffect.cpp +++ b/effects/audio/toneeffect.cpp @@ -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); diff --git a/icons/resources.rc b/icons/resources.rc new file mode 100644 index 000000000..dcc2fd815 --- /dev/null +++ b/icons/resources.rc @@ -0,0 +1,31 @@ +IDI_ICON1 ICON DISCARDABLE "olive.ico" + +#include +#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 diff --git a/icons/version.h b/icons/version.h new file mode 100644 index 000000000..615e67dfc --- /dev/null +++ b/icons/version.h @@ -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 diff --git a/olive.pro b/olive.pro index c4840a85b..bc8154e64 100644 --- a/olive.pro +++ b/olive.pro @@ -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 } diff --git a/panels/project.cpp b/panels/project.cpp index 997e9bde5..770dcf437 100644 --- a/panels/project.cpp +++ b/panels/project.cpp @@ -778,7 +778,6 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) { // int media_id, stream_id; Clip* c = new Clip(s); - c->media_type = MEDIA_TYPE_SOLID; c->media = NULL; for (int j=0;jcolor_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(); diff --git a/panels/timeline.cpp b/panels/timeline.cpp index 2dc3177ed..4637c8383 100644 --- a/panels/timeline.cpp +++ b/panels/timeline.cpp @@ -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); diff --git a/playback/cacher.cpp b/playback/cacher.cpp index 6ee108e31..c2467892b 100644 --- a/playback/cacher.cpp +++ b/playback/cacher.cpp @@ -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 diff --git a/project/clip.cpp b/project/clip.cpp index 207f3bb55..dcc08a25c 100644 --- a/project/clip.cpp +++ b/project/clip.cpp @@ -179,12 +179,10 @@ long Clip::getMediaLength(double framerate) { { Sequence* s = static_cast(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; } diff --git a/ui/labelslider.cpp b/ui/labelslider.cpp index c6ef7025a..adfb9d84e 100644 --- a/ui/labelslider.cpp +++ b/ui/labelslider.cpp @@ -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; } diff --git a/ui/labelslider.h b/ui/labelslider.h index 04a9dbb05..2cfc5a156 100644 --- a/ui/labelslider.h +++ b/ui/labelslider.h @@ -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); diff --git a/ui/timelinewidget.cpp b/ui/timelinewidget.cpp index d3ab8cce5..77a6041a4 100644 --- a/ui/timelinewidget.cpp +++ b/ui/timelinewidget.cpp @@ -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 add; - add.append(c); - ta->add_clips(sequence, add); + QVector 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 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 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) {