file/folder restructuring
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include <QComboBox>
|
||||
#include <QSpinBox>
|
||||
|
||||
#include "io/exportthread.h"
|
||||
#include "rendering/exportthread.h"
|
||||
|
||||
/**
|
||||
* @brief The AdvancedVideoDialog class
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
#include "panels/panels.h"
|
||||
#include "project/undo.h"
|
||||
#include "undo/undo.h"
|
||||
|
||||
ClipPropertiesDialog::ClipPropertiesDialog(QWidget *parent, QVector<Clip *> clips) :
|
||||
QDialog(parent)
|
||||
@@ -33,8 +33,8 @@ ClipPropertiesDialog::ClipPropertiesDialog(QWidget *parent, QVector<Clip *> clip
|
||||
layout->addWidget(new QLabel(tr("Duration:")), row, 0);
|
||||
|
||||
duration_field_ = new LabelSlider();
|
||||
duration_field_->set_display_type(LabelSlider::LABELSLIDER_FRAMENUMBER);
|
||||
duration_field_->set_minimum_value(1);
|
||||
duration_field_->SetDisplayType(LabelSlider::FrameNumber);
|
||||
duration_field_->SetMinimum(1);
|
||||
layout->addWidget(duration_field_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -72,15 +72,15 @@ ClipPropertiesDialog::ClipPropertiesDialog(QWidget *parent, QVector<Clip *> clip
|
||||
}
|
||||
|
||||
// it's assumed all the clips come from the same sequence
|
||||
duration_field_->set_frame_rate(first_clip->sequence->frame_rate);
|
||||
duration_field_->SetFrameRate(first_clip->sequence->frame_rate);
|
||||
|
||||
if (all_clips_have_same_duration) {
|
||||
duration_field_->set_default_value(first_clip->length());
|
||||
duration_field_->set_value(first_clip->length(), false);
|
||||
duration_field_->set_maximum_value(first_clip->media_length());
|
||||
duration_field_->SetDefault(first_clip->length());
|
||||
duration_field_->SetValue(first_clip->length());
|
||||
duration_field_->SetMaximum(first_clip->media_length());
|
||||
} else {
|
||||
duration_field_->set_default_value(qSNaN());
|
||||
duration_field_->set_value(qSNaN(), false);
|
||||
duration_field_->SetDefault(qSNaN());
|
||||
duration_field_->SetValue(qSNaN());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QDialog>
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "project/clip.h"
|
||||
#include "timeline/clip.h"
|
||||
#include "ui/labelslider.h"
|
||||
|
||||
class ClipPropertiesDialog : public QDialog {
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "oliveglobal.h"
|
||||
#include "global/global.h"
|
||||
#include "dialogs/advancedvideodialog.h"
|
||||
#include "panels/panels.h"
|
||||
#include "ui/viewerwidget.h"
|
||||
#include "rendering/renderfunctions.h"
|
||||
#include "io/exportthread.h"
|
||||
#include "mainwindow.h"
|
||||
#include "rendering/exportthread.h"
|
||||
#include "ui/mainwindow.h"
|
||||
|
||||
extern "C" {
|
||||
#include <libavformat/avformat.h>
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
#include <QProgressBar>
|
||||
#include <QGroupBox>
|
||||
|
||||
#include "project/sequence.h"
|
||||
#include "timeline/sequence.h"
|
||||
|
||||
#include "io/exportthread.h"
|
||||
#include "rendering/exportthread.h"
|
||||
|
||||
class ExportDialog : public QDialog
|
||||
{
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "oliveglobal.h"
|
||||
#include "global/global.h"
|
||||
|
||||
#include "panels/panels.h"
|
||||
|
||||
#include "ui/sourcetable.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui/mainwindow.h"
|
||||
|
||||
LoadDialog::LoadDialog(QWidget *parent, const QString& fn, bool autorecovery, bool clear) :
|
||||
QDialog(parent)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <QHBoxLayout>
|
||||
|
||||
#include "project/projectelements.h"
|
||||
#include "io/loadthread.h"
|
||||
#include "project/loadthread.h"
|
||||
|
||||
class LoadDialog : public QDialog
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "project/footage.h"
|
||||
#include "project/media.h"
|
||||
#include "panels/project.h"
|
||||
#include "project/undo.h"
|
||||
#include "undo/undo.h"
|
||||
|
||||
MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
|
||||
QDialog(parent),
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
#include "panels/panels.h"
|
||||
#include "panels/project.h"
|
||||
#include "project/sequence.h"
|
||||
#include "project/undo.h"
|
||||
#include "project/clip.h"
|
||||
#include "timeline/sequence.h"
|
||||
#include "undo/undo.h"
|
||||
#include "timeline/clip.h"
|
||||
#include "panels/timeline.h"
|
||||
#include "project/media.h"
|
||||
#include "rendering/audio.h"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "panels/project.h"
|
||||
#include "project/media.h"
|
||||
#include "project/sequence.h"
|
||||
#include "timeline/sequence.h"
|
||||
|
||||
class NewSequenceDialog : public QDialog
|
||||
{
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
|
||||
#include "preferencesdialog.h"
|
||||
|
||||
#include "oliveglobal.h"
|
||||
#include "io/config.h"
|
||||
#include "io/path.h"
|
||||
#include "global/global.h"
|
||||
#include "global/config.h"
|
||||
#include "global/path.h"
|
||||
#include "rendering/audio.h"
|
||||
#include "panels/panels.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui/mainwindow.h"
|
||||
|
||||
#include <QMenuBar>
|
||||
#include <QAction>
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
#include "io/proxygenerator.h"
|
||||
#include "project/proxygenerator.h"
|
||||
#include "project/footage.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui/mainwindow.h"
|
||||
|
||||
ProxyDialog::ProxyDialog(QWidget *parent, const QVector<Media*> &media) :
|
||||
QDialog(parent),
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "panels/panels.h"
|
||||
|
||||
#include "rendering/cacher.h"
|
||||
#include "project/undo.h"
|
||||
#include "undo/undo.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
@@ -31,96 +31,96 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media* old_media) :
|
||||
QDialog(parent),
|
||||
media(old_media)
|
||||
QDialog(parent),
|
||||
media(old_media)
|
||||
{
|
||||
setWindowTitle(tr("Replace clips using \"%1\"").arg(old_media->get_name()));
|
||||
setWindowTitle(tr("Replace clips using \"%1\"").arg(old_media->get_name()));
|
||||
|
||||
resize(300, 400);
|
||||
resize(300, 400);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
|
||||
layout->addWidget(new QLabel(tr("Select which media you want to replace this media's clips with:"), this));
|
||||
layout->addWidget(new QLabel(tr("Select which media you want to replace this media's clips with:"), this));
|
||||
|
||||
tree = new QTreeView(this);
|
||||
tree = new QTreeView(this);
|
||||
|
||||
layout->addWidget(tree);
|
||||
layout->addWidget(tree);
|
||||
|
||||
use_same_media_in_points = new QCheckBox(tr("Keep the same media in-points"), this);
|
||||
use_same_media_in_points->setChecked(true);
|
||||
layout->addWidget(use_same_media_in_points);
|
||||
use_same_media_in_points = new QCheckBox(tr("Keep the same media in-points"), this);
|
||||
use_same_media_in_points->setChecked(true);
|
||||
layout->addWidget(use_same_media_in_points);
|
||||
|
||||
QHBoxLayout* buttons = new QHBoxLayout();
|
||||
|
||||
buttons->addStretch();
|
||||
buttons->addStretch();
|
||||
|
||||
QPushButton* replace_button = new QPushButton(tr("Replace"), this);
|
||||
connect(replace_button, SIGNAL(clicked(bool)), this, SLOT(replace()));
|
||||
buttons->addWidget(replace_button);
|
||||
QPushButton* replace_button = new QPushButton(tr("Replace"), this);
|
||||
connect(replace_button, SIGNAL(clicked(bool)), this, SLOT(replace()));
|
||||
buttons->addWidget(replace_button);
|
||||
|
||||
QPushButton* cancel_button = new QPushButton(tr("Cancel"), this);
|
||||
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(close()));
|
||||
buttons->addWidget(cancel_button);
|
||||
QPushButton* cancel_button = new QPushButton(tr("Cancel"), this);
|
||||
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(close()));
|
||||
buttons->addWidget(cancel_button);
|
||||
|
||||
buttons->addStretch();
|
||||
buttons->addStretch();
|
||||
|
||||
layout->addLayout(buttons);
|
||||
layout->addLayout(buttons);
|
||||
|
||||
tree->setModel(&olive::project_model);
|
||||
tree->setModel(&olive::project_model);
|
||||
}
|
||||
|
||||
void ReplaceClipMediaDialog::replace() {
|
||||
QModelIndexList selected_items = tree->selectionModel()->selectedRows();
|
||||
if (selected_items.size() != 1) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("No media selected"),
|
||||
tr("Please select a media to replace with or click 'Cancel'."),
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else {
|
||||
QModelIndexList selected_items = tree->selectionModel()->selectedRows();
|
||||
if (selected_items.size() != 1) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("No media selected"),
|
||||
tr("Please select a media to replace with or click 'Cancel'."),
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else {
|
||||
Media* new_item = static_cast<Media*>(selected_items.at(0).internalPointer());
|
||||
if (media == new_item) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("Same media selected"),
|
||||
tr("You selected the same media that you're replacing. Please select a different one or click 'Cancel'."),
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else if (new_item->get_type() == MEDIA_TYPE_FOLDER) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("Folder selected"),
|
||||
tr("You cannot replace footage with a folder."),
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else {
|
||||
if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && olive::ActiveSequence == new_item->to_sequence()) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("Active sequence selected"),
|
||||
tr("You cannot insert a sequence into itself."),
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else {
|
||||
ReplaceClipMediaCommand* rcmc = new ReplaceClipMediaCommand(
|
||||
media,
|
||||
new_item,
|
||||
use_same_media_in_points->isChecked()
|
||||
);
|
||||
if (media == new_item) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("Same media selected"),
|
||||
tr("You selected the same media that you're replacing. Please select a different one or click 'Cancel'."),
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else if (new_item->get_type() == MEDIA_TYPE_FOLDER) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("Folder selected"),
|
||||
tr("You cannot replace footage with a folder."),
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else {
|
||||
if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && olive::ActiveSequence == new_item->to_sequence()) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("Active sequence selected"),
|
||||
tr("You cannot insert a sequence into itself."),
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else {
|
||||
ReplaceClipMediaCommand* rcmc = new ReplaceClipMediaCommand(
|
||||
media,
|
||||
new_item,
|
||||
use_same_media_in_points->isChecked()
|
||||
);
|
||||
|
||||
for (int i=0;i<olive::ActiveSequence->clips.size();i++) {
|
||||
for (int i=0;i<olive::ActiveSequence->clips.size();i++) {
|
||||
ClipPtr c = olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr && c->media() == media) {
|
||||
rcmc->clips.append(c);
|
||||
}
|
||||
}
|
||||
rcmc->clips.append(c);
|
||||
}
|
||||
}
|
||||
|
||||
olive::UndoStack.push(rcmc);
|
||||
olive::UndoStack.push(rcmc);
|
||||
|
||||
close();
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+24
-24
@@ -26,13 +26,13 @@
|
||||
#include <QPushButton>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
#include "project/sequence.h"
|
||||
#include "timeline/sequence.h"
|
||||
#include "project/footage.h"
|
||||
#include "rendering/renderfunctions.h"
|
||||
#include "panels/panels.h"
|
||||
#include "panels/timeline.h"
|
||||
#include "project/undo.h"
|
||||
#include "project/effect.h"
|
||||
#include "undo/undo.h"
|
||||
#include "effects/effect.h"
|
||||
#include "project/media.h"
|
||||
|
||||
SpeedDialog::SpeedDialog(QWidget *parent, QVector<Clip*> clips) : QDialog(parent) {
|
||||
@@ -47,20 +47,20 @@ SpeedDialog::SpeedDialog(QWidget *parent, QVector<Clip*> clips) : QDialog(parent
|
||||
|
||||
grid->addWidget(new QLabel(tr("Speed:"), this), 0, 0);
|
||||
percent = new LabelSlider(this);
|
||||
percent->decimal_places = 2;
|
||||
percent->set_display_type(LabelSlider::LABELSLIDER_PERCENT);
|
||||
percent->set_default_value(1);
|
||||
percent->SetDecimalPlaces(2);
|
||||
percent->SetDisplayType(LabelSlider::Percent);
|
||||
percent->SetDefault(1);
|
||||
grid->addWidget(percent, 0, 1);
|
||||
|
||||
grid->addWidget(new QLabel(tr("Frame Rate:"), this), 1, 0);
|
||||
frame_rate = new LabelSlider(this);
|
||||
frame_rate->decimal_places = 3;
|
||||
frame_rate->SetDecimalPlaces(3);
|
||||
grid->addWidget(frame_rate, 1, 1);
|
||||
|
||||
grid->addWidget(new QLabel(tr("Duration:"), this), 2, 0);
|
||||
duration = new LabelSlider(this);
|
||||
duration->set_display_type(LabelSlider::LABELSLIDER_FRAMENUMBER);
|
||||
duration->set_frame_rate(olive::ActiveSequence->frame_rate);
|
||||
duration->SetDisplayType(LabelSlider::FrameNumber);
|
||||
duration->SetFrameRate(olive::ActiveSequence->frame_rate);
|
||||
grid->addWidget(duration, 2, 1);
|
||||
|
||||
main_layout->addLayout(grid);
|
||||
@@ -168,16 +168,16 @@ void SpeedDialog::run() {
|
||||
}
|
||||
}
|
||||
|
||||
frame_rate->set_minimum_value(1);
|
||||
percent->set_minimum_value(0.0001);
|
||||
duration->set_minimum_value(1);
|
||||
frame_rate->SetMinimum(1);
|
||||
percent->SetMinimum(0.0001);
|
||||
duration->SetMinimum(1);
|
||||
|
||||
frame_rate->setEnabled(enable_frame_rate);
|
||||
frame_rate->set_default_value(default_frame_rate);
|
||||
frame_rate->set_value(current_frame_rate, false);
|
||||
percent->set_value(current_percent, false);
|
||||
duration->set_default_value(default_length);
|
||||
duration->set_value((current_length == -1) ? qSNaN() : current_length, false);
|
||||
frame_rate->SetDefault(default_frame_rate);
|
||||
frame_rate->SetValue(current_frame_rate);
|
||||
percent->SetValue(current_percent);
|
||||
duration->SetDefault(default_length);
|
||||
duration->SetValue((current_length == -1) ? qSNaN() : current_length);
|
||||
|
||||
exec();
|
||||
}
|
||||
@@ -213,8 +213,8 @@ void SpeedDialog::percent_update() {
|
||||
}
|
||||
}
|
||||
|
||||
frame_rate->set_value(fr_val, false);
|
||||
duration->set_value((len_val == -1) ? qSNaN() : len_val, false);
|
||||
frame_rate->SetValue(fr_val);
|
||||
duration->SetValue((len_val == -1) ? qSNaN() : len_val);
|
||||
}
|
||||
|
||||
void SpeedDialog::duration_update() {
|
||||
@@ -248,8 +248,8 @@ void SpeedDialog::duration_update() {
|
||||
}
|
||||
}
|
||||
|
||||
frame_rate->set_value(fr_val, false);
|
||||
percent->set_value(pc_val, false);
|
||||
frame_rate->SetValue(fr_val);
|
||||
percent->SetValue(pc_val);
|
||||
}
|
||||
|
||||
void SpeedDialog::frame_rate_update() {
|
||||
@@ -312,8 +312,8 @@ void SpeedDialog::frame_rate_update() {
|
||||
}
|
||||
}
|
||||
|
||||
percent->set_value(pc_val, false);
|
||||
duration->set_value((len_val == -1) ? qSNaN() : len_val, false);
|
||||
percent->SetValue(pc_val);
|
||||
duration->SetValue((len_val == -1) ? qSNaN() : len_val);
|
||||
}
|
||||
|
||||
void set_speed(ComboAction* ca, Clip* c, double speed, bool ripple, long& ep, long& lr) {
|
||||
@@ -321,7 +321,7 @@ void set_speed(ComboAction* ca, Clip* c, double speed, bool ripple, long& ep, lo
|
||||
|
||||
long proposed_out = c->timeline_out();
|
||||
double multiplier = (c->speed().value / speed);
|
||||
proposed_out = c->timeline_in() + (c->length() * multiplier);
|
||||
proposed_out = qRound(c->timeline_in() + (c->length() * multiplier));
|
||||
ca->append(new SetSpeedAction(c, speed));
|
||||
if (!ripple && proposed_out > c->timeline_out()) {
|
||||
for (int i=0;i<c->sequence->clips.size();i++) {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <QDialog>
|
||||
#include <QCheckBox>
|
||||
|
||||
#include "project/clip.h"
|
||||
#include "timeline/clip.h"
|
||||
#include "ui/labelslider.h"
|
||||
|
||||
class SpeedDialog : public QDialog
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SpeedDialog</class>
|
||||
<widget class="QDialog" name="SpeedDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>240</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>47</width>
|
||||
<height>13</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Speed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>50</y>
|
||||
<width>47</width>
|
||||
<height>13</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Frame Rate:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>80</y>
|
||||
<width>47</width>
|
||||
<height>13</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Duration:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SpeedDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>SpeedDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user