Add keyboard chapter changing.
This commit is contained in:
parent
94fb63de53
commit
e7484349a5
|
@ -363,12 +363,7 @@ QVariant playerCommand(BackendInterface* b, const Enums::Commands& cmd, const QV
|
|||
|
||||
break;
|
||||
}
|
||||
case Enums::Commands::SeekAbsolute: {
|
||||
|
||||
b->command(QVariantList() << "seek" << args << "absolute");
|
||||
|
||||
break;
|
||||
}
|
||||
case Enums::Commands::ForwardFrame: {
|
||||
|
||||
b->command(QVariantList() << "frame-step");
|
||||
|
@ -406,6 +401,20 @@ QVariant playerCommand(BackendInterface* b, const Enums::Commands& cmd, const QV
|
|||
break;
|
||||
}
|
||||
|
||||
case Enums::Commands::PreviousChapter: {
|
||||
|
||||
b->command(QVariantList() << "add" << "chapter" << "-1");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case Enums::Commands::NextChapter: {
|
||||
|
||||
b->command(QVariantList() << "add" << "chapter" << "1");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
//qDebug() << "Command not found: " << cmd;
|
||||
break;
|
||||
|
|
|
@ -42,6 +42,8 @@ enum class Commands : int {
|
|||
SetTrack = 21,
|
||||
SetPlaylistPos = 22,
|
||||
ForcePause = 23,
|
||||
PreviousChapter = 24,
|
||||
NextChapter = 25,
|
||||
};
|
||||
Q_ENUM_NS(Commands)
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ import QtQuick.Controls 2.3
|
|||
import player 1.0
|
||||
|
||||
Action {
|
||||
id: audioDeviceItem
|
||||
property string deviceID: "none"
|
||||
checkable: false
|
||||
checked: false
|
||||
|
|
|
@ -7,7 +7,7 @@ Rectangle {
|
|||
width: 4
|
||||
height: parent.height
|
||||
x: progressBar.background.width / progressBar.to * time
|
||||
z: 9000
|
||||
z: 90000
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
|
@ -15,7 +15,6 @@ Rectangle {
|
|||
|
||||
Connections {
|
||||
target: player
|
||||
enabled: true
|
||||
onChaptersChanged: {
|
||||
chapterMarker.destroy()
|
||||
}
|
||||
|
|
|
@ -140,14 +140,19 @@ Slider {
|
|||
Item {
|
||||
anchors.fill: parent
|
||||
id: chapterMarkers
|
||||
z: 60
|
||||
Connections {
|
||||
target: player
|
||||
onChaptersChanged: function (chapters) {
|
||||
for (var i = 0, len = chapters.length; i < len; i++) {
|
||||
var component = Qt.createComponent("ChapterMarker.qml")
|
||||
var component = Qt.createComponent("ChapterMarkerItem.qml")
|
||||
|
||||
var marker = component.createObject(chapterMarkers, {
|
||||
"time": chapters[i]["time"]
|
||||
})
|
||||
if (marker == null) {
|
||||
console.error(component.errorString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,6 +269,20 @@ MenuBar {
|
|||
}
|
||||
shortcut: keybinds.backwardFrame
|
||||
}
|
||||
Action {
|
||||
text: translate.getTranslation("PREVIOUS_CHAPTER", i18n.language)
|
||||
onTriggered: {
|
||||
player.playerCommand(Enums.Commands.PreviousChapter)
|
||||
}
|
||||
shortcut: keybinds.previousChapter
|
||||
}
|
||||
Action {
|
||||
text: translate.getTranslation("NEXT_CHAPTER", i18n.language)
|
||||
onTriggered: {
|
||||
player.playerCommand(Enums.Commands.NextChapter)
|
||||
}
|
||||
shortcut: keybinds.nextChapter
|
||||
}
|
||||
}
|
||||
|
||||
CustomMenu {
|
||||
|
|
|
@ -61,7 +61,9 @@ var translations = {
|
|||
FONT: "Font",
|
||||
SUBTITLES_FONT_SIZE: "Subtitles Font Size",
|
||||
UI_FADE_TIME: "UI Fade Time (ms)",
|
||||
UPDATE_APPIMAGE: "Update (AppImage Only)"
|
||||
UPDATE_APPIMAGE: "Update (AppImage Only)",
|
||||
PREVIOUS_CHAPTER: "Previous Chapter",
|
||||
NEXT_CHAPTER: "Next Chapter"
|
||||
},
|
||||
spanish: {
|
||||
OPEN_FILE: "Abrir archivo",
|
||||
|
|
|
@ -146,9 +146,8 @@ Window {
|
|||
property string cycleAudio: "A"
|
||||
property string cycleVideo: "V"
|
||||
property string cycleVideoAspect: "Shift+A"
|
||||
property string screenshot: "S"
|
||||
property string screenshotWithoutSubtitles: "Shift+S"
|
||||
property string fullScreenshot: "Ctrl+S"
|
||||
property string previousChapter: "Ctrl+Left"
|
||||
property string nextChapter: "Ctrl+Right"
|
||||
property string nyanCat: "Ctrl+N"
|
||||
property string decreaseSpeedByPointOne: "["
|
||||
property string increaseSpeedByPointOne: "]"
|
||||
|
|
Loading…
Reference in a new issue