removed project ui, fixed some project panel crashes

This commit is contained in:
itsmattkc
2018-12-21 01:03:40 +11:00
parent ef3ff6f0c4
commit c65e2557b5
7 changed files with 256 additions and 289 deletions
+202 -203
View File
@@ -1,203 +1,202 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-05-11T10:31:59
#
#-------------------------------------------------
QT += core gui multimedia opengl
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Olive
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
mainwindow.cpp \
panels/project.cpp \
panels/effectcontrols.cpp \
panels/viewer.cpp \
panels/timeline.cpp \
ui/sourcetable.cpp \
dialogs/aboutdialog.cpp \
ui/timelinewidget.cpp \
project/media.cpp \
project/footage.cpp \
project/sequence.cpp \
project/clip.cpp \
playback/playback.cpp \
playback/audio.cpp \
io/config.cpp \
dialogs/newsequencedialog.cpp \
ui/viewerwidget.cpp \
ui/viewercontainer.cpp \
dialogs/exportdialog.cpp \
ui/collapsiblewidget.cpp \
panels/panels.cpp \
playback/cacher.cpp \
io/exportthread.cpp \
ui/timelineheader.cpp \
io/previewgenerator.cpp \
ui/labelslider.cpp \
dialogs/preferencesdialog.cpp \
ui/audiomonitor.cpp \
project/undo.cpp \
ui/scrollarea.cpp \
ui/comboboxex.cpp \
ui/colorbutton.cpp \
dialogs/replaceclipmediadialog.cpp \
ui/fontcombobox.cpp \
ui/checkboxex.cpp \
ui/keyframeview.cpp \
ui/texteditex.cpp \
dialogs/demonotice.cpp \
project/marker.cpp \
dialogs/speeddialog.cpp \
dialogs/mediapropertiesdialog.cpp \
io/crc32.cpp \
project/projectmodel.cpp \
io/loadthread.cpp \
dialogs/loaddialog.cpp \
debug.cpp \
io/path.cpp \
effects/internal/linearfadetransition.cpp \
effects/internal/transformeffect.cpp \
effects/internal/solideffect.cpp \
effects/internal/texteffect.cpp \
effects/internal/timecodeeffect.cpp \
effects/internal/audionoiseeffect.cpp \
effects/internal/paneffect.cpp \
effects/internal/toneeffect.cpp \
effects/internal/volumeeffect.cpp \
effects/internal/crossdissolvetransition.cpp \
effects/internal/shakeeffect.cpp \
effects/internal/exponentialfadetransition.cpp \
effects/internal/logarithmicfadetransition.cpp \
effects/internal/cornerpineffect.cpp \
io/math.cpp \
io/qpainterwrapper.cpp \
project/effect.cpp \
project/transition.cpp \
project/effectrow.cpp \
project/effectfield.cpp \
effects/internal/cubetransition.cpp \
project/effectgizmo.cpp \
io/clipboard.cpp \
dialogs/stabilizerdialog.cpp
HEADERS += \
mainwindow.h \
panels/project.h \
panels/effectcontrols.h \
panels/viewer.h \
panels/timeline.h \
ui/sourcetable.h \
dialogs/aboutdialog.h \
ui/timelinewidget.h \
project/media.h \
project/footage.h \
project/sequence.h \
project/clip.h \
playback/playback.h \
playback/audio.h \
io/config.h \
dialogs/newsequencedialog.h \
ui/viewerwidget.h \
ui/viewercontainer.h \
dialogs/exportdialog.h \
ui/collapsiblewidget.h \
panels/panels.h \
playback/cacher.h \
io/exportthread.h \
ui/timelinetools.h \
ui/timelineheader.h \
io/previewgenerator.h \
ui/labelslider.h \
dialogs/preferencesdialog.h \
ui/audiomonitor.h \
project/undo.h \
ui/scrollarea.h \
ui/comboboxex.h \
ui/colorbutton.h \
dialogs/replaceclipmediadialog.h \
ui/fontcombobox.h \
ui/checkboxex.h \
ui/keyframeview.h \
ui/texteditex.h \
dialogs/demonotice.h \
project/marker.h \
project/selection.h \
dialogs/speeddialog.h \
dialogs/mediapropertiesdialog.h \
io/crc32.h \
project/projectmodel.h \
io/loadthread.h \
dialogs/loaddialog.h \
debug.h \
io/path.h \
effects/internal/transformeffect.h \
effects/internal/solideffect.h \
effects/internal/texteffect.h \
effects/internal/timecodeeffect.h \
effects/internal/audionoiseeffect.h \
effects/internal/paneffect.h \
effects/internal/toneeffect.h \
effects/internal/volumeeffect.h \
effects/internal/shakeeffect.h \
effects/internal/linearfadetransition.h \
effects/internal/crossdissolvetransition.h \
effects/internal/exponentialfadetransition.h \
effects/internal/logarithmicfadetransition.h \
effects/internal/cornerpineffect.h \
io/math.h \
io/qpainterwrapper.h \
project/effect.h \
project/transition.h \
project/effectrow.h \
project/effectfield.h \
effects/internal/cubetransition.h \
project/effectgizmo.h \
io/clipboard.h \
dialogs/stabilizerdialog.h
FORMS += \
mainwindow.ui \
panels/project.ui \
panels/effectcontrols.ui \
panels/viewer.ui \
panels/timeline.ui \
dialogs/aboutdialog.ui \
dialogs/newsequencedialog.ui \
dialogs/exportdialog.ui \
dialogs/preferencesdialog.ui \
dialogs/demonotice.ui
win32 {
RC_FILE = icons/resources.rc
LIBS += -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample -lopengl32
}
mac {
LIBS += -L/usr/local/lib -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample
ICON = icons/olive.icns
INCLUDEPATH = /usr/local/include
}
linux {
LIBS += -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample
}
RESOURCES += \
icons/icons.qrc
#-------------------------------------------------
#
# Project created by QtCreator 2018-05-11T10:31:59
#
#-------------------------------------------------
QT += core gui multimedia opengl
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Olive
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
mainwindow.cpp \
panels/project.cpp \
panels/effectcontrols.cpp \
panels/viewer.cpp \
panels/timeline.cpp \
ui/sourcetable.cpp \
dialogs/aboutdialog.cpp \
ui/timelinewidget.cpp \
project/media.cpp \
project/footage.cpp \
project/sequence.cpp \
project/clip.cpp \
playback/playback.cpp \
playback/audio.cpp \
io/config.cpp \
dialogs/newsequencedialog.cpp \
ui/viewerwidget.cpp \
ui/viewercontainer.cpp \
dialogs/exportdialog.cpp \
ui/collapsiblewidget.cpp \
panels/panels.cpp \
playback/cacher.cpp \
io/exportthread.cpp \
ui/timelineheader.cpp \
io/previewgenerator.cpp \
ui/labelslider.cpp \
dialogs/preferencesdialog.cpp \
ui/audiomonitor.cpp \
project/undo.cpp \
ui/scrollarea.cpp \
ui/comboboxex.cpp \
ui/colorbutton.cpp \
dialogs/replaceclipmediadialog.cpp \
ui/fontcombobox.cpp \
ui/checkboxex.cpp \
ui/keyframeview.cpp \
ui/texteditex.cpp \
dialogs/demonotice.cpp \
project/marker.cpp \
dialogs/speeddialog.cpp \
dialogs/mediapropertiesdialog.cpp \
io/crc32.cpp \
project/projectmodel.cpp \
io/loadthread.cpp \
dialogs/loaddialog.cpp \
debug.cpp \
io/path.cpp \
effects/internal/linearfadetransition.cpp \
effects/internal/transformeffect.cpp \
effects/internal/solideffect.cpp \
effects/internal/texteffect.cpp \
effects/internal/timecodeeffect.cpp \
effects/internal/audionoiseeffect.cpp \
effects/internal/paneffect.cpp \
effects/internal/toneeffect.cpp \
effects/internal/volumeeffect.cpp \
effects/internal/crossdissolvetransition.cpp \
effects/internal/shakeeffect.cpp \
effects/internal/exponentialfadetransition.cpp \
effects/internal/logarithmicfadetransition.cpp \
effects/internal/cornerpineffect.cpp \
io/math.cpp \
io/qpainterwrapper.cpp \
project/effect.cpp \
project/transition.cpp \
project/effectrow.cpp \
project/effectfield.cpp \
effects/internal/cubetransition.cpp \
project/effectgizmo.cpp \
io/clipboard.cpp \
dialogs/stabilizerdialog.cpp
HEADERS += \
mainwindow.h \
panels/project.h \
panels/effectcontrols.h \
panels/viewer.h \
panels/timeline.h \
ui/sourcetable.h \
dialogs/aboutdialog.h \
ui/timelinewidget.h \
project/media.h \
project/footage.h \
project/sequence.h \
project/clip.h \
playback/playback.h \
playback/audio.h \
io/config.h \
dialogs/newsequencedialog.h \
ui/viewerwidget.h \
ui/viewercontainer.h \
dialogs/exportdialog.h \
ui/collapsiblewidget.h \
panels/panels.h \
playback/cacher.h \
io/exportthread.h \
ui/timelinetools.h \
ui/timelineheader.h \
io/previewgenerator.h \
ui/labelslider.h \
dialogs/preferencesdialog.h \
ui/audiomonitor.h \
project/undo.h \
ui/scrollarea.h \
ui/comboboxex.h \
ui/colorbutton.h \
dialogs/replaceclipmediadialog.h \
ui/fontcombobox.h \
ui/checkboxex.h \
ui/keyframeview.h \
ui/texteditex.h \
dialogs/demonotice.h \
project/marker.h \
project/selection.h \
dialogs/speeddialog.h \
dialogs/mediapropertiesdialog.h \
io/crc32.h \
project/projectmodel.h \
io/loadthread.h \
dialogs/loaddialog.h \
debug.h \
io/path.h \
effects/internal/transformeffect.h \
effects/internal/solideffect.h \
effects/internal/texteffect.h \
effects/internal/timecodeeffect.h \
effects/internal/audionoiseeffect.h \
effects/internal/paneffect.h \
effects/internal/toneeffect.h \
effects/internal/volumeeffect.h \
effects/internal/shakeeffect.h \
effects/internal/linearfadetransition.h \
effects/internal/crossdissolvetransition.h \
effects/internal/exponentialfadetransition.h \
effects/internal/logarithmicfadetransition.h \
effects/internal/cornerpineffect.h \
io/math.h \
io/qpainterwrapper.h \
project/effect.h \
project/transition.h \
project/effectrow.h \
project/effectfield.h \
effects/internal/cubetransition.h \
project/effectgizmo.h \
io/clipboard.h \
dialogs/stabilizerdialog.h
FORMS += \
mainwindow.ui \
panels/effectcontrols.ui \
panels/viewer.ui \
panels/timeline.ui \
dialogs/aboutdialog.ui \
dialogs/newsequencedialog.ui \
dialogs/exportdialog.ui \
dialogs/preferencesdialog.ui \
dialogs/demonotice.ui
win32 {
RC_FILE = icons/resources.rc
LIBS += -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample -lopengl32
}
mac {
LIBS += -L/usr/local/lib -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample
ICON = icons/olive.icns
INCLUDEPATH = /usr/local/include
}
linux {
LIBS += -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample
}
RESOURCES += \
icons/icons.qrc
+30 -5
View File
@@ -37,6 +37,8 @@
#include <QSortFilterProxyModel>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QListView>
#include <QSizePolicy>
extern "C" {
#include <libavformat/avformat.h>
@@ -53,20 +55,43 @@ QStringList recent_projects;
QString recent_proj_file;
Project::Project(QWidget *parent) :
QDockWidget(parent),
ui(new Ui::Project)
QDockWidget(parent)
{
ui->setupUi(this);
source_table = ui->treeView;
setObjectName("Project");
resize(504, 371);
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(this->sizePolicy().hasHeightForWidth());
setSizePolicy(sizePolicy);
QWidget* dockWidgetContents = new QWidget();
QVBoxLayout* verticalLayout = new QVBoxLayout(dockWidgetContents);
verticalLayout->setContentsMargins(0, 0, 0, 0);
setWidget(dockWidgetContents);
source_table = new SourceTable(dockWidgetContents);
source_table->project_parent = this;
source_table->setAcceptDrops(true);
source_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
source_table->setDragDropMode(QAbstractItemView::DragDrop);
source_table->setSelectionMode(QAbstractItemView::ExtendedSelection);
verticalLayout->addWidget(source_table);
//setWidget(source_table);
//layout->addWidget(source_table);
sorter = new QSortFilterProxyModel(this);
sorter->setSourceModel(&project_model);
source_table->setModel(sorter);
//retranslateUi(Project);
setWindowTitle(QApplication::translate("Project", "Project", nullptr));
}
Project::~Project() {
delete ui;
delete sorter;
}
QString Project::get_next_sequence_name(QString start) {
+1 -3
View File
@@ -75,9 +75,7 @@ public:
//Media *new_item();
void start_preview_generator(Media* item, bool replacing);
Ui::Project *ui;
void start_preview_generator(Media* item, bool replacing);
public slots:
void import_dialog();
void delete_selected_media();
-64
View File
@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Project</class>
<widget class="QDockWidget" name="Project">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>504</width>
<height>371</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Project</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="SourceTable" name="treeView">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>SourceTable</class>
<extends>QTreeView</extends>
<header>ui/sourcetable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+19 -9
View File
@@ -197,15 +197,25 @@ void Media::set_name(const QString &n) {
double Media::get_frame_rate(int stream) {
switch (get_type()) {
case MEDIA_TYPE_FOOTAGE: return to_footage()->get_stream_from_file_index(true, stream)->video_frame_rate;
case MEDIA_TYPE_FOOTAGE:
{
Footage* f = to_footage();
if (stream < 0) return f->video_tracks.at(0)->video_frame_rate;
return f->get_stream_from_file_index(true, stream)->video_frame_rate;
}
case MEDIA_TYPE_SEQUENCE: return to_sequence()->frame_rate;
}
return qSNaN();
return NULL;
}
int Media::get_sampling_rate(int stream) {
switch (get_type()) {
case MEDIA_TYPE_FOOTAGE: return to_footage()->get_stream_from_file_index(false, stream)->audio_frequency;
case MEDIA_TYPE_FOOTAGE:
{
Footage* f = to_footage();
if (stream < 0) return f->audio_tracks.at(0)->audio_frequency;
return to_footage()->get_stream_from_file_index(false, stream)->audio_frequency;
}
case MEDIA_TYPE_SEQUENCE: return to_sequence()->audio_frequency;
}
return 0;
@@ -259,11 +269,11 @@ QVariant Media::data(int column, int role) {
Footage* f = to_footage();
double r = 30;
if (f->video_tracks.size() > 0) r = f->video_tracks.at(0)->video_frame_rate;
if (!qIsNull(r)) {
if (f->video_tracks.size() > 0 && !qIsNull(f->video_tracks.at(0)->video_frame_rate)) r = f->video_tracks.at(0)->video_frame_rate;
//if (!qIsNull(r)) {
long len = f->get_length_in_frames(r);
if (len > 0) return frame_to_timecode(len, config.timecode_view, r);
}
//}
}
break;
case 2:
@@ -271,9 +281,9 @@ QVariant Media::data(int column, int role) {
if (get_type() == MEDIA_TYPE_SEQUENCE) return QString::number(get_frame_rate()) + " FPS";
if (get_type() == MEDIA_TYPE_FOOTAGE) {
Footage* f = to_footage();
if (f->video_tracks.size() > 0) {
double r = get_frame_rate();
if (!qIsNull(r)) return QString::number(get_frame_rate()) + " FPS";
double r;
if (f->video_tracks.size() > 0 && !qIsNull(r = get_frame_rate())) {
return QString::number(get_frame_rate()) + " FPS";
} else if (f->audio_tracks.size() > 0) {
return QString::number(get_sampling_rate()) + " Hz";
}
+2 -2
View File
@@ -32,8 +32,8 @@ public:
void set_name(const QString& n);
MediaThrobber* throbber;
double get_frame_rate(int stream = 0);
int get_sampling_rate(int stream = 0);
double get_frame_rate(int stream = -1);
int get_sampling_rate(int stream = -1);
// item functions
void appendChild(Media *child);
+2 -3
View File
@@ -401,12 +401,11 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
}
}
void TimelineHeader::show_context_menu(const QPoint &pos)
{
void TimelineHeader::show_context_menu(const QPoint &pos) {
QMenu contextMenu(tr("Context menu"), this);
QAction clear_in_out("Clear In/Out Points", this);
if (!viewer->seq->using_workarea) clear_in_out.setVisible(false);
if (!viewer->seq->using_workarea) clear_in_out.setEnabled(false);
connect(&clear_in_out, SIGNAL(triggered()), mainWindow, SLOT(on_actionClear_In_Out_triggered()));
contextMenu.addAction(&clear_in_out);
contextMenu.exec(mapToGlobal(pos));