fixed image detection FINALLY (and one of the undo bugs)

This commit is contained in:
itsmattkc
2018-06-21 02:16:16 -07:00
parent dc17bd4e4e
commit 937f714183
6 changed files with 26 additions and 11 deletions
+6 -3
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>320</width>
<height>180</height>
<width>400</width>
<height>220</height>
</rect>
</property>
<property name="windowTitle">
@@ -17,11 +17,14 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Olive is a professional video editor.</string>
<string>Olive is a non-linear video editor. This software is free and protected by the GNU GPL.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
+4
View File
@@ -1,3 +1,7 @@
//
// TODO: Fold this file into a multithreaded "file processor"
//
#include "previewgenerator.h"
#include "media.h"
+2 -3
View File
@@ -54,7 +54,6 @@ MainWindow::MainWindow(QWidget *parent) :
darkPalette.setColor(QPalette::ButtonText, Qt::white); darkPalette.setColor(QPalette::BrightText, Qt::red);
darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(128, 128, 128));
darkPalette.setColor(QPalette::Link, QColor(42, 130, 218));
darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
darkPalette.setColor(QPalette::HighlightedText, Qt::black);
@@ -66,8 +65,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->setupUi(this);
setWindowTitle("Olive (May 2018 | Pre-Alpha)");
statusBar()->showMessage("Welcome to Olive::Qt");
setWindowTitle("Olive (June 2018 | Pre-Alpha)");
statusBar()->showMessage("Welcome to Olive");
setCentralWidget(NULL);
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.6.2, 2018-06-20T01:11:19. -->
<!-- Written by QtCreator 4.6.2, 2018-06-21T02:11:57. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
+11 -4
View File
@@ -116,10 +116,17 @@ Media* Project::import_file(QString file) {
ms->preview_lock.lock();
ms->file_index = i;
if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
qDebug() << "[WARNING] INFINITE_LENGTH calculation is inaccurate in this build\n";
// TODO BETTER infinite length calculator
bool infinite_length = (pFormatCtx->streams[i]->nb_frames == 0);
// bool infinite_length = false;
// qDebug() << "[WARNING] INFINITE_LENGTH calculation is inaccurate in this build\n";
// qDebug() << "INFINITE_LENGTH heuristics:";
// qDebug() << " start_time:" << pFormatCtx->streams[i]->start_time;
// qDebug() << " duration:" << pFormatCtx->streams[i]->duration;
// qDebug() << " nb_frames:" << pFormatCtx->streams[i]->nb_frames;
// qDebug() << " avg_frame_rate:" << av_q2d(pFormatCtx->streams[i]->avg_frame_rate);
// qDebug() << " codec_info_nb_frames:" << pFormatCtx->streams[i]->codec_info_nb_frames;
// qDebug() << " nb_decoded_frames:" << pFormatCtx->streams[i]->nb_decoded_frames;
// qDebug() << " codec_id:" << pFormatCtx->streams[i]->codecpar->codec_id;
bool infinite_length = (pFormatCtx->streams[i]->avg_frame_rate.den == 0);
ms->video_width = pFormatCtx->streams[i]->codecpar->width;
ms->video_height = pFormatCtx->streams[i]->codecpar->height;
ms->infinite_length = infinite_length;
+2
View File
@@ -136,6 +136,7 @@ bool Timeline::focused() {
void Timeline::undo() {
if (sequence != NULL) {
current_clips.clear();
panel_effect_controls->set_clip(NULL);
sequence->undo();
ui->video_area->redraw_clips();
ui->audio_area->redraw_clips();
@@ -145,6 +146,7 @@ void Timeline::undo() {
void Timeline::redo() {
if (sequence != NULL) {
current_clips.clear();
panel_effect_controls->set_clip(NULL);
sequence->redo();
ui->video_area->redraw_clips();
ui->audio_area->redraw_clips();