merge of long discussed new pipeline
This commit is contained in:
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "panels/panels.h"
|
||||
#include "panels/timeline.h"
|
||||
|
||||
AutoCutSilenceDialog::AutoCutSilenceDialog(QWidget *parent, QVector<int> clips) :
|
||||
AutoCutSilenceDialog::AutoCutSilenceDialog(QWidget *parent, QVector<Clip*> clips) :
|
||||
QDialog(parent),
|
||||
clips_(clips)
|
||||
{
|
||||
@@ -124,16 +124,16 @@ void AutoCutSilenceDialog::cut_silence() {
|
||||
// Loop over clips provided to this dialog
|
||||
for (int j=0;j<clips_.size();j++) {
|
||||
|
||||
Clip* clip = olive::ActiveSequence->clips.at(clips_.at(j)).get();
|
||||
Clip* clip = clips_.at(j);
|
||||
|
||||
// Check if this clip is an audio footage clip
|
||||
if (clip->track() >= 0
|
||||
if (clip->type() == olive::kTypeAudio
|
||||
&& clip->media() != nullptr
|
||||
&& clip->media_stream()->preview_done) { // TODO provide warning for preview not being done
|
||||
|
||||
QVector<long> split_positions;
|
||||
|
||||
int clip_start = clip->timeline_in();
|
||||
long clip_start = clip->timeline_in();
|
||||
const FootageStream* ms = clip->media_stream();
|
||||
|
||||
long media_length = clip->media_length();
|
||||
@@ -156,7 +156,7 @@ void AutoCutSilenceDialog::cut_silence() {
|
||||
|
||||
// read the current sample into the circular array
|
||||
qint8 tmp = 0;
|
||||
for (int k=start; k<start+chunk_size; k++){
|
||||
for (long k=start; k<start+chunk_size; k++){
|
||||
tmp = qMax(tmp, qint8(qRound(double(ms->audio_preview.at(k)))));
|
||||
}
|
||||
vols[circular_index] = tmp;
|
||||
@@ -202,13 +202,13 @@ void AutoCutSilenceDialog::cut_silence() {
|
||||
}
|
||||
}
|
||||
|
||||
panel_timeline->split_clip_at_positions(ca, clips_.at(j), split_positions);
|
||||
clip->track()->sequence()->SplitClipAtPositions(ca, clips_.at(j), split_positions);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ca->hasActions()) {
|
||||
olive::UndoStack.push(ca);
|
||||
olive::undo_stack.push(ca);
|
||||
} else {
|
||||
delete ca;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -31,7 +31,7 @@ class AutoCutSilenceDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AutoCutSilenceDialog(QWidget* parent, QVector<int> clips);
|
||||
AutoCutSilenceDialog(QWidget* parent, QVector<Clip*> clips);
|
||||
public slots:
|
||||
virtual int exec() override;
|
||||
private slots:
|
||||
@@ -39,7 +39,7 @@ private slots:
|
||||
private:
|
||||
void cut_silence();
|
||||
|
||||
QVector<int> clips_;
|
||||
QVector<Clip*> clips_;
|
||||
|
||||
LabelSlider* attack_threshold;
|
||||
LabelSlider* release_threshold;
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "clippropertiesdialog.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
@@ -72,7 +92,7 @@ ClipPropertiesDialog::ClipPropertiesDialog(QWidget *parent, QVector<Clip *> clip
|
||||
}
|
||||
|
||||
// it's assumed all the clips come from the same sequence
|
||||
duration_field_->SetFrameRate(first_clip->sequence->frame_rate);
|
||||
duration_field_->SetFrameRate(first_clip->track()->sequence()->frame_rate);
|
||||
|
||||
if (all_clips_have_same_duration) {
|
||||
duration_field_->SetDefault(first_clip->length());
|
||||
@@ -104,7 +124,7 @@ void ClipPropertiesDialog::accept()
|
||||
long clip_duration_rounded = qRound(clip_duration);
|
||||
|
||||
if (clip->length() != clip_duration_rounded) {
|
||||
clip->move(ca,
|
||||
clip->Move(ca,
|
||||
clip->timeline_in(),
|
||||
clip->timeline_in() + clip_duration_rounded,
|
||||
clip->clip_in(),
|
||||
@@ -115,7 +135,7 @@ void ClipPropertiesDialog::accept()
|
||||
}
|
||||
|
||||
if (ca->hasActions()) {
|
||||
olive::UndoStack.push(ca);
|
||||
olive::undo_stack.push(ca);
|
||||
update_ui(false);
|
||||
} else {
|
||||
delete ca;
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#ifndef CLIPPROPERTIESDIALOG_H
|
||||
#define CLIPPROPERTIESDIALOG_H
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+32
-30
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -68,14 +68,15 @@ enum ExportFormats {
|
||||
FORMAT_SIZE
|
||||
};
|
||||
|
||||
ExportDialog::ExportDialog(QWidget *parent) :
|
||||
QDialog(parent)
|
||||
ExportDialog::ExportDialog(QWidget *parent, Sequence* sequence) :
|
||||
QDialog(parent),
|
||||
sequence_(sequence)
|
||||
{
|
||||
setWindowTitle(tr("Export \"%1\"").arg(olive::ActiveSequence->name));
|
||||
setWindowTitle(tr("Export \"%1\"").arg(sequence->name));
|
||||
setup_ui();
|
||||
|
||||
rangeCombobox->setCurrentIndex(0);
|
||||
if (olive::ActiveSequence->using_workarea) {
|
||||
if (sequence->using_workarea) {
|
||||
rangeCombobox->setEnabled(true);
|
||||
rangeCombobox->setCurrentIndex(1);
|
||||
}
|
||||
@@ -109,10 +110,10 @@ ExportDialog::ExportDialog(QWidget *parent) :
|
||||
formatCombobox->setCurrentIndex(FORMAT_MPEG4);
|
||||
|
||||
// default to sequence's native dimensions
|
||||
widthSpinbox->setValue(olive::ActiveSequence->width);
|
||||
heightSpinbox->setValue(olive::ActiveSequence->height);
|
||||
samplingRateSpinbox->setValue(olive::ActiveSequence->audio_frequency);
|
||||
framerateSpinbox->setValue(olive::ActiveSequence->frame_rate);
|
||||
widthSpinbox->setValue(sequence->width);
|
||||
heightSpinbox->setValue(sequence->height);
|
||||
samplingRateSpinbox->setValue(sequence->audio_frequency);
|
||||
framerateSpinbox->setValue(sequence->frame_rate);
|
||||
|
||||
// set some advanced defaults
|
||||
vcodec_params.threads = 0;
|
||||
@@ -351,8 +352,8 @@ void ExportDialog::export_thread_finished() {
|
||||
prep_ui_for_render(false);
|
||||
|
||||
// Move OpenGL context back to the sequence viewer
|
||||
panel_sequence_viewer->viewer_widget->makeCurrent();
|
||||
panel_sequence_viewer->viewer_widget->initializeGL();
|
||||
panel_sequence_viewer->viewer_widget()->makeCurrent();
|
||||
panel_sequence_viewer->viewer_widget()->initializeGL();
|
||||
|
||||
// Update the application UI
|
||||
update_ui(false);
|
||||
@@ -537,6 +538,7 @@ void ExportDialog::StartExport() {
|
||||
|
||||
// Set up export parameters to send to the ExportThread
|
||||
ExportParams params;
|
||||
params.sequence = sequence_;
|
||||
params.filename = filename;
|
||||
params.video_enabled = videoGroupbox->isChecked();
|
||||
if (params.video_enabled) {
|
||||
@@ -555,10 +557,10 @@ void ExportDialog::StartExport() {
|
||||
}
|
||||
|
||||
params.start_frame = 0;
|
||||
params.end_frame = olive::ActiveSequence->getEndFrame(); // entire sequence
|
||||
params.end_frame = sequence_->GetEndFrame(); // entire sequence
|
||||
if (rangeCombobox->currentIndex() == 1) {
|
||||
params.start_frame = qMax(olive::ActiveSequence->workarea_in, params.start_frame);
|
||||
params.end_frame = qMin(olive::ActiveSequence->workarea_out, params.end_frame);
|
||||
params.start_frame = qMax(sequence_->workarea_in, params.start_frame);
|
||||
params.end_frame = qMin(sequence_->workarea_out, params.end_frame);
|
||||
}
|
||||
|
||||
// Create export thread
|
||||
@@ -572,10 +574,10 @@ void ExportDialog::StartExport() {
|
||||
// Close all effects in effect controls (prevents UI threading issues)
|
||||
panel_effect_controls->Clear();
|
||||
|
||||
olive::Global->set_rendering_state(true);
|
||||
|
||||
// Close all currently open clips
|
||||
close_active_clips(olive::ActiveSequence.get());
|
||||
sequence_->Close();
|
||||
|
||||
olive::Global->set_export_state(true);
|
||||
|
||||
olive::Global->save_autorecovery_file();
|
||||
|
||||
@@ -654,11 +656,11 @@ void ExportDialog::comp_type_changed(int) {
|
||||
case COMPRESSION_TYPE_CBR:
|
||||
case COMPRESSION_TYPE_TARGETBR:
|
||||
videoBitrateLabel->setText(tr("Bitrate (Mbps):"));
|
||||
videobitrateSpinbox->setValue(qMax(0.5, (double) qRound((0.01528 * olive::ActiveSequence->height) - 4.5)));
|
||||
videobitrateSpinbox->setValue(qMax(0.5, (double) qRound((0.01528 * sequence_->height) - 4.5)));
|
||||
break;
|
||||
case COMPRESSION_TYPE_CFR:
|
||||
videoBitrateLabel->setText(tr("Quality (CRF):"));
|
||||
videobitrateSpinbox->setValue(36);
|
||||
videobitrateSpinbox->setValue(23);
|
||||
videobitrateSpinbox->setMaximum(51);
|
||||
videobitrateSpinbox->setToolTip(tr("Quality Factor:\n\n0 = lossless\n17-18 = visually lossless (compressed, but unnoticeable)\n23 = high quality\n51 = lowest quality possible"));
|
||||
break;
|
||||
|
||||
+15
-13
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
*
|
||||
* QWidget parent. Usually MainWindow.
|
||||
*/
|
||||
explicit ExportDialog(QWidget *parent);
|
||||
explicit ExportDialog(QWidget *parent, Sequence *sequence);
|
||||
|
||||
private slots:
|
||||
/**
|
||||
@@ -270,6 +270,8 @@ private:
|
||||
* @brief Time value set when exporting begins to determine the total duration of the export
|
||||
*/
|
||||
qint64 total_export_time_start;
|
||||
|
||||
Sequence* sequence_;
|
||||
};
|
||||
|
||||
#endif // EXPORTDIALOG_H
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <QListWidget>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <OpenColorIO/OpenColorIO.h>
|
||||
namespace OCIO = OCIO_NAMESPACE::v1;
|
||||
|
||||
#include "project/footage.h"
|
||||
#include "project/media.h"
|
||||
@@ -103,7 +105,7 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
|
||||
|
||||
// premultiplied alpha mode
|
||||
premultiply_alpha_setting = new QCheckBox(tr("Alpha is Premultiplied"), this);
|
||||
premultiply_alpha_setting->setChecked(f->alpha_is_premultiplied);
|
||||
premultiply_alpha_setting->setChecked(f->alpha_is_associated);
|
||||
grid->addWidget(premultiply_alpha_setting, row, 0);
|
||||
|
||||
row++;
|
||||
@@ -112,12 +114,12 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
|
||||
interlacing_box = new QComboBox(this);
|
||||
interlacing_box->addItem(
|
||||
tr("Auto (%1)").arg(
|
||||
get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing)
|
||||
Footage::get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing)
|
||||
)
|
||||
);
|
||||
interlacing_box->addItem(get_interlacing_name(VIDEO_PROGRESSIVE));
|
||||
interlacing_box->addItem(get_interlacing_name(VIDEO_TOP_FIELD_FIRST));
|
||||
interlacing_box->addItem(get_interlacing_name(VIDEO_BOTTOM_FIELD_FIRST));
|
||||
interlacing_box->addItem(Footage::get_interlacing_name(VIDEO_PROGRESSIVE));
|
||||
interlacing_box->addItem(Footage::get_interlacing_name(VIDEO_TOP_FIELD_FIRST));
|
||||
interlacing_box->addItem(Footage::get_interlacing_name(VIDEO_BOTTOM_FIELD_FIRST));
|
||||
|
||||
interlacing_box->setCurrentIndex(
|
||||
(f->video_tracks.at(0).video_auto_interlacing == f->video_tracks.at(0).video_interlacing)
|
||||
@@ -128,6 +130,28 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
|
||||
grid->addWidget(interlacing_box, row, 1);
|
||||
|
||||
row++;
|
||||
|
||||
input_color_space = new QComboBox(this);
|
||||
|
||||
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
|
||||
|
||||
QString footage_colorspace = f->Colorspace();
|
||||
|
||||
for (int i=0;i<config->getNumColorSpaces();i++) {
|
||||
QString colorspace = config->getColorSpaceNameByIndex(i);
|
||||
|
||||
input_color_space->addItem(colorspace);
|
||||
|
||||
if (colorspace == footage_colorspace) {
|
||||
input_color_space->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
grid->addWidget(new QLabel(tr("Color Space:")), row, 0);
|
||||
grid->addWidget(input_color_space, row, 1);
|
||||
|
||||
row++;
|
||||
|
||||
}
|
||||
|
||||
name_box = new QLineEdit(item->get_name(), this);
|
||||
@@ -192,9 +216,11 @@ void MediaPropertiesDialog::accept() {
|
||||
}
|
||||
|
||||
// set premultiplied alpha
|
||||
f->alpha_is_premultiplied = premultiply_alpha_setting->isChecked();
|
||||
f->alpha_is_associated = premultiply_alpha_setting->isChecked();
|
||||
}
|
||||
|
||||
f->SetColorspace(input_color_space->currentText());
|
||||
|
||||
// set name
|
||||
MediaRename* mr = new MediaRename(item, name_box->text());
|
||||
|
||||
@@ -206,7 +232,7 @@ void MediaPropertiesDialog::accept() {
|
||||
}
|
||||
ca->appendPost(new UpdateViewer());
|
||||
|
||||
olive::UndoStack.push(ca);
|
||||
olive::undo_stack.push(ca);
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -82,6 +82,11 @@ private:
|
||||
* @brief Setting for associated/premultiplied alpha
|
||||
*/
|
||||
QCheckBox* premultiply_alpha_setting;
|
||||
|
||||
/**
|
||||
* @brief Setting for this media's color space
|
||||
*/
|
||||
QComboBox* input_color_space;
|
||||
private slots:
|
||||
/**
|
||||
* @brief Overridden accept function for saving the properties back to the Media class
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -108,8 +108,8 @@ void NewSequenceDialog::accept() {
|
||||
s->audio_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
ComboAction* ca = new ComboAction();
|
||||
panel_project->create_sequence_internal(ca, s, true, nullptr);
|
||||
olive::UndoStack.push(ca);
|
||||
olive::project_model.CreateSequence(ca, s, true, nullptr);
|
||||
olive::undo_stack.push(ca);
|
||||
|
||||
} else if (existing_item != nullptr) {
|
||||
|
||||
@@ -128,14 +128,12 @@ void NewSequenceDialog::accept() {
|
||||
esc->audio_layout = AV_CH_LAYOUT_STEREO;
|
||||
ca->append(esc);
|
||||
|
||||
for (int i=0;i<existing_sequence->clips.size();i++) {
|
||||
ClipPtr c = existing_sequence->clips.at(i);
|
||||
if (c != nullptr) {
|
||||
c->refactor_frame_rate(ca, multiplier, true);
|
||||
}
|
||||
QVector<Clip*> existing_sequence_clips = existing_sequence->GetAllClips();
|
||||
for (int i=0;i<existing_sequence_clips.size();i++) {
|
||||
existing_sequence_clips.at(i)->refactor_frame_rate(ca, multiplier, true);
|
||||
}
|
||||
|
||||
olive::UndoStack.push(ca);
|
||||
olive::undo_stack.push(ca);
|
||||
|
||||
} else if (existing_sequence != nullptr) {
|
||||
|
||||
@@ -235,13 +233,13 @@ void NewSequenceDialog::setup_ui() {
|
||||
videoLayout->addWidget(new QLabel(tr("Width:"), this), 0, 0, 1, 1);
|
||||
width_numeric = new QSpinBox(videoGroupBox);
|
||||
width_numeric->setMaximum(9999);
|
||||
width_numeric->setValue(olive::CurrentConfig.default_sequence_width);
|
||||
width_numeric->setValue(olive::config.default_sequence_width);
|
||||
videoLayout->addWidget(width_numeric, 0, 2, 1, 2);
|
||||
|
||||
videoLayout->addWidget(new QLabel(tr("Height:"), this), 1, 0, 1, 2);
|
||||
height_numeric = new QSpinBox(videoGroupBox);
|
||||
height_numeric->setMaximum(9999);
|
||||
height_numeric->setValue(olive::CurrentConfig.default_sequence_height);
|
||||
height_numeric->setValue(olive::config.default_sequence_height);
|
||||
videoLayout->addWidget(height_numeric, 1, 2, 1, 2);
|
||||
|
||||
videoLayout->addWidget(new QLabel(tr("Frame Rate:"), this), 2, 0, 1, 1);
|
||||
@@ -258,7 +256,7 @@ void NewSequenceDialog::setup_ui() {
|
||||
frame_rate_combobox->addItem("59.94 FPS", 59.94);
|
||||
frame_rate_combobox->addItem("60 FPS", 60.0);
|
||||
for (int i=0;i<frame_rate_combobox->count();i++) {
|
||||
if (qFuzzyCompare(frame_rate_combobox->itemData(i).toDouble(), olive::CurrentConfig.default_sequence_framerate)) {
|
||||
if (qFuzzyCompare(frame_rate_combobox->itemData(i).toDouble(), olive::config.default_sequence_framerate)) {
|
||||
frame_rate_combobox->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
@@ -272,8 +270,6 @@ void NewSequenceDialog::setup_ui() {
|
||||
videoLayout->addWidget(new QLabel(tr("Interlacing:"), this), 6, 0, 1, 1);
|
||||
interlacing_combobox = new QComboBox(videoGroupBox);
|
||||
interlacing_combobox->addItem(tr("None (Progressive)"));
|
||||
// interlacing_combobox->addItem("Upper Field First");
|
||||
// interlacing_combobox->addItem("Lower Field First");
|
||||
videoLayout->addWidget(interlacing_combobox, 6, 2, 1, 2);
|
||||
|
||||
verticalLayout->addWidget(videoGroupBox);
|
||||
@@ -288,7 +284,7 @@ void NewSequenceDialog::setup_ui() {
|
||||
audio_frequency_combobox = new QComboBox(audioGroupBox);
|
||||
combobox_audio_sample_rates(audio_frequency_combobox);
|
||||
for (int i=0;i<audio_frequency_combobox->count();i++) {
|
||||
if (audio_frequency_combobox->itemData(i) == olive::CurrentConfig.default_sequence_audio_frequency) {
|
||||
if (audio_frequency_combobox->itemData(i) == olive::config.default_sequence_audio_frequency) {
|
||||
audio_frequency_combobox->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+437
-118
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "global/config.h"
|
||||
#include "global/path.h"
|
||||
#include "rendering/audio.h"
|
||||
#include "rendering/pixelformats.h"
|
||||
#include "panels/panels.h"
|
||||
#include "ui/columnedgridlayout.h"
|
||||
#include "ui/mainwindow.h"
|
||||
@@ -89,11 +90,11 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :
|
||||
|
||||
// set up default sequence
|
||||
default_sequence.name = tr("Default Sequence");
|
||||
default_sequence.width = olive::CurrentConfig.default_sequence_width;
|
||||
default_sequence.height = olive::CurrentConfig.default_sequence_height;
|
||||
default_sequence.frame_rate = olive::CurrentConfig.default_sequence_framerate;
|
||||
default_sequence.audio_frequency = olive::CurrentConfig.default_sequence_audio_frequency;
|
||||
default_sequence.audio_layout = olive::CurrentConfig.default_sequence_audio_channel_layout;
|
||||
default_sequence.width = olive::config.default_sequence_width;
|
||||
default_sequence.height = olive::config.default_sequence_height;
|
||||
default_sequence.frame_rate = olive::config.default_sequence_framerate;
|
||||
default_sequence.audio_frequency = olive::config.default_sequence_audio_frequency;
|
||||
default_sequence.audio_layout = olive::config.default_sequence_audio_channel_layout;
|
||||
}
|
||||
|
||||
void PreferencesDialog::setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent) {
|
||||
@@ -118,12 +119,28 @@ void PreferencesDialog::setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem*
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::delete_previews(char type) {
|
||||
if (type != 't' && type != 'w' && type != 1) return;
|
||||
void PreferencesDialog::delete_previews(PreviewDeleteTypes type) {
|
||||
char delete_char = 0;
|
||||
|
||||
switch (type) {
|
||||
case DELETE_WAVEFORMS:
|
||||
delete_char = 'w';
|
||||
break;
|
||||
case DELETE_THUMBNAILS:
|
||||
delete_char = 't';
|
||||
break;
|
||||
case DELETE_BOTH:
|
||||
delete_char = 1;
|
||||
break;
|
||||
case DELETE_NONE:
|
||||
break;
|
||||
}
|
||||
|
||||
if (delete_char != 't' && delete_char != 'w' && delete_char != 1) return;
|
||||
|
||||
QDir preview_path(get_data_path() + "/previews");
|
||||
|
||||
if (type == 1) {
|
||||
if (delete_char == 1) {
|
||||
// indiscriminately delete everything
|
||||
preview_path.removeRecursively();
|
||||
} else {
|
||||
@@ -144,13 +161,124 @@ void PreferencesDialog::delete_previews(char type) {
|
||||
|
||||
// thumbnails will have a 't' towards the end of the filenames, waveforms will have a 'w'
|
||||
// if they match the type of preview we're deleting, remove them
|
||||
if (preview_file_str.at(identifier_char_index) == type) {
|
||||
if (preview_file_str.at(identifier_char_index) == delete_char) {
|
||||
QFile::remove(preview_path.filePath(preview_file_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::populate_ocio_menus(OCIO::ConstConfigRcPtr config)
|
||||
{
|
||||
if (!config) {
|
||||
|
||||
// Just clear everything
|
||||
ocio_display->clear();
|
||||
ocio_default_input->clear();
|
||||
ocio_view->clear();
|
||||
ocio_look->clear();
|
||||
|
||||
} else {
|
||||
|
||||
// Get input color spaces for setting the default input color space
|
||||
ocio_default_input->clear();
|
||||
for (int i=0;i<config->getNumColorSpaces();i++) {
|
||||
QString colorspace = config->getColorSpaceNameByIndex(i);
|
||||
|
||||
ocio_default_input->addItem(colorspace);
|
||||
|
||||
if (colorspace == olive::config.ocio_default_input_colorspace) {
|
||||
ocio_default_input->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
// Get current display name (if the config is empty, get the current default display)
|
||||
QString current_display = olive::config.ocio_display;
|
||||
if (current_display.isEmpty()) {
|
||||
current_display = config->getDefaultDisplay();
|
||||
}
|
||||
|
||||
// Populate the display menu
|
||||
ocio_display->clear();
|
||||
for (int i=0;i<config->getNumDisplays();i++) {
|
||||
ocio_display->addItem(config->getDisplay(i));
|
||||
|
||||
// Check if this index is the currently selected
|
||||
if (config->getDisplay(i) == current_display) {
|
||||
ocio_display->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
update_ocio_view_menu(config);
|
||||
|
||||
// Populate the look menu
|
||||
ocio_look->clear();
|
||||
ocio_look->addItem(tr("(None)"), QString());
|
||||
for (int i=0;i<config->getNumLooks();i++) {
|
||||
const char* look = config->getLookNameByIndex(i);
|
||||
|
||||
ocio_look->addItem(look, look);
|
||||
|
||||
if (look == olive::config.ocio_look) {
|
||||
ocio_look->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
OCIO::ConstConfigRcPtr PreferencesDialog::TestOCIOConfig(const QString &url)
|
||||
{
|
||||
// Check whether OCIO can load it
|
||||
OCIO::ConstConfigRcPtr config;
|
||||
try {
|
||||
config = OCIO::Config::CreateFromFile(url.toUtf8());
|
||||
} catch (OCIO::Exception& e) {
|
||||
QMessageBox::critical(this,
|
||||
tr("OpenColorIO Config Error"),
|
||||
tr("Failed to set OpenColorIO configuration: %1").arg(e.what()),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
void PreferencesDialog::update_ocio_view_menu(OCIO::ConstConfigRcPtr config)
|
||||
{
|
||||
|
||||
// Get views for the current display set in `ocio_display`
|
||||
QString display = ocio_display->currentText();
|
||||
|
||||
// Get current view
|
||||
QString current_view = olive::config.ocio_view;
|
||||
if (current_view.isEmpty()) {
|
||||
current_view = config->getDefaultView(display.toUtf8());
|
||||
}
|
||||
|
||||
// Populate the view menu
|
||||
int ocio_view_count = config->getNumViews(display.toUtf8());
|
||||
ocio_view->clear();
|
||||
for (int i=0;i<ocio_view_count;i++) {
|
||||
const char* view = config->getView(display.toUtf8(), i);
|
||||
|
||||
ocio_view->addItem(view);
|
||||
|
||||
if (current_view == view) {
|
||||
ocio_view->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::update_ocio_config(const QString &s)
|
||||
{
|
||||
OCIO::ConstConfigRcPtr file_config;
|
||||
|
||||
if (!s.isEmpty() && QFileInfo::exists(s)) {
|
||||
file_config = TestOCIOConfig(s);
|
||||
}
|
||||
|
||||
populate_ocio_menus(file_config);
|
||||
}
|
||||
|
||||
void PreferencesDialog::AddBoolPair(QCheckBox *ui, bool *value, bool restart_required)
|
||||
{
|
||||
bool_ui.append(ui);
|
||||
@@ -188,6 +316,8 @@ void PreferencesDialog::accept() {
|
||||
bool reinit_audio = false;
|
||||
bool reload_language = false;
|
||||
bool reload_effects = false;
|
||||
bool reset_ocio_shaders = false;
|
||||
bool reset_render_threads = false;
|
||||
|
||||
// Validate whether the specified CSS file exists
|
||||
if (!custom_css_fn->text().isEmpty() && !QFileInfo::exists(custom_css_fn->text())) {
|
||||
@@ -199,11 +329,41 @@ void PreferencesDialog::accept() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate whether the effects panel should refresh itself
|
||||
if (olive::CurrentConfig.effect_textbox_lines != effect_textbox_lines_field->value()) {
|
||||
reload_effects = true;
|
||||
// Validate whether the chosen OCIO configuration file
|
||||
if (enable_color_management->isChecked()) {
|
||||
|
||||
// Check whether the file exists
|
||||
if (!QFileInfo::exists(ocio_config_file->text())) {
|
||||
|
||||
QString msg_title = tr("Invalid OpenColorIO Configuration File");
|
||||
QString msg_body;
|
||||
|
||||
if (ocio_config_file->text().isEmpty()) {
|
||||
msg_body = tr("You must specify an OpenColorIO configuration file if color management is enabled.");
|
||||
} else {
|
||||
msg_body = tr("OpenColorIO configuration file '%1' does not exist.").arg(ocio_config_file->text());
|
||||
}
|
||||
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
msg_title,
|
||||
msg_body
|
||||
);
|
||||
return;
|
||||
|
||||
} else if (olive::config.ocio_config_path != ocio_config_file->text()) {
|
||||
|
||||
// Check whether OCIO can load it
|
||||
OCIO::ConstConfigRcPtr file_config = TestOCIOConfig(ocio_config_file->text().toUtf8());
|
||||
|
||||
if (!file_config) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Validate whether one of the bool options requires a restart
|
||||
bool bool_requires_restart = false;
|
||||
for (int i=0;i<bool_restart_required.size();i++) {
|
||||
if (bool_restart_required.at(i)
|
||||
@@ -213,12 +373,12 @@ void PreferencesDialog::accept() {
|
||||
}
|
||||
}
|
||||
|
||||
// Check if any settings will require a restart of Olive
|
||||
// Check if any settings will require a restart of Olive (including the bool options determined above)
|
||||
if (bool_requires_restart
|
||||
|| olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value()
|
||||
|| olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()
|
||||
|| olive::CurrentConfig.css_path != custom_css_fn->text()
|
||||
|| olive::CurrentConfig.style != static_cast<olive::styling::Style>(ui_style->currentData().toInt())) {
|
||||
|| olive::config.thumbnail_resolution != thumbnail_res_spinbox->value()
|
||||
|| olive::config.waveform_resolution != waveform_res_spinbox->value()
|
||||
|| olive::config.css_path != custom_css_fn->text()
|
||||
|| olive::config.style != static_cast<olive::styling::Style>(ui_style->currentData().toInt())) {
|
||||
|
||||
// any changes to these settings will require a restart - ask the user if we should do one now or later
|
||||
|
||||
@@ -244,78 +404,107 @@ void PreferencesDialog::accept() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Everything checks out, start saving settings from the UI to the backend
|
||||
olive::config.css_path = custom_css_fn->text();
|
||||
olive::config.recording_mode = recordingComboBox->currentIndex() + 1;
|
||||
olive::config.img_seq_formats = imgSeqFormatEdit->text();
|
||||
olive::config.upcoming_queue_size = upcoming_queue_spinbox->value();
|
||||
olive::config.upcoming_queue_type = upcoming_queue_type->currentIndex();
|
||||
olive::config.previous_queue_size = previous_queue_spinbox->value();
|
||||
olive::config.previous_queue_type = previous_queue_type->currentIndex();
|
||||
|
||||
// Audio settings may require the audio device to be re-initiated.
|
||||
if (olive::CurrentConfig.preferred_audio_output != audio_output_devices->currentData().toString()
|
||||
|| olive::CurrentConfig.preferred_audio_input != audio_input_devices->currentData().toString()
|
||||
|| olive::CurrentConfig.audio_rate != audio_sample_rate->currentData().toInt()) {
|
||||
if (olive::config.preferred_audio_output != audio_output_devices->currentData().toString()
|
||||
|| olive::config.preferred_audio_input != audio_input_devices->currentData().toString()
|
||||
|| olive::config.audio_rate != audio_sample_rate->currentData().toInt()) {
|
||||
reinit_audio = true;
|
||||
}
|
||||
olive::config.preferred_audio_output = audio_output_devices->currentData().toString();
|
||||
olive::config.preferred_audio_input = audio_input_devices->currentData().toString();
|
||||
olive::config.audio_rate = audio_sample_rate->currentData().toInt();
|
||||
|
||||
olive::config.effect_textbox_lines = effect_textbox_lines_field->value();
|
||||
|
||||
// see if the language file should be reloaded (not necessary if the app is restarting anyway)
|
||||
if (!restart_after_saving
|
||||
&& olive::CurrentConfig.language_file != language_combobox->currentData().toString()) {
|
||||
&& olive::config.language_file != language_combobox->currentData().toString()) {
|
||||
reload_language = true;
|
||||
}
|
||||
olive::config.language_file = language_combobox->currentData().toString();
|
||||
|
||||
// save settings from UI to backend
|
||||
olive::CurrentConfig.css_path = custom_css_fn->text();
|
||||
olive::CurrentConfig.recording_mode = recordingComboBox->currentIndex() + 1;
|
||||
olive::CurrentConfig.img_seq_formats = imgSeqFormatEdit->text();
|
||||
olive::CurrentConfig.upcoming_queue_size = upcoming_queue_spinbox->value();
|
||||
olive::CurrentConfig.upcoming_queue_type = upcoming_queue_type->currentIndex();
|
||||
olive::CurrentConfig.previous_queue_size = previous_queue_spinbox->value();
|
||||
olive::CurrentConfig.previous_queue_type = previous_queue_type->currentIndex();
|
||||
// Check whether OCIO settings will require a reset of the render threads
|
||||
if (olive::config.playback_bit_depth != playback_bit_depth->currentIndex()
|
||||
|| olive::config.export_bit_depth != export_bit_depth->currentIndex()) {
|
||||
reset_render_threads = true;
|
||||
}
|
||||
if (olive::config.ocio_config_path != ocio_config_file->text()
|
||||
|| olive::config.ocio_display != ocio_display->currentText()
|
||||
|| olive::config.ocio_view != ocio_view->currentText()
|
||||
|| olive::config.ocio_look != ocio_look->currentData().toString()) {
|
||||
reset_ocio_shaders = true;
|
||||
}
|
||||
if (olive::config.ocio_config_path != ocio_config_file->text()) {
|
||||
OCIO::SetCurrentConfig(OCIO::Config::CreateFromFile(ocio_config_file->text().toUtf8()));
|
||||
olive::config.ocio_config_path = ocio_config_file->text();
|
||||
}
|
||||
olive::config.enable_color_management = enable_color_management->isChecked();
|
||||
olive::config.playback_bit_depth = playback_bit_depth->currentIndex();
|
||||
olive::config.export_bit_depth = export_bit_depth->currentIndex();
|
||||
olive::config.ocio_display = ocio_display->currentText();
|
||||
olive::config.ocio_default_input_colorspace = ocio_default_input->currentText();
|
||||
olive::config.ocio_view = ocio_view->currentText();
|
||||
|
||||
olive::CurrentConfig.preferred_audio_output = audio_output_devices->currentData().toString();
|
||||
olive::CurrentConfig.preferred_audio_input = audio_input_devices->currentData().toString();
|
||||
olive::CurrentConfig.audio_rate = audio_sample_rate->currentData().toInt();
|
||||
// We use data here instead of text because there's a "(None)" option with an empty string
|
||||
olive::config.ocio_look = ocio_look->currentData().toString();
|
||||
|
||||
olive::CurrentConfig.effect_textbox_lines = effect_textbox_lines_field->value();
|
||||
olive::CurrentConfig.language_file = language_combobox->currentData().toString();
|
||||
|
||||
olive::CurrentConfig.default_sequence_width = default_sequence.width;
|
||||
olive::CurrentConfig.default_sequence_height = default_sequence.height;
|
||||
olive::CurrentConfig.default_sequence_framerate = default_sequence.frame_rate;
|
||||
olive::CurrentConfig.default_sequence_audio_frequency = default_sequence.audio_frequency;
|
||||
olive::CurrentConfig.default_sequence_audio_channel_layout = default_sequence.audio_layout;
|
||||
// Set default sequence options
|
||||
olive::config.default_sequence_width = default_sequence.width;
|
||||
olive::config.default_sequence_height = default_sequence.height;
|
||||
olive::config.default_sequence_framerate = default_sequence.frame_rate;
|
||||
olive::config.default_sequence_audio_frequency = default_sequence.audio_frequency;
|
||||
olive::config.default_sequence_audio_channel_layout = default_sequence.audio_layout;
|
||||
|
||||
// Set all bool options
|
||||
for (int i=0;i<bool_ui.size();i++) {
|
||||
*bool_value[i] = bool_ui.at(i)->isChecked();
|
||||
}
|
||||
|
||||
olive::CurrentConfig.style = static_cast<olive::styling::Style>(ui_style->currentData().toInt());
|
||||
// Set new style
|
||||
olive::config.style = static_cast<olive::styling::Style>(ui_style->currentData().toInt());
|
||||
|
||||
// Check if the thumbnail or waveform icon
|
||||
if (olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value()
|
||||
|| olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) {
|
||||
// Check if the thumbnail or waveform icon fields have changed, we may need to recreate the previews if so
|
||||
if (olive::config.thumbnail_resolution != thumbnail_res_spinbox->value()
|
||||
|| olive::config.waveform_resolution != waveform_res_spinbox->value()) {
|
||||
// we're changing the size of thumbnails and waveforms, so let's delete them and regenerate them next start
|
||||
|
||||
// delete nothing
|
||||
char delete_match = 0;
|
||||
PreviewDeleteTypes delete_type = DELETE_NONE;
|
||||
|
||||
if (olive::CurrentConfig.thumbnail_resolution != thumbnail_res_spinbox->value()) {
|
||||
if (olive::config.thumbnail_resolution != thumbnail_res_spinbox->value()) {
|
||||
// delete existing thumbnails
|
||||
olive::CurrentConfig.thumbnail_resolution = thumbnail_res_spinbox->value();
|
||||
olive::config.thumbnail_resolution = thumbnail_res_spinbox->value();
|
||||
|
||||
// delete only thumbnails
|
||||
delete_match = 't';
|
||||
delete_type = DELETE_THUMBNAILS;
|
||||
}
|
||||
|
||||
if (olive::CurrentConfig.waveform_resolution != waveform_res_spinbox->value()) {
|
||||
if (olive::config.waveform_resolution != waveform_res_spinbox->value()) {
|
||||
// delete existing waveforms
|
||||
olive::CurrentConfig.waveform_resolution = waveform_res_spinbox->value();
|
||||
olive::config.waveform_resolution = waveform_res_spinbox->value();
|
||||
|
||||
// if we're already deleting thumbnails
|
||||
if (delete_match == 't') {
|
||||
if (delete_type == DELETE_THUMBNAILS) {
|
||||
// delete all
|
||||
delete_match = 1;
|
||||
delete_type = DELETE_BOTH;
|
||||
} else {
|
||||
// just delete waveforms
|
||||
delete_match = 'w';
|
||||
delete_type = DELETE_WAVEFORMS;
|
||||
}
|
||||
}
|
||||
|
||||
delete_previews(delete_match);
|
||||
delete_previews(delete_type);
|
||||
}
|
||||
|
||||
// Save keyboard shortcuts
|
||||
@@ -323,29 +512,46 @@ void PreferencesDialog::accept() {
|
||||
key_shortcut_fields.at(i)->set_action_shortcut();
|
||||
}
|
||||
|
||||
// Audio settings may require the audio device to be re-initiated.
|
||||
if (reinit_audio) {
|
||||
init_audio();
|
||||
}
|
||||
|
||||
if (reload_effects) {
|
||||
panel_effect_controls->Reload();
|
||||
}
|
||||
|
||||
// reload language file if it changed
|
||||
if (reload_language) {
|
||||
olive::Global->load_translation_from_config();
|
||||
}
|
||||
|
||||
QDialog::accept();
|
||||
|
||||
if (restart_after_saving) {
|
||||
|
||||
// since we already ran can_close_project(), bypass checking again by running set_modified(false)
|
||||
olive::Global->set_modified(false);
|
||||
|
||||
olive::MainWindow->close();
|
||||
|
||||
QProcess::startDetached(QApplication::applicationFilePath(), { olive::ActiveProjectFilename });
|
||||
} else {
|
||||
|
||||
// Audio settings may require the audio device to be re-initiated.
|
||||
if (reinit_audio) {
|
||||
init_audio();
|
||||
}
|
||||
|
||||
if (reload_effects) {
|
||||
panel_effect_controls->Reload();
|
||||
}
|
||||
|
||||
// reload language file if it changed
|
||||
if (reload_language) {
|
||||
olive::Global->load_translation_from_config();
|
||||
}
|
||||
|
||||
if (reset_render_threads) {
|
||||
if (panel_footage_viewer->seq != nullptr) {
|
||||
panel_footage_viewer->seq->Close();
|
||||
}
|
||||
panel_footage_viewer->viewer_widget()->get_renderer()->delete_ctx();
|
||||
if (panel_sequence_viewer->seq != nullptr) {
|
||||
panel_sequence_viewer->seq->Close();
|
||||
}
|
||||
panel_sequence_viewer->viewer_widget()->get_renderer()->delete_ctx();
|
||||
} else if (reset_ocio_shaders) {
|
||||
panel_footage_viewer->viewer_widget()->get_renderer()->destroy_ocio();
|
||||
panel_sequence_viewer->viewer_widget()->get_renderer()->destroy_ocio();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,15 +677,30 @@ void PreferencesDialog::browse_css_file() {
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::browse_ocio_config()
|
||||
{
|
||||
QString fn = QFileDialog::getOpenFileName(this, tr("Browse for OpenColorIO configuration"));
|
||||
if (!fn.isEmpty()) {
|
||||
ocio_config_file->setText(fn);
|
||||
enable_color_management->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::update_ocio_view_menu()
|
||||
{
|
||||
update_ocio_view_menu(OCIO::GetCurrentConfig());
|
||||
}
|
||||
|
||||
void PreferencesDialog::delete_all_previews() {
|
||||
if (QMessageBox::question(this,
|
||||
tr("Delete All Previews"),
|
||||
tr("Are you sure you want to delete all previews?"),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||
delete_previews(1);
|
||||
delete_previews(DELETE_BOTH);
|
||||
QMessageBox::information(this,
|
||||
tr("Previews Deleted"),
|
||||
tr("All previews deleted successfully. You may have to re-open your current project for changes to take effect."),
|
||||
tr("All previews deleted successfully. You may have to re-open your current project for "
|
||||
"changes to take effect."),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
@@ -528,7 +749,7 @@ void PreferencesDialog::setup_ui() {
|
||||
QString locale_str = locale_file_basename.mid(locale_file_basename.lastIndexOf('_')+1);
|
||||
language_combobox->addItem(QLocale(locale_str).nativeLanguageName(), locale_relative_path);
|
||||
|
||||
if (olive::CurrentConfig.language_file == locale_relative_path) {
|
||||
if (olive::config.language_file == locale_relative_path) {
|
||||
language_combobox->setCurrentIndex(language_combobox->count() - 1);
|
||||
}
|
||||
}
|
||||
@@ -543,8 +764,7 @@ void PreferencesDialog::setup_ui() {
|
||||
general_layout->addWidget(new QLabel(tr("Image sequence formats:"), this), row, 0);
|
||||
|
||||
imgSeqFormatEdit = new QLineEdit(general_tab);
|
||||
imgSeqFormatEdit->setText(olive::CurrentConfig.img_seq_formats);
|
||||
|
||||
imgSeqFormatEdit->setText(olive::config.img_seq_formats);
|
||||
general_layout->addWidget(imgSeqFormatEdit, row, 1, 1, 4);
|
||||
|
||||
row++;
|
||||
@@ -555,7 +775,7 @@ void PreferencesDialog::setup_ui() {
|
||||
thumbnail_res_spinbox = new QSpinBox(this);
|
||||
thumbnail_res_spinbox->setMinimum(0);
|
||||
thumbnail_res_spinbox->setMaximum(INT_MAX);
|
||||
thumbnail_res_spinbox->setValue(olive::CurrentConfig.thumbnail_resolution);
|
||||
thumbnail_res_spinbox->setValue(olive::config.thumbnail_resolution);
|
||||
general_layout->addWidget(thumbnail_res_spinbox, row, 1);
|
||||
|
||||
general_layout->addWidget(new QLabel(tr("Waveform Resolution:"), this), row, 2);
|
||||
@@ -563,7 +783,7 @@ void PreferencesDialog::setup_ui() {
|
||||
waveform_res_spinbox = new QSpinBox(this);
|
||||
waveform_res_spinbox->setMinimum(0);
|
||||
waveform_res_spinbox->setMaximum(INT_MAX);
|
||||
waveform_res_spinbox->setValue(olive::CurrentConfig.waveform_resolution);
|
||||
waveform_res_spinbox->setValue(olive::config.waveform_resolution);
|
||||
general_layout->addWidget(waveform_res_spinbox, row, 3);
|
||||
|
||||
QPushButton* delete_preview_btn = new QPushButton(tr("Delete Previews"));
|
||||
@@ -572,17 +792,27 @@ void PreferencesDialog::setup_ui() {
|
||||
|
||||
row++;
|
||||
|
||||
QHBoxLayout* misc_general = new QHBoxLayout();
|
||||
|
||||
// General -> Use Software Fallbacks When Possible
|
||||
QCheckBox* use_software_fallbacks_checkbox = new QCheckBox(tr("Use Software Fallbacks When Possible"));
|
||||
AddBoolPair(use_software_fallbacks_checkbox, &olive::CurrentConfig.use_software_fallback, true);
|
||||
general_layout->addWidget(use_software_fallbacks_checkbox, row, 0, 1, 4);
|
||||
AddBoolPair(use_software_fallbacks_checkbox, &olive::config.use_software_fallback, true);
|
||||
misc_general->addWidget(use_software_fallbacks_checkbox);
|
||||
|
||||
row++;
|
||||
// General -> Don't Use Proxies When Exporting
|
||||
QCheckBox* dont_use_proxies_when_exporting = new QCheckBox(tr("Don't Use Proxies When Exporting"));
|
||||
dont_use_proxies_when_exporting->setToolTip(tr("Use originals instead of proxies when exporting"));
|
||||
AddBoolPair(dont_use_proxies_when_exporting, &olive::config.dont_use_proxies_on_export);
|
||||
misc_general->addWidget(dont_use_proxies_when_exporting);
|
||||
|
||||
// General -> Default Sequence Settings
|
||||
QPushButton* default_sequence_settings = new QPushButton(tr("Default Sequence Settings"));
|
||||
connect(default_sequence_settings, SIGNAL(clicked(bool)), this, SLOT(edit_default_sequence_settings()));
|
||||
general_layout->addWidget(default_sequence_settings);
|
||||
misc_general->addWidget(default_sequence_settings);
|
||||
|
||||
general_layout->addLayout(misc_general, row, 0, 1, 5);
|
||||
|
||||
row++;
|
||||
|
||||
tabWidget->addTab(general_tab, tr("General"));
|
||||
|
||||
@@ -593,68 +823,68 @@ void PreferencesDialog::setup_ui() {
|
||||
ColumnedGridLayout* behavior_tab_layout = new ColumnedGridLayout(behavior_tab, 2);
|
||||
|
||||
QCheckBox* add_default_effects_to_clips = new QCheckBox(tr("Add Default Effects to New Clips"));
|
||||
AddBoolPair(add_default_effects_to_clips, &olive::CurrentConfig.add_default_effects_to_clips);
|
||||
AddBoolPair(add_default_effects_to_clips, &olive::config.add_default_effects_to_clips);
|
||||
behavior_tab_layout->Add(add_default_effects_to_clips);
|
||||
|
||||
QCheckBox* auto_seek_to_beginning = new QCheckBox(tr("Automatically Seek to the Beginning When Playing at the End of a Sequence"));
|
||||
AddBoolPair(auto_seek_to_beginning, &olive::CurrentConfig.auto_seek_to_beginning);
|
||||
AddBoolPair(auto_seek_to_beginning, &olive::config.auto_seek_to_beginning);
|
||||
behavior_tab_layout->Add(auto_seek_to_beginning);
|
||||
|
||||
QCheckBox* selecting_also_seeks = new QCheckBox(tr("Selecting Also Seeks"));
|
||||
AddBoolPair(selecting_also_seeks, &olive::CurrentConfig.select_also_seeks);
|
||||
AddBoolPair(selecting_also_seeks, &olive::config.select_also_seeks);
|
||||
behavior_tab_layout->Add(selecting_also_seeks);
|
||||
|
||||
QCheckBox* edit_tool_also_seeks = new QCheckBox(tr("Edit Tool Also Seeks"));
|
||||
AddBoolPair(edit_tool_also_seeks, &olive::CurrentConfig.edit_tool_also_seeks);
|
||||
AddBoolPair(edit_tool_also_seeks, &olive::config.edit_tool_also_seeks);
|
||||
behavior_tab_layout->Add(edit_tool_also_seeks);
|
||||
|
||||
QCheckBox* edit_tool_selects_links = new QCheckBox(tr("Edit Tool Selects Links"));
|
||||
AddBoolPair(edit_tool_selects_links, &olive::CurrentConfig.edit_tool_selects_links);
|
||||
AddBoolPair(edit_tool_selects_links, &olive::config.edit_tool_selects_links);
|
||||
behavior_tab_layout->Add(edit_tool_selects_links);
|
||||
|
||||
QCheckBox* seek_also_selects = new QCheckBox(tr("Seek Also Selects"));
|
||||
AddBoolPair(seek_also_selects, &olive::CurrentConfig.seek_also_selects);
|
||||
AddBoolPair(seek_also_selects, &olive::config.seek_also_selects);
|
||||
behavior_tab_layout->Add(seek_also_selects);
|
||||
|
||||
QCheckBox* seek_to_end_of_pastes = new QCheckBox(tr("Seek to the End of Pastes"));
|
||||
AddBoolPair(seek_to_end_of_pastes, &olive::CurrentConfig.paste_seeks);
|
||||
AddBoolPair(seek_to_end_of_pastes, &olive::config.paste_seeks);
|
||||
behavior_tab_layout->Add(seek_to_end_of_pastes);
|
||||
|
||||
QCheckBox* scroll_wheel_zooms = new QCheckBox(tr("Scroll Wheel Zooms"));
|
||||
scroll_wheel_zooms->setToolTip(tr("Hold CTRL to toggle this setting"));
|
||||
AddBoolPair(scroll_wheel_zooms, &olive::CurrentConfig.scroll_zooms);
|
||||
AddBoolPair(scroll_wheel_zooms, &olive::config.scroll_zooms);
|
||||
behavior_tab_layout->Add(scroll_wheel_zooms);
|
||||
|
||||
QCheckBox* invert_timeline_scroll_axes = new QCheckBox(tr("Invert Timeline Scroll Axes"));
|
||||
AddBoolPair(invert_timeline_scroll_axes, &olive::CurrentConfig.invert_timeline_scroll_axes);
|
||||
AddBoolPair(invert_timeline_scroll_axes, &olive::config.invert_timeline_scroll_axes);
|
||||
behavior_tab_layout->Add(invert_timeline_scroll_axes);
|
||||
|
||||
QCheckBox* enable_drag_files_to_timeline = new QCheckBox(tr("Enable Drag Files to Timeline"));
|
||||
AddBoolPair(enable_drag_files_to_timeline, &olive::CurrentConfig.enable_drag_files_to_timeline);
|
||||
AddBoolPair(enable_drag_files_to_timeline, &olive::config.enable_drag_files_to_timeline);
|
||||
behavior_tab_layout->Add(enable_drag_files_to_timeline);
|
||||
|
||||
QCheckBox* autoscale_by_default = new QCheckBox(tr("Auto-Scale By Default"));
|
||||
AddBoolPair(autoscale_by_default, &olive::CurrentConfig.autoscale_by_default);
|
||||
AddBoolPair(autoscale_by_default, &olive::config.autoscale_by_default);
|
||||
behavior_tab_layout->Add(autoscale_by_default);
|
||||
|
||||
QCheckBox* enable_seek_to_import = new QCheckBox(tr("Auto-Seek to Imported Clips"));
|
||||
AddBoolPair(enable_seek_to_import, &olive::CurrentConfig.enable_seek_to_import);
|
||||
AddBoolPair(enable_seek_to_import, &olive::config.enable_seek_to_import);
|
||||
behavior_tab_layout->Add(enable_seek_to_import);
|
||||
|
||||
QCheckBox* enable_audio_scrubbing = new QCheckBox(tr("Audio Scrubbing"));
|
||||
AddBoolPair(enable_audio_scrubbing, &olive::CurrentConfig.enable_audio_scrubbing);
|
||||
AddBoolPair(enable_audio_scrubbing, &olive::config.enable_audio_scrubbing);
|
||||
behavior_tab_layout->Add(enable_audio_scrubbing);
|
||||
|
||||
QCheckBox* enable_drop_on_media_to_replace = new QCheckBox(tr("Drop Files on Media to Replace"));
|
||||
AddBoolPair(enable_drop_on_media_to_replace, &olive::CurrentConfig.drop_on_media_to_replace);
|
||||
AddBoolPair(enable_drop_on_media_to_replace, &olive::config.drop_on_media_to_replace);
|
||||
behavior_tab_layout->Add(enable_drop_on_media_to_replace);
|
||||
|
||||
QCheckBox* enable_hover_focus = new QCheckBox(tr("Enable Hover Focus"));
|
||||
AddBoolPair(enable_hover_focus, &olive::CurrentConfig.hover_focus);
|
||||
AddBoolPair(enable_hover_focus, &olive::config.hover_focus);
|
||||
behavior_tab_layout->Add(enable_hover_focus);
|
||||
|
||||
QCheckBox* set_name_and_marker = new QCheckBox(tr("Ask For Name When Setting Marker"));
|
||||
AddBoolPair(set_name_and_marker, &olive::CurrentConfig.set_name_with_marker);
|
||||
AddBoolPair(set_name_and_marker, &olive::config.set_name_with_marker);
|
||||
behavior_tab_layout->Add(set_name_and_marker);
|
||||
|
||||
// Appearance
|
||||
@@ -673,7 +903,7 @@ void PreferencesDialog::setup_ui() {
|
||||
ui_style->addItem(tr("Olive Light"), olive::styling::kOliveDefaultLight);
|
||||
ui_style->addItem(tr("Native"), olive::styling::kNativeDarkIcons);
|
||||
ui_style->addItem(tr("Native (Light Icons)"), olive::styling::kNativeLightIcons);
|
||||
ui_style->setCurrentIndex(olive::CurrentConfig.style);
|
||||
ui_style->setCurrentIndex(olive::config.style);
|
||||
appearance_layout->addWidget(ui_style, row, 1, 1, 2);
|
||||
|
||||
row++;
|
||||
@@ -682,7 +912,7 @@ void PreferencesDialog::setup_ui() {
|
||||
// Native menu styling is only available on Windows. Environments like Ubuntu and Mac use the native menu system by
|
||||
// default
|
||||
QCheckBox* native_menus = new QCheckBox(tr("Use Native Menu Styling"));
|
||||
AddBoolPair(native_menus, &olive::CurrentConfig.use_native_menu_styling, true);
|
||||
AddBoolPair(native_menus, &olive::config.use_native_menu_styling, true);
|
||||
appearance_layout->addWidget(native_menus, row, 0, 1, 3);
|
||||
|
||||
row++;
|
||||
@@ -692,7 +922,7 @@ void PreferencesDialog::setup_ui() {
|
||||
appearance_layout->addWidget(new QLabel(tr("Custom CSS:"), this), row, 0);
|
||||
|
||||
custom_css_fn = new QLineEdit(general_tab);
|
||||
custom_css_fn->setText(olive::CurrentConfig.css_path);
|
||||
custom_css_fn->setText(olive::config.css_path);
|
||||
appearance_layout->addWidget(custom_css_fn, row, 1);
|
||||
|
||||
QPushButton* custom_css_browse = new QPushButton(tr("Browse"), general_tab);
|
||||
@@ -706,7 +936,7 @@ void PreferencesDialog::setup_ui() {
|
||||
|
||||
effect_textbox_lines_field = new QSpinBox(general_tab);
|
||||
effect_textbox_lines_field->setMinimum(1);
|
||||
effect_textbox_lines_field->setValue(olive::CurrentConfig.effect_textbox_lines);
|
||||
effect_textbox_lines_field->setValue(olive::config.effect_textbox_lines);
|
||||
appearance_layout->addWidget(effect_textbox_lines_field, row, 1, 1, 2);
|
||||
|
||||
row++;
|
||||
@@ -721,21 +951,21 @@ void PreferencesDialog::setup_ui() {
|
||||
QGridLayout* memory_usage_layout = new QGridLayout(memory_usage_group);
|
||||
memory_usage_layout->addWidget(new QLabel(tr("Upcoming Frame Queue:"), playback_tab), 0, 0);
|
||||
upcoming_queue_spinbox = new QDoubleSpinBox(playback_tab);
|
||||
upcoming_queue_spinbox->setValue(olive::CurrentConfig.upcoming_queue_size);
|
||||
upcoming_queue_spinbox->setValue(olive::config.upcoming_queue_size);
|
||||
memory_usage_layout->addWidget(upcoming_queue_spinbox, 0, 1);
|
||||
upcoming_queue_type = new QComboBox(playback_tab);
|
||||
upcoming_queue_type->addItem(tr("frames"));
|
||||
upcoming_queue_type->addItem(tr("seconds"));
|
||||
upcoming_queue_type->setCurrentIndex(olive::CurrentConfig.upcoming_queue_type);
|
||||
upcoming_queue_type->setCurrentIndex(olive::config.upcoming_queue_type);
|
||||
memory_usage_layout->addWidget(upcoming_queue_type, 0, 2);
|
||||
memory_usage_layout->addWidget(new QLabel(tr("Previous Frame Queue:"), playback_tab), 1, 0);
|
||||
previous_queue_spinbox = new QDoubleSpinBox(playback_tab);
|
||||
previous_queue_spinbox->setValue(olive::CurrentConfig.previous_queue_size);
|
||||
previous_queue_spinbox->setValue(olive::config.previous_queue_size);
|
||||
memory_usage_layout->addWidget(previous_queue_spinbox, 1, 1);
|
||||
previous_queue_type = new QComboBox(playback_tab);
|
||||
previous_queue_type->addItem(tr("frames"));
|
||||
previous_queue_type->addItem(tr("seconds"));
|
||||
previous_queue_type->setCurrentIndex(olive::CurrentConfig.previous_queue_type);
|
||||
previous_queue_type->setCurrentIndex(olive::config.previous_queue_type);
|
||||
memory_usage_layout->addWidget(previous_queue_type, 1, 2);
|
||||
playback_tab_layout->addWidget(memory_usage_group);
|
||||
|
||||
@@ -761,7 +991,7 @@ void PreferencesDialog::setup_ui() {
|
||||
for (int i=0;i<devs.size();i++) {
|
||||
audio_output_devices->addItem(devs.at(i).deviceName(), devs.at(i).deviceName());
|
||||
if (!found_preferred_device
|
||||
&& devs.at(i).deviceName() == olive::CurrentConfig.preferred_audio_output) {
|
||||
&& devs.at(i).deviceName() == olive::config.preferred_audio_output) {
|
||||
audio_output_devices->setCurrentIndex(audio_output_devices->count()-1);
|
||||
found_preferred_device = true;
|
||||
}
|
||||
@@ -784,7 +1014,7 @@ void PreferencesDialog::setup_ui() {
|
||||
for (int i=0;i<devs.size();i++) {
|
||||
audio_input_devices->addItem(devs.at(i).deviceName(), devs.at(i).deviceName());
|
||||
if (!found_preferred_device
|
||||
&& devs.at(i).deviceName() == olive::CurrentConfig.preferred_audio_input) {
|
||||
&& devs.at(i).deviceName() == olive::config.preferred_audio_input) {
|
||||
audio_input_devices->setCurrentIndex(audio_input_devices->count()-1);
|
||||
found_preferred_device = true;
|
||||
}
|
||||
@@ -801,7 +1031,7 @@ void PreferencesDialog::setup_ui() {
|
||||
audio_sample_rate = new QComboBox();
|
||||
combobox_audio_sample_rates(audio_sample_rate);
|
||||
for (int i=0;i<audio_sample_rate->count();i++) {
|
||||
if (audio_sample_rate->itemData(i).toInt() == olive::CurrentConfig.audio_rate) {
|
||||
if (audio_sample_rate->itemData(i).toInt() == olive::config.audio_rate) {
|
||||
audio_sample_rate->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
@@ -817,13 +1047,102 @@ void PreferencesDialog::setup_ui() {
|
||||
recordingComboBox = new QComboBox(general_tab);
|
||||
recordingComboBox->addItem(tr("Mono"));
|
||||
recordingComboBox->addItem(tr("Stereo"));
|
||||
recordingComboBox->setCurrentIndex(olive::CurrentConfig.recording_mode - 1);
|
||||
recordingComboBox->setCurrentIndex(olive::config.recording_mode - 1);
|
||||
audio_tab_layout->addWidget(recordingComboBox, row, 1);
|
||||
|
||||
row++;
|
||||
|
||||
tabWidget->addTab(audio_tab, tr("Audio"));
|
||||
|
||||
//
|
||||
// COLOR MANAGEMENT
|
||||
//
|
||||
|
||||
QWidget* color_management_tab = new QWidget();
|
||||
|
||||
QGridLayout* color_management_layout = new QGridLayout(color_management_tab);
|
||||
|
||||
row = 0;
|
||||
|
||||
// COLOR MANAGEMENT -> Enable Color Management
|
||||
enable_color_management = new QCheckBox(tr("Enable Color Management"));
|
||||
enable_color_management->setChecked(olive::config.enable_color_management);
|
||||
color_management_layout->addWidget(enable_color_management, row, 0);
|
||||
|
||||
row++;
|
||||
|
||||
QGroupBox* opencolorio_groupbox = new QGroupBox();
|
||||
QGridLayout* opencolorio_groupbox_layout = new QGridLayout(opencolorio_groupbox);
|
||||
|
||||
// COLOR MANAGEMENT -> OpenColorIO Config File
|
||||
opencolorio_groupbox_layout->addWidget(new QLabel(tr("OpenColorIO Config File:")), 0, 0);
|
||||
|
||||
ocio_config_file = new QLineEdit();
|
||||
ocio_config_file->setText(olive::config.ocio_config_path);
|
||||
connect(ocio_config_file, SIGNAL(textChanged(const QString &)), this, SLOT(update_ocio_config(const QString&)));
|
||||
opencolorio_groupbox_layout->addWidget(ocio_config_file, 0, 1, 1, 4);
|
||||
|
||||
QPushButton* ocio_config_browse_btn = new QPushButton(tr("Browse"));
|
||||
connect(ocio_config_browse_btn, SIGNAL(clicked(bool)), this, SLOT(browse_ocio_config()));
|
||||
opencolorio_groupbox_layout->addWidget(ocio_config_browse_btn, 0, 5);
|
||||
|
||||
// COLOR MANAGEMENT -> Default Input Color Space
|
||||
ocio_default_input = new QComboBox();
|
||||
opencolorio_groupbox_layout->addWidget(new QLabel(tr("Default Input Color Space:")), 1, 0);
|
||||
opencolorio_groupbox_layout->addWidget(ocio_default_input, 1, 1, 1, 5);
|
||||
|
||||
// COLOR MANAGEMENT -> Display
|
||||
ocio_display = new QComboBox();
|
||||
connect(ocio_display, SIGNAL(currentIndexChanged(int)), this, SLOT(update_ocio_view_menu()));
|
||||
opencolorio_groupbox_layout->addWidget(new QLabel(tr("Display:")), 2, 0);
|
||||
opencolorio_groupbox_layout->addWidget(ocio_display, 2, 1);
|
||||
|
||||
// COLOR MANAGEMENT -> View
|
||||
ocio_view = new QComboBox();
|
||||
opencolorio_groupbox_layout->addWidget(new QLabel(tr("View:")), 2, 2);
|
||||
opencolorio_groupbox_layout->addWidget(ocio_view, 2, 3);
|
||||
|
||||
// COLOR MANAGEMENT -> Look
|
||||
ocio_look = new QComboBox();
|
||||
opencolorio_groupbox_layout->addWidget(new QLabel(tr("Look:")), 2, 4);
|
||||
opencolorio_groupbox_layout->addWidget(ocio_look, 2, 5);
|
||||
|
||||
color_management_layout->addWidget(opencolorio_groupbox, row, 0);
|
||||
|
||||
row++;
|
||||
|
||||
// COLOR MANAGEMENT -> Bit Depth
|
||||
QGroupBox* bit_depth_groupbox = new QGroupBox(tr("Bit Depth"));
|
||||
QGridLayout* bit_depth_groupbox_layout = new QGridLayout(bit_depth_groupbox);
|
||||
|
||||
// COLOR MANAGEMENT -> Bit Depth -> Playback
|
||||
playback_bit_depth = new QComboBox();
|
||||
for (int i=0;i<olive::pixel_formats.size();i++) {
|
||||
playback_bit_depth->addItem(olive::pixel_formats.at(i).name, i);
|
||||
}
|
||||
playback_bit_depth->setCurrentIndex(olive::config.playback_bit_depth);
|
||||
bit_depth_groupbox_layout->addWidget(new QLabel(tr("Playback (Offline):")), 0, 0);
|
||||
bit_depth_groupbox_layout->addWidget(playback_bit_depth, 0, 1);
|
||||
|
||||
// COLOR MANAGEMENT -> Bit Depth -> Export
|
||||
export_bit_depth = new QComboBox();
|
||||
for (int i=0;i<olive::pixel_formats.size();i++) {
|
||||
export_bit_depth->addItem(olive::pixel_formats.at(i).name, i);
|
||||
}
|
||||
export_bit_depth->setCurrentIndex(olive::config.export_bit_depth);
|
||||
bit_depth_groupbox_layout->addWidget(new QLabel(tr("Export (Online):")), 0, 2);
|
||||
bit_depth_groupbox_layout->addWidget(export_bit_depth, 0, 3);
|
||||
|
||||
color_management_layout->addWidget(bit_depth_groupbox, row, 0);
|
||||
|
||||
|
||||
|
||||
//row++;
|
||||
|
||||
populate_ocio_menus(OCIO::GetCurrentConfig());
|
||||
|
||||
tabWidget->addTab(color_management_tab, tr("Color Management"));
|
||||
|
||||
// Shortcuts
|
||||
QWidget* shortcut_tab = new QWidget(this);
|
||||
|
||||
|
||||
+60
-19
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <QCheckBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QSpinBox>
|
||||
#include <OpenColorIO/OpenColorIO.h>
|
||||
namespace OCIO = OCIO_NAMESPACE::v1;
|
||||
|
||||
#include "timeline/sequence.h"
|
||||
|
||||
@@ -108,16 +110,23 @@ private slots:
|
||||
*/
|
||||
void save_shortcut_file();
|
||||
|
||||
/**
|
||||
* @brief Show a file dialog to browse for an external CSS file to load for styling the application.
|
||||
*/
|
||||
void browse_css_file();
|
||||
|
||||
/**
|
||||
* @brief Delete all previews (waveform and thumbnail cache)
|
||||
*/
|
||||
void delete_all_previews();
|
||||
|
||||
// Browse for file functionns
|
||||
/**
|
||||
* @brief Show a file dialog to browse for an external CSS file to load for styling the application.
|
||||
*/
|
||||
void browse_css_file();
|
||||
void browse_ocio_config();
|
||||
|
||||
// OCIO function
|
||||
void update_ocio_view_menu();
|
||||
void update_ocio_view_menu(OCIO::ConstConfigRcPtr config);
|
||||
void update_ocio_config(const QString&);
|
||||
|
||||
/**
|
||||
* @brief Shows a NewSequenceDialog attached to default_sequence
|
||||
*/
|
||||
@@ -157,6 +166,13 @@ private:
|
||||
*/
|
||||
void setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem* parent);
|
||||
|
||||
enum PreviewDeleteTypes {
|
||||
DELETE_NONE,
|
||||
DELETE_THUMBNAILS,
|
||||
DELETE_WAVEFORMS,
|
||||
DELETE_BOTH
|
||||
};
|
||||
|
||||
// used to delete previews
|
||||
// type can be: 't' for thumbnails, 'w' for waveforms, or 1 for all
|
||||
/**
|
||||
@@ -164,9 +180,11 @@ private:
|
||||
*
|
||||
* @param type
|
||||
*
|
||||
* The types of previews to
|
||||
* The types of previews to delete.
|
||||
*/
|
||||
void delete_previews(char type);
|
||||
void delete_previews(PreviewDeleteTypes type);
|
||||
|
||||
void populate_ocio_menus(OCIO::ConstConfigRcPtr config);
|
||||
|
||||
/**
|
||||
* @brief UI widget for editing the CSS filename
|
||||
@@ -183,6 +201,7 @@ private:
|
||||
*/
|
||||
QComboBox* recordingComboBox;
|
||||
|
||||
|
||||
/**
|
||||
* @brief UI widget for editing keyboard shortcuts
|
||||
*/
|
||||
@@ -243,6 +262,15 @@ private:
|
||||
*/
|
||||
QSpinBox* waveform_res_spinbox;
|
||||
|
||||
QCheckBox* enable_color_management;
|
||||
QLineEdit* ocio_config_file;
|
||||
QComboBox* ocio_default_input;
|
||||
QComboBox* ocio_display;
|
||||
QComboBox* ocio_view;
|
||||
QComboBox* ocio_look;
|
||||
QComboBox* playback_bit_depth;
|
||||
QComboBox* export_bit_depth;
|
||||
|
||||
/**
|
||||
* @brief UI widget for selecting the current UI style
|
||||
*/
|
||||
@@ -274,6 +302,19 @@ private:
|
||||
*/
|
||||
QVector<KeySequenceEditor*> key_shortcut_fields;
|
||||
|
||||
/**
|
||||
* @brief Tests an OpenColorIO configuration file to determine whether it's valid and throws a messagebox if not
|
||||
*
|
||||
* @param url
|
||||
*
|
||||
* URL to the OpenColorIO configuration file.
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* A OCIO::ConstConfigRcPtr config pointer if the configuration file is valid, nullptr if not.
|
||||
*/
|
||||
OCIO::ConstConfigRcPtr TestOCIOConfig(const QString& url);
|
||||
|
||||
/**
|
||||
* @brief Add an automated QCheckBox+boolean value pair
|
||||
*
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -95,7 +95,10 @@ void ReplaceClipMediaDialog::accept() {
|
||||
QMessageBox::Ok
|
||||
);
|
||||
} else {
|
||||
if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && olive::ActiveSequence == new_item->to_sequence()) {
|
||||
|
||||
SequencePtr top_sequence = Timeline::GetTopSequence();
|
||||
|
||||
if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && top_sequence == new_item->to_sequence()) {
|
||||
QMessageBox::critical(
|
||||
this,
|
||||
tr("Active sequence selected"),
|
||||
@@ -109,14 +112,15 @@ void ReplaceClipMediaDialog::accept() {
|
||||
use_same_media_in_points->isChecked()
|
||||
);
|
||||
|
||||
for (int i=0;i<olive::ActiveSequence->clips.size();i++) {
|
||||
ClipPtr c = olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr && c->media() == media) {
|
||||
QVector<Clip*> all_clips = top_sequence->GetAllClips();
|
||||
for (int i=0;i<all_clips.size();i++) {
|
||||
Clip* c = all_clips.at(i);
|
||||
if (c->media() == media) {
|
||||
rcmc->clips.append(c);
|
||||
}
|
||||
}
|
||||
|
||||
olive::UndoStack.push(rcmc);
|
||||
olive::undo_stack.push(rcmc);
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+46
-39
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "panels/timeline.h"
|
||||
#include "undo/undo.h"
|
||||
#include "undo/undostack.h"
|
||||
#include "effects/effect.h"
|
||||
#include "nodes/node.h"
|
||||
#include "project/media.h"
|
||||
|
||||
SpeedDialog::SpeedDialog(QWidget *parent, QVector<Clip*> clips) : QDialog(parent) {
|
||||
@@ -61,7 +61,7 @@ SpeedDialog::SpeedDialog(QWidget *parent, QVector<Clip*> clips) : QDialog(parent
|
||||
grid->addWidget(new QLabel(tr("Duration:"), this), 2, 0);
|
||||
duration = new LabelSlider(this);
|
||||
duration->SetDisplayType(LabelSlider::FrameNumber);
|
||||
duration->SetFrameRate(olive::ActiveSequence->frame_rate);
|
||||
duration->SetFrameRate(clips_.first()->track()->sequence()->frame_rate);
|
||||
grid->addWidget(duration, 2, 1);
|
||||
|
||||
main_layout->addLayout(grid);
|
||||
@@ -103,7 +103,7 @@ int SpeedDialog::exec() {
|
||||
|
||||
// get default frame rate/percentage
|
||||
clip_percent = c->speed().value;
|
||||
if (c->track() < 0) {
|
||||
if (c->type() == olive::kTypeVideo) {
|
||||
bool process_video = true;
|
||||
if (c->media() != nullptr && c->media()->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
FootageStream* ms = c->media_stream();
|
||||
@@ -131,7 +131,7 @@ int SpeedDialog::exec() {
|
||||
|
||||
enable_frame_rate = true;
|
||||
}
|
||||
} else {
|
||||
} else if (c->type() == olive::kTypeAudio) {
|
||||
maintain_pitch->setEnabled(true);
|
||||
|
||||
if (!multiple_audio) {
|
||||
@@ -192,7 +192,7 @@ void SpeedDialog::percent_update() {
|
||||
Clip* c = clips_.at(i);
|
||||
|
||||
// get frame rate
|
||||
if (frame_rate->isEnabled() && c->track() < 0) {
|
||||
if (frame_rate->isEnabled() && c->type() == olive::kTypeVideo) {
|
||||
double clip_fr = c->media_frame_rate() * percent->value();
|
||||
if (got_fr) {
|
||||
if (!qIsNaN(fr_val) && !qFuzzyCompare(fr_val, clip_fr)) {
|
||||
@@ -236,7 +236,7 @@ void SpeedDialog::duration_update() {
|
||||
}
|
||||
|
||||
// get frame rate
|
||||
if (frame_rate->isEnabled() && c->track() < 0) {
|
||||
if (frame_rate->isEnabled() && c->type() == olive::kTypeVideo) {
|
||||
double clip_fr = c->media_frame_rate() * clip_pc;
|
||||
if (got_fr) {
|
||||
if (!qIsNaN(fr_val) && !qFuzzyCompare(fr_val, clip_fr)) {
|
||||
@@ -276,7 +276,7 @@ void SpeedDialog::frame_rate_update() {
|
||||
old_pc_val = qSNaN();
|
||||
}
|
||||
|
||||
if (c->track() < 0) {
|
||||
if (c->type() == olive::kTypeVideo) {
|
||||
// what would the new speed be based on this frame rate
|
||||
double new_clip_speed = frame_rate->value() / c->media_frame_rate();
|
||||
if (!got_pc_val) {
|
||||
@@ -301,7 +301,7 @@ void SpeedDialog::frame_rate_update() {
|
||||
for (int i=0;i<clips_.size();i++) {
|
||||
Clip* c = clips_.at(i);
|
||||
|
||||
if (c->track() >= 0) {
|
||||
if (c->type() == olive::kTypeAudio) {
|
||||
|
||||
long new_clip_len = (qIsNaN(old_pc_val) || qIsNaN(pc_val)) ?
|
||||
c->length() : qRound((c->length() * c->speed().value) / pc_val);
|
||||
@@ -318,15 +318,17 @@ void SpeedDialog::frame_rate_update() {
|
||||
}
|
||||
|
||||
void set_speed(ComboAction* ca, Clip* c, double speed, bool ripple, long& ep, long& lr) {
|
||||
panel_timeline->deselect_area(c->timeline_in(), c->timeline_out(), c->track());
|
||||
c->track()->DeselectArea(c->timeline_in(), c->timeline_out());
|
||||
|
||||
long proposed_out = c->timeline_out();
|
||||
double multiplier = (c->speed().value / speed);
|
||||
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++) {
|
||||
ClipPtr compare = c->sequence->clips.at(i);
|
||||
QVector<Clip*> all_clips = c->track()->sequence()->GetAllClips();
|
||||
|
||||
for (int i=0;i<all_clips.size();i++) {
|
||||
Clip* compare = all_clips.at(i);
|
||||
if (compare != nullptr
|
||||
&& compare->track() == c->track()
|
||||
&& compare->timeline_in() >= c->timeline_out() && compare->timeline_in() < proposed_out) {
|
||||
@@ -336,15 +338,16 @@ void set_speed(ComboAction* ca, Clip* c, double speed, bool ripple, long& ep, lo
|
||||
}
|
||||
ep = qMin(ep, c->timeline_out());
|
||||
lr = qMax(lr, proposed_out - c->timeline_out());
|
||||
c->move(ca, c->timeline_in(), proposed_out, qRound(c->clip_in() * multiplier), c->track());
|
||||
c->track()->sequence()->MoveClip(c,
|
||||
ca,
|
||||
c->timeline_in(),
|
||||
proposed_out,
|
||||
qRound(c->clip_in() * multiplier),
|
||||
c->track());
|
||||
|
||||
c->refactor_frame_rate(ca, multiplier, false);
|
||||
|
||||
Selection sel;
|
||||
sel.in = c->timeline_in();
|
||||
sel.out = proposed_out;
|
||||
sel.track = c->track();
|
||||
olive::ActiveSequence->selections.append(sel);
|
||||
c->track()->SelectArea(c->timeline_in(), proposed_out);
|
||||
}
|
||||
|
||||
void SpeedDialog::accept() {
|
||||
@@ -357,8 +360,8 @@ void SpeedDialog::accept() {
|
||||
SetClipProperty* reversed_action = new SetClipProperty(kSetClipPropertyReversed);
|
||||
|
||||
// undoable action for restoring clip selections
|
||||
SetSelectionsCommand* sel_command = new SetSelectionsCommand(olive::ActiveSequence.get());
|
||||
sel_command->old_data = olive::ActiveSequence->selections;
|
||||
Sequence* sequence = clips_.first()->track()->sequence();
|
||||
QVector<Selection> old_selections = sequence->Selections();
|
||||
|
||||
// variables used to calculate ripples
|
||||
long earliest_point = LONG_MAX;
|
||||
@@ -373,7 +376,7 @@ void SpeedDialog::accept() {
|
||||
}
|
||||
|
||||
// set maintain audio pitch if the user made a selection
|
||||
if (c->track() >= 0
|
||||
if (c->type() == olive::kTypeAudio
|
||||
&& maintain_pitch->checkState() != Qt::PartiallyChecked
|
||||
&& c->speed().maintain_audio_pitch != maintain_pitch->isChecked()) {
|
||||
audio_pitch_action->AddSetting(c, maintain_pitch->isChecked());
|
||||
@@ -382,7 +385,12 @@ void SpeedDialog::accept() {
|
||||
// set reverse setting if the user made a selection
|
||||
if (reverse->checkState() != Qt::PartiallyChecked && c->reversed() != reverse->isChecked()) {
|
||||
long new_clip_in = (c->media_length() - (c->length() + c->clip_in()));
|
||||
c->move(ca, c->timeline_in(), c->timeline_out(), new_clip_in, c->track());
|
||||
c->track()->sequence()->MoveClip(c,
|
||||
ca,
|
||||
c->timeline_in(),
|
||||
c->timeline_out(),
|
||||
new_clip_in,
|
||||
c->track());
|
||||
c->set_clip_in(new_clip_in);
|
||||
reversed_action->AddSetting(c, reverse->isChecked());
|
||||
}
|
||||
@@ -410,7 +418,7 @@ void SpeedDialog::accept() {
|
||||
if (i > 0 && !qFuzzyCompare(cached_speed, c->speed().value)) {
|
||||
can_change_all = false;
|
||||
}
|
||||
if (c->track() < 0) {
|
||||
if (c->type() == olive::kTypeVideo) {
|
||||
if (qIsNaN(cached_fr)) {
|
||||
cached_fr = c->media_frame_rate();
|
||||
} else if (!qFuzzyCompare(cached_fr, c->media_frame_rate())) {
|
||||
@@ -423,7 +431,7 @@ void SpeedDialog::accept() {
|
||||
// make changes
|
||||
for (int i=0;i<clips_.size();i++) {
|
||||
Clip* c = clips_.at(i);
|
||||
if (c->track() < 0) {
|
||||
if (c->type() == olive::kTypeVideo) {
|
||||
set_speed(ca, c, frame_rate->value() / c->media_frame_rate(), ripple->isChecked(), earliest_point, longest_ripple);
|
||||
} else if (can_change_all) {
|
||||
set_speed(ca, c, frame_rate->value() / cached_fr, ripple->isChecked(), earliest_point, longest_ripple);
|
||||
@@ -438,16 +446,15 @@ void SpeedDialog::accept() {
|
||||
}
|
||||
|
||||
if (ripple->isChecked()) {
|
||||
ripple_clips(ca, clips_.at(0)->sequence, earliest_point, longest_ripple);
|
||||
sequence->Ripple(ca, earliest_point, longest_ripple);
|
||||
}
|
||||
|
||||
sel_command->new_data = olive::ActiveSequence->selections;
|
||||
ca->append(sel_command);
|
||||
ca->append(new SetSelectionsCommand(sequence, old_selections, sequence->Selections()));
|
||||
|
||||
ca->append(reversed_action);
|
||||
ca->append(audio_pitch_action);
|
||||
|
||||
olive::UndoStack.push(ca);
|
||||
olive::undo_stack.push(ca);
|
||||
|
||||
update_ui(true);
|
||||
QDialog::accept();
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
+12
-12
@@ -1,20 +1,20 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user