Skip to content

Commit

Permalink
Merge pull request #190 from Keeper-of-the-Keys/configurable-speed
Browse files Browse the repository at this point in the history
Configurable speed
  • Loading branch information
Keeper-of-the-Keys authored May 21, 2024
2 parents ed3cf00 + 02dfe16 commit be4c00f
Show file tree
Hide file tree
Showing 12 changed files with 385 additions and 184 deletions.
2 changes: 1 addition & 1 deletion gpodder-core
18 changes: 15 additions & 3 deletions qml/PlayerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ Page {

allowedOrientations: Orientation.All

onStatusChanged: {
if (status === PageStatus.Activating) {
py.getConfig('ui.qml.playback_speed.stepSize', function (value) {
speedSlider.stepSize = value;
});
py.getConfig('ui.qml.playback_speed.minimumValue', function (value) {
speedSlider.minimumValue = value;
});
py.getConfig('ui.qml.playback_speed.maximumValue', function (value) {
speedSlider.maximumValue = value;
});
}
}
SilicaFlickable {
id: flickable
anchors.fill: parent
Expand Down Expand Up @@ -120,6 +133,8 @@ Page {
asynchronous: true

source: player.episode_art !== '' ? player.episode_art : player.cover_art

onStateChanged: console.log("source: " + source)
}
}
Column {
Expand Down Expand Up @@ -346,9 +361,6 @@ Page {

value: player.playbackRate
valueText: Math.round(value * 100) / 100
minimumValue: 0.5
maximumValue: 3.0
stepSize: 0.25
onDownChanged: {
if (!down) {
player.playbackRate = sliderValue
Expand Down
54 changes: 54 additions & 0 deletions qml/SettingsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,21 @@ Page {
py.getConfig('limit.episodes', function (value) {
limit_episodes.value = value;
});
py.getConfig('ui.qml.playback_speed.stepSize', function (value) {
speed_increment.value = value;
});
py.getConfig('ui.qml.playback_speed.minimumValue', function (value) {
speed_min.text = value;
});
py.getConfig('ui.qml.playback_speed.maximumValue', function (value) {
speed_max.text = value;
});
} else if (status === PageStatus.Deactivating) {
py.setConfig('plugins.youtube.api_key_v3', youtube_api_key_v3.text);
py.setConfig('limit.episodes', parseInt(limit_episodes.value));
py.setConfig('ui.qml.playback_speed.stepSize', parseFloat(speed_increment.value));
py.setConfig('ui.qml.playback_speed.minimumValue', parseFloat(speed_min.text));
py.setConfig('ui.qml.playback_speed.maximumValue', parseFloat(speed_max.text));
youtube_api_key_v3.focus = false;
}
}
Expand Down Expand Up @@ -92,6 +104,48 @@ Page {
maximumValue: 1000
stepSize: 100
}

Slider {
id: speed_increment
label: qsTr("Speed increments")
valueText: value
width: parent.width
minimumValue: speed_increment.stepSize
maximumValue: 1.00
stepSize: 0.05
}

TextField {
id: speed_min
label: qsTr("Playback speed - lower limit")
placeholderText: label
width: parent.width
inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly
EnterKey.iconSource: (text.length > 0) ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
validator: DoubleValidator {
bottom: speed_increment.value
decimals: 2
notation: DoubleValidator.StandardNotation
top: parseFloat(speed_max.text) - speed_increment.stepSize
}
}

TextField {
id: speed_max
label: qsTr("Playback speed - upper limit")
placeholderText: label
width: parent.width
inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly
EnterKey.iconSource: (text.length > 0) ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
validator: DoubleValidator {
bottom: parseFloat(speed_min.text) + speed_increment.stepSize
decimals: 2
notation: DoubleValidator.StandardNotation
top: 5
}
}
}
}
}
55 changes: 35 additions & 20 deletions translations/harbour-org.gpodder.sailfish-bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,72 +275,72 @@
<context>
<name>PlayerPage</name>
<message>
<location filename="../qml/PlayerPage.qml" line="46"/>
<location filename="../qml/PlayerPage.qml" line="59"/>
<source>Stop sleep timer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="46"/>
<location filename="../qml/PlayerPage.qml" line="59"/>
<source>Sleep timer</source>
<translation type="unfinished">Отброяване до заспиване</translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="57"/>
<location filename="../qml/PlayerPage.qml" line="70"/>
<source>Clear play queue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="131"/>
<location filename="../qml/PlayerPage.qml" line="146"/>
<source>Now playing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="220"/>
<location filename="../qml/PlayerPage.qml" line="235"/>
<source>Sleep timer: </source>
<translation type="unfinished">Отброяване до заспиване: </translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="259"/>
<location filename="../qml/PlayerPage.qml" line="274"/>
<source>- 1 min</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="269"/>
<location filename="../qml/PlayerPage.qml" line="284"/>
<source>- 10 sec</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="278"/>
<location filename="../qml/PlayerPage.qml" line="293"/>
<source>Pause</source>
<translation type="unfinished">Паузиране</translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="278"/>
<location filename="../qml/PlayerPage.qml" line="293"/>
<source>Play</source>
<translation type="unfinished">Пускане</translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="290"/>
<location filename="../qml/PlayerPage.qml" line="305"/>
<source>+ 10 sec</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="299"/>
<location filename="../qml/PlayerPage.qml" line="314"/>
<source>+ 1 min</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="311"/>
<location filename="../qml/PlayerPage.qml" line="326"/>
<source>Playback speed: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="363"/>
<location filename="../qml/PlayerPage.qml" line="375"/>
<source>Queue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/PlayerPage.qml" line="387"/>
<location filename="../qml/PlayerPage.qml" line="399"/>
<source>Remove from queue</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -508,35 +508,50 @@
<context>
<name>SettingsPage</name>
<message>
<location filename="../qml/SettingsPage.qml" line="53"/>
<location filename="../qml/SettingsPage.qml" line="65"/>
<source>About</source>
<translation>Относно</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="63"/>
<location filename="../qml/SettingsPage.qml" line="75"/>
<source>Settings</source>
<translation>Настройки</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="67"/>
<location filename="../qml/SettingsPage.qml" line="79"/>
<source>YouTube</source>
<translation>YouTube</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="73"/>
<location filename="../qml/SettingsPage.qml" line="85"/>
<source>API Key (v3)</source>
<translation>API ключ (v3)</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="82"/>
<location filename="../qml/SettingsPage.qml" line="94"/>
<source>Limits</source>
<translation>Ограничения</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="88"/>
<location filename="../qml/SettingsPage.qml" line="100"/>
<source>Maximum episodes per feed</source>
<translation>Максимален брой епизоди за RSS емисия</translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="110"/>
<source>Speed increments</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="120"/>
<source>Playback speed - lower limit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SettingsPage.qml" line="136"/>
<source>Playback speed - upper limit</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SleepTimerDialog</name>
Expand Down
Loading

0 comments on commit be4c00f

Please sign in to comment.