made timeline in/out toggleable
This commit is contained in:
@@ -62,8 +62,8 @@ ExportDialog::ExportDialog(QWidget *parent) :
|
||||
|
||||
rangeCombobox->setCurrentIndex(0);
|
||||
if (sequence->using_workarea) {
|
||||
rangeCombobox->setEnabled(sequence->using_workarea);
|
||||
rangeCombobox->setCurrentIndex(1);
|
||||
rangeCombobox->setEnabled(true);
|
||||
if (sequence->enable_workarea) rangeCombobox->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
format_strings.resize(FORMAT_SIZE);
|
||||
|
||||
@@ -273,6 +273,8 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
|
||||
open_seq = s;
|
||||
} else if (attr.name() == "workarea") {
|
||||
s->using_workarea = (attr.value() == "1");
|
||||
} else if (attr.name() == "workareaEnabled") {
|
||||
s->enable_workarea = (attr.value() == "1");
|
||||
} else if (attr.name() == "workareaIn") {
|
||||
s->workarea_in = attr.value().toLong();
|
||||
} else if (attr.name() == "workareaOut") {
|
||||
|
||||
+10
-1
@@ -245,6 +245,7 @@ void MainWindow::make_new_menu(QMenu *parent) {
|
||||
void MainWindow::make_inout_menu(QMenu *parent) {
|
||||
parent->addAction("Set In Point", this, SLOT(set_in_point()), QKeySequence("I"));
|
||||
parent->addAction("Set Out Point", this, SLOT(set_out_point()), QKeySequence("O"));
|
||||
parent->addAction("Enable/Disable In/Out Point", this, SLOT(enable_inout()));
|
||||
parent->addSeparator();
|
||||
parent->addAction("Reset In Point", this, SLOT(clear_in()));
|
||||
parent->addAction("Reset Out Point", this, SLOT(clear_out()));
|
||||
@@ -1258,7 +1259,15 @@ void MainWindow::ripple_delete_inout()
|
||||
{
|
||||
if (panel_timeline->focused()) {
|
||||
panel_timeline->delete_in_out(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::enable_inout() {
|
||||
if (panel_timeline->focused() || panel_sequence_viewer->is_focused()) {
|
||||
panel_sequence_viewer->toggle_enable_inout();
|
||||
} else if (panel_footage_viewer->is_focused()) {
|
||||
panel_footage_viewer->toggle_enable_inout();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::set_tsa_default() {
|
||||
|
||||
@@ -103,6 +103,7 @@ private slots:
|
||||
void clear_inout();
|
||||
void delete_inout();
|
||||
void ripple_delete_inout();
|
||||
void enable_inout();
|
||||
|
||||
// title safe area functions
|
||||
void set_tsa_disable();
|
||||
|
||||
+2
-1
@@ -944,7 +944,8 @@ void Project::save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only,
|
||||
if (s == sequence) {
|
||||
stream.writeAttribute("open", "1");
|
||||
}
|
||||
stream.writeAttribute("workarea", QString::number(s->using_workarea));
|
||||
stream.writeAttribute("workarea", QString::number(s->using_workarea));
|
||||
stream.writeAttribute("workareaEnabled", QString::number(s->enable_workarea));
|
||||
stream.writeAttribute("workareaIn", QString::number(s->workarea_in));
|
||||
stream.writeAttribute("workareaOut", QString::number(s->workarea_out));
|
||||
|
||||
|
||||
+1
-1
@@ -240,7 +240,7 @@ void Timeline::create_ghosts_from_media(Sequence* seq, long entry_point, QVector
|
||||
case MEDIA_TYPE_SEQUENCE:
|
||||
g.out = entry_point + sequence_length - default_clip_in;
|
||||
|
||||
if (s->using_workarea) {
|
||||
if (s->using_workarea && s->enable_workarea) {
|
||||
g.out -= (sequence_length - default_clip_out);
|
||||
}
|
||||
|
||||
|
||||
+12
-5
@@ -257,7 +257,7 @@ void Viewer::go_to_end() {
|
||||
|
||||
void Viewer::go_to_in() {
|
||||
if (seq != NULL) {
|
||||
if (seq->using_workarea) {
|
||||
if (seq->using_workarea && seq->enable_workarea) {
|
||||
seek(seq->workarea_in);
|
||||
} else {
|
||||
go_to_start();
|
||||
@@ -275,7 +275,7 @@ void Viewer::next_frame() {
|
||||
|
||||
void Viewer::go_to_out() {
|
||||
if (seq != NULL) {
|
||||
if (seq->using_workarea) {
|
||||
if (seq->using_workarea && seq->enable_workarea) {
|
||||
seek(seq->workarea_out);
|
||||
} else {
|
||||
go_to_end();
|
||||
@@ -449,7 +449,14 @@ void Viewer::clear_inout_point() {
|
||||
if (seq->using_workarea) {
|
||||
undo_stack.push(new SetTimelineInOutCommand(seq, false, 0, 0));
|
||||
update_parents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Viewer::toggle_enable_inout() {
|
||||
if (seq != NULL && seq->using_workarea) {
|
||||
undo_stack.push(new SetBool(&seq->enable_workarea, !seq->enable_workarea));
|
||||
update_parents();
|
||||
}
|
||||
}
|
||||
|
||||
void Viewer::set_in_point() {
|
||||
@@ -484,13 +491,13 @@ void Viewer::set_sb_max() {
|
||||
}
|
||||
|
||||
long Viewer::get_seq_in() {
|
||||
return (seq->using_workarea)
|
||||
return (seq->using_workarea && seq->enable_workarea)
|
||||
? seq->workarea_in
|
||||
: 0;
|
||||
}
|
||||
|
||||
long Viewer::get_seq_out() {
|
||||
return (seq->using_workarea && previous_playhead < seq->workarea_out)
|
||||
return (seq->using_workarea && seq->enable_workarea && previous_playhead < seq->workarea_out)
|
||||
? seq->workarea_out
|
||||
: seq->getEndFrame();
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
void clear_in();
|
||||
void clear_out();
|
||||
void clear_inout_point();
|
||||
void toggle_enable_inout();
|
||||
void set_in_point();
|
||||
void set_out_point();
|
||||
void set_zoom(bool in);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
Sequence::Sequence() :
|
||||
playhead(0),
|
||||
using_workarea(false),
|
||||
enable_workarea(true),
|
||||
workarea_in(0),
|
||||
workarea_out(0),
|
||||
wrapper_sequence(false)
|
||||
|
||||
@@ -28,6 +28,7 @@ struct Sequence {
|
||||
long playhead;
|
||||
|
||||
bool using_workarea;
|
||||
bool enable_workarea;
|
||||
long workarea_in;
|
||||
long workarea_out;
|
||||
|
||||
|
||||
@@ -209,6 +209,7 @@ SetTimelineInOutCommand::SetTimelineInOutCommand(Sequence *s, bool enabled, long
|
||||
|
||||
void SetTimelineInOutCommand::undo() {
|
||||
seq->using_workarea = old_enabled;
|
||||
seq->enable_workarea = old_workarea_enabled;
|
||||
seq->workarea_in = old_in;
|
||||
seq->workarea_out = old_out;
|
||||
|
||||
@@ -225,9 +226,11 @@ void SetTimelineInOutCommand::undo() {
|
||||
|
||||
void SetTimelineInOutCommand::redo() {
|
||||
old_enabled = seq->using_workarea;
|
||||
old_workarea_enabled = seq->enable_workarea;
|
||||
old_in = seq->workarea_in;
|
||||
old_out = seq->workarea_out;
|
||||
|
||||
if (!seq->using_workarea) seq->enable_workarea = true;
|
||||
seq->using_workarea = new_enabled;
|
||||
seq->workarea_in = new_in;
|
||||
seq->workarea_out = new_out;
|
||||
|
||||
@@ -174,6 +174,8 @@ public:
|
||||
private:
|
||||
Sequence* seq;
|
||||
|
||||
bool old_workarea_enabled;
|
||||
|
||||
bool old_enabled;
|
||||
long old_in;
|
||||
long old_out;
|
||||
|
||||
@@ -321,8 +321,7 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
|
||||
|
||||
while (true) {
|
||||
long frame = qRound(interval*i);
|
||||
int lineX = qRound(frame*zoom) - scroll;
|
||||
int next_lineX = qRound(qRound(interval*(i+1))*zoom) - scroll;
|
||||
int lineX = qRound(frame*zoom) - scroll;
|
||||
|
||||
if (lineX > width()) break;
|
||||
|
||||
@@ -367,7 +366,7 @@ void TimelineHeader::paintEvent(QPaintEvent*) {
|
||||
if (viewer->seq->using_workarea) {
|
||||
in_x = getHeaderScreenPointFromFrame((resizing_workarea ? temp_workarea_in : viewer->seq->workarea_in));
|
||||
int out_x = getHeaderScreenPointFromFrame((resizing_workarea ? temp_workarea_out : viewer->seq->workarea_out));
|
||||
p.fillRect(QRect(in_x, 0, out_x-in_x, height()), QColor(0, 192, 255, 128));
|
||||
p.fillRect(QRect(in_x, 0, out_x-in_x, height()), viewer->seq->enable_workarea ? QColor(0, 192, 255, 128) : QColor(255, 255, 255, 64));
|
||||
p.setPen(Qt::white);
|
||||
p.drawLine(in_x, 0, in_x, height());
|
||||
p.drawLine(out_x, 0, out_x, height());
|
||||
|
||||
Reference in New Issue
Block a user