diff --git a/src/core/player.cpp b/src/core/player.cpp
index 2c24c4288..7d14a5748 100644
--- a/src/core/player.cpp
+++ b/src/core/player.cpp
@@ -53,10 +53,6 @@ using std::shared_ptr;
const char* Player::kSettingsGroup = "Player";
-namespace {
-const int kSeekStepSec = 10;
-}
-
Player::Player(Application* app, QObject* parent)
: PlayerInterface(parent),
app_(app),
@@ -67,7 +63,8 @@ Player::Player(Application* app, QObject* parent)
nb_errors_received_(0),
volume_before_mute_(50),
last_pressed_previous_(QDateTime::currentDateTime()),
- menu_previousmode_(PreviousBehaviour_DontRestart) {
+ menu_previousmode_(PreviousBehaviour_DontRestart),
+ seek_step_sec_(10) {
settings_.beginGroup("Player");
SetVolume(settings_.value("volume", 50).toInt());
@@ -107,8 +104,12 @@ void Player::ReloadSettings() {
menu_previousmode_ = PreviousBehaviour(
s.value("menu_previousmode", PreviousBehaviour_DontRestart).toInt());
+
+ seek_step_sec_ = s.value("seek_step_sec", 10).toInt();
+
s.endGroup();
+
engine_->ReloadSettings();
}
@@ -448,11 +449,11 @@ void Player::SeekTo(int seconds) {
}
void Player::SeekForward() {
- SeekTo(engine()->position_nanosec() / kNsecPerSec + kSeekStepSec);
+ SeekTo(engine()->position_nanosec() / kNsecPerSec + seek_step_sec_);
}
void Player::SeekBackward() {
- SeekTo(engine()->position_nanosec() / kNsecPerSec - kSeekStepSec);
+ SeekTo(engine()->position_nanosec() / kNsecPerSec - seek_step_sec_);
}
void Player::EngineMetadataReceived(const Engine::SimpleMetaBundle& bundle) {
diff --git a/src/core/player.h b/src/core/player.h
index 347c9dc14..e800d1fdd 100644
--- a/src/core/player.h
+++ b/src/core/player.h
@@ -210,6 +210,7 @@ class Player : public PlayerInterface {
QDateTime last_pressed_previous_;
PreviousBehaviour menu_previousmode_;
+ int seek_step_sec_;
};
#endif // CORE_PLAYER_H_
diff --git a/src/ui/behavioursettingspage.cpp b/src/ui/behavioursettingspage.cpp
index 4def22470..89b09d8b2 100644
--- a/src/ui/behavioursettingspage.cpp
+++ b/src/ui/behavioursettingspage.cpp
@@ -129,6 +129,10 @@ void BehaviourSettingsPage::Load() {
s.value("resume_playback_after_start", false).toBool());
s.endGroup();
+ s.beginGroup(Player::kSettingsGroup);
+ ui_->seek_step_sec->setValue(s.value("seek_step_sec", 10).toInt());
+ s.endGroup();
+
s.beginGroup("General");
QString name = language_map_.key(s.value("language").toString());
if (name.isEmpty())
@@ -217,6 +221,7 @@ void BehaviourSettingsPage::Save() {
s.beginGroup(Player::kSettingsGroup);
s.setValue("menu_previousmode", menu_previousmode);
+ s.setValue("seek_step_sec", ui_->seek_step_sec->value());
s.endGroup();
s.beginGroup("General");
diff --git a/src/ui/behavioursettingspage.ui b/src/ui/behavioursettingspage.ui
index 1c894fb2e..6f4ea571d 100644
--- a/src/ui/behavioursettingspage.ui
+++ b/src/ui/behavioursettingspage.ui
@@ -7,7 +7,7 @@
0
0
516
- 753
+ 851
@@ -180,9 +180,9 @@
-
- Pressing "Previous" in player will...
+ Pressing "Previous" in player will...
-
+
-
@@ -261,6 +261,54 @@
+ -
+
+
+ Seeking using a keyboard shortcut
+
+
+
-
+
+
+ Time step
+
+
+
+ -
+
+
+ s
+
+
+
+
+
+ 1
+
+
+ 20
+
+
+ 10
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
-