ui components to control looping on the fly
This commit is contained in:
parent
39ea1eb759
commit
a3be06639b
7 changed files with 58 additions and 10 deletions
|
@ -224,6 +224,7 @@ MpvObject::MpvObject(QQuickItem *parent)
|
|||
WATCH_PROP_STRING("hwdec")
|
||||
WATCH_PROP_STRING("hwdec-current")
|
||||
WATCH_PROP_STRING("hwdec-interop")
|
||||
WATCH_PROP_STRING("loop")
|
||||
WATCH_PROP_STRING("media-title")
|
||||
WATCH_PROP_STRING("path")
|
||||
WATCH_PROP_STRING("video-codec")
|
||||
|
@ -430,13 +431,14 @@ void MpvObject::handle_mpv_event(mpv_event *event)
|
|||
else if HANDLE_PROP_STRING("hwdec", hwdec)
|
||||
else if HANDLE_PROP_STRING("hwdec-current", hwdecCurrent)
|
||||
else if HANDLE_PROP_STRING("hwdec-interop", hwdecInterop)
|
||||
else if HANDLE_PROP_STRING("media-title", mediaTitle)
|
||||
else if HANDLE_PROP_STRING("path", path)
|
||||
else if HANDLE_PROP_STRING("video-codec", videoCodec)
|
||||
else if HANDLE_PROP_STRING("video-format", videoFormat)
|
||||
else if HANDLE_PROP_STRING("video-params/pixelformat", videoParamsPixelformat)
|
||||
else if HANDLE_PROP_STRING("video-out-params/pixelformat", videoOutParamsPixelformat)
|
||||
else if HANDLE_PROP_STRING("ytdl-format", ytdlFormat)
|
||||
else if HANDLE_PROP_STRING("loop", loop)
|
||||
else if HANDLE_PROP_STRING("media-title", mediaTitle)
|
||||
else if HANDLE_PROP_STRING("path", path)
|
||||
else if HANDLE_PROP_STRING("video-codec", videoCodec)
|
||||
else if HANDLE_PROP_STRING("video-format", videoFormat)
|
||||
else if HANDLE_PROP_STRING("video-params/pixelformat", videoParamsPixelformat)
|
||||
else if HANDLE_PROP_STRING("video-out-params/pixelformat", videoOutParamsPixelformat)
|
||||
else if HANDLE_PROP_STRING("ytdl-format", ytdlFormat)
|
||||
|
||||
|
||||
} else if (prop->format == MPV_FORMAT_INT64) {
|
||||
|
|
|
@ -94,6 +94,7 @@ class MpvObject : public QQuickFramebufferObject
|
|||
WRITABLE_PROP_STRING("hwdec", hwdec)
|
||||
READONLY_PROP_STRING("hwdec-current", hwdecCurrent)
|
||||
READONLY_PROP_STRING("hwdec-interop", hwdecInterop)
|
||||
WRITABLE_PROP_STRING("loop", loop)
|
||||
READONLY_PROP_STRING("media-title", mediaTitle)
|
||||
READONLY_PROP_STRING("path", path)
|
||||
READONLY_PROP_STRING("video-codec", videoCodec)
|
||||
|
|
|
@ -163,6 +163,11 @@ Controls.Page {
|
|||
print("Slide changed to: " + item.name);
|
||||
}
|
||||
|
||||
function loopVideo() {
|
||||
presentation.loopVideo();
|
||||
pWindow.loopVideo();
|
||||
}
|
||||
|
||||
function editSwitch(item) {
|
||||
if (editMode) {
|
||||
switch (editType) {
|
||||
|
|
|
@ -19,8 +19,6 @@ FocusScope {
|
|||
|
||||
property Item slide: previewSlide
|
||||
|
||||
onActiveFocusChanged: showPassiveNotification("OUCH")
|
||||
|
||||
Item {
|
||||
id: keyHandler
|
||||
anchors.fill: parent
|
||||
|
@ -65,6 +63,11 @@ FocusScope {
|
|||
Controls.ToolSeparator {}
|
||||
Item { Layout.fillWidth: true }
|
||||
Controls.ToolSeparator {}
|
||||
Controls.ToolButton {
|
||||
text: "Repeat"
|
||||
icon.name: "repeat"
|
||||
onClicked: mainPage.loopVideo()
|
||||
}
|
||||
Controls.ToolButton {
|
||||
text: "Effects"
|
||||
icon.name: "image-auto-adjust"
|
||||
|
@ -152,6 +155,13 @@ FocusScope {
|
|||
live: true
|
||||
onMoved: changeVidPos(value);
|
||||
}
|
||||
|
||||
Controls.Switch {
|
||||
text: "Loop"
|
||||
visible: itemType === "video";
|
||||
checked: previewSlide.mpvLoop === "inf" ? true : false
|
||||
onToggled: mainPage.loopVideo()
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
|
@ -273,6 +283,10 @@ FocusScope {
|
|||
previewSlide.loadVideo();
|
||||
}
|
||||
|
||||
function loopVideo() {
|
||||
previewSlide.loopVideo();
|
||||
}
|
||||
|
||||
function stopVideo() {
|
||||
/* showPassiveNotification("Stopping Video") */
|
||||
previewSlide.stopVideo()
|
||||
|
|
|
@ -79,4 +79,7 @@ Window {
|
|||
presentationSlide.pauseVideo();
|
||||
}
|
||||
|
||||
function loopVideo() {
|
||||
presentationSlide.loopVideo();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ Item {
|
|||
//these properties are for giving video info to parents
|
||||
property int mpvPosition: mpv.position
|
||||
property int mpvDuration: mpv.duration
|
||||
property var mpvLoop: mpv.getProperty("loop")
|
||||
property var mpvLoop: mpv.loop
|
||||
property bool mpvIsPlaying: mpv.isPlaying
|
||||
|
||||
// These properties help to determine the state of the slide
|
||||
|
@ -167,6 +167,17 @@ Item {
|
|||
lyrics.text = text
|
||||
}
|
||||
|
||||
function loopVideo() {
|
||||
if (mpv.getProperty("loop") === "inf") {
|
||||
showPassiveNotification("already looping");
|
||||
mpv.setProperty("loop", "no");
|
||||
}
|
||||
else {
|
||||
mpv.setProperty("loop", "inf");
|
||||
showPassiveNotification("looping video");
|
||||
}
|
||||
}
|
||||
|
||||
function loadVideo() {
|
||||
mpvLoadingTimer.restart()
|
||||
}
|
||||
|
|
|
@ -143,6 +143,18 @@ Item {
|
|||
onEditingFinished: updateTitle(text);
|
||||
}
|
||||
|
||||
Controls.CheckBox {
|
||||
id: loopCheckBox
|
||||
Layout.preferredWidth: 300
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 20
|
||||
Layout.rightMargin: 20
|
||||
|
||||
text: "Repeat"
|
||||
padding: 10
|
||||
onToggled: showPassiveNotification("BOOM!")
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.preferredWidth: 300
|
||||
Layout.fillWidth: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue