diff --git a/dialogs/preferencesdialog.cpp b/dialogs/preferencesdialog.cpp index ce869cb12..81bd53211 100644 --- a/dialogs/preferencesdialog.cpp +++ b/dialogs/preferencesdialog.cpp @@ -22,6 +22,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) : { ui->setupUi(this); + ui->accurateSeekButton->setChecked(!config.fast_seeking); + ui->fastSeekButton->setChecked(config.fast_seeking); ui->recordingComboBox->setCurrentIndex(config.recording_mode - 1); ui->imgSeqFormatEdit->setText(config.img_seq_formats); } @@ -77,4 +79,5 @@ void PreferencesDialog::setup_kbd_shortcuts(QMenuBar* menubar) { void PreferencesDialog::on_buttonBox_accepted() { config.recording_mode = ui->recordingComboBox->currentIndex() + 1; config.img_seq_formats = ui->imgSeqFormatEdit->text(); + config.fast_seeking = ui->fastSeekButton->isChecked(); } diff --git a/dialogs/preferencesdialog.ui b/dialogs/preferencesdialog.ui index 54344dd23..814d3b4aa 100644 --- a/dialogs/preferencesdialog.ui +++ b/dialogs/preferencesdialog.ui @@ -17,7 +17,7 @@ - 0 + 2 @@ -62,6 +62,38 @@ Behavior + + + Playback + + + + + + Seeking + + + + + + Accurate Seeking +Always show the correct frame (visual may pause briefly as correct frame is retrieved) + + + + + + + Fast Seeking +Seek quickly (may briefly show inaccurate frames when seeking - doesn't affect playback/export) + + + + + + + + Keyboard diff --git a/io/config.cpp b/io/config.cpp index 4f6980c0b..31d9fddfd 100644 --- a/io/config.cpp +++ b/io/config.cpp @@ -30,7 +30,8 @@ Config::Config() enable_audio_scrubbing(true), drop_on_media_to_replace(true), autoscroll(AUTOSCROLL_PAGE_SCROLL), - audio_rate(48000) + audio_rate(48000), + fast_seeking(false) {} void Config::load(QString path) { @@ -107,6 +108,9 @@ void Config::load(QString path) { } else if (stream.name() == "AudioRate") { stream.readNext(); audio_rate = stream.text().toInt(); + } else if (stream.name() == "FastSeeking") { + stream.readNext(); + fast_seeking = (stream.text() == "1"); } } } @@ -153,6 +157,7 @@ void Config::save(QString path) { stream.writeTextElement("DropFileOnMediaToReplace", QString::number(drop_on_media_to_replace)); stream.writeTextElement("Autoscroll", QString::number(autoscroll)); stream.writeTextElement("AudioRate", QString::number(audio_rate)); + stream.writeTextElement("FastSeeking", QString::number(fast_seeking)); stream.writeEndElement(); // configuration stream.writeEndDocument(); // doc diff --git a/io/config.h b/io/config.h index 5b303e641..5bcb10447 100644 --- a/io/config.h +++ b/io/config.h @@ -42,6 +42,7 @@ struct Config { bool drop_on_media_to_replace; int autoscroll; int audio_rate; + bool fast_seeking; void load(QString path); void save(QString path); diff --git a/playback/playback.cpp b/playback/playback.cpp index 95d421161..cfc99bc1b 100644 --- a/playback/playback.cpp +++ b/playback/playback.cpp @@ -11,6 +11,7 @@ #include "project/effect.h" #include "panels/effectcontrols.h" #include "project/media.h" +#include "io/config.h" #include "debug.h" extern "C" { @@ -193,7 +194,7 @@ void get_clip_frame(Clip* c, long playhead) { #ifdef GCF_DEBUG dout << "GCF ==> RESET" << target_pts << "(" << target_frame->pts << "-" << target_frame->pts+target_frame->pkt_duration << ")"; #endif - target_frame = NULL; + if (!config.fast_seeking) target_frame = NULL; reset = true; c->last_invalid_ts = target_pts; } else {