starting to build
This commit is contained in:
parent
61aef5c48f
commit
7b82202c51
6 changed files with 75 additions and 77 deletions
|
@ -1,7 +1,7 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15 as Controls
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtMultimedia 5.15
|
||||
import QtMultimedia
|
||||
/* import QtAudioEngine 1.15 */
|
||||
import QtWebEngine 1.10
|
||||
import QtGraphicalEffects 1.15
|
||||
|
@ -53,27 +53,14 @@ Item {
|
|||
anchors.fill: parent
|
||||
color: "black"
|
||||
|
||||
MpvObject {
|
||||
id: mpv
|
||||
Video {
|
||||
id: video
|
||||
/* objectName: "mpv" */
|
||||
anchors.fill: parent
|
||||
useHwdec: true
|
||||
enableAudio: !preview
|
||||
/* useHwdec: true */
|
||||
muted: preview
|
||||
Component.onCompleted: mpvLoadingTimer.start()
|
||||
onFileLoaded: {
|
||||
/* showPassiveNotification(videoSource + " has been loaded"); */
|
||||
if (itemType == "song") {
|
||||
mpv.setProperty("loop", "inf");
|
||||
} else if (vidLoop) {
|
||||
mpv.setProperty("loop", "inf");
|
||||
} else {
|
||||
mpv.setProperty("loop", "no");
|
||||
}
|
||||
/* showPassiveNotification(mpv.getProperty("loop")); */
|
||||
mpv.setProperty("sid", "no");
|
||||
|
||||
}
|
||||
/* onIsPlayingChanged: showPassiveNotification(mpv.getProperty("pause")) */
|
||||
loops: itemType == "song" ? MediaPlayer.Infinite : vidLoop ? MediaPlayer.Infinite : 1
|
||||
|
||||
MouseArea {
|
||||
id: playArea
|
||||
|
@ -84,32 +71,32 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: mpvLoadingTimer
|
||||
interval: 500
|
||||
onTriggered: {
|
||||
/* showPassiveNotification("YIPPEEE!") */
|
||||
mpv.stop();
|
||||
if (vidStartTime > 0 && vidStartTime < vidEndTime) {
|
||||
/* mpv.seek(vidStartTime); */
|
||||
let start = "+" + vidStartTime;
|
||||
let end = "+" + vidEndTime;
|
||||
mpv.setProperty("start", start);
|
||||
mpv.setProperty("end", end);
|
||||
Utils.dbg("Setting position to: " + mpv.position);
|
||||
} else {
|
||||
mpv.setProperty("start", "none");
|
||||
mpv.setProperty("end", "none");
|
||||
}
|
||||
mpv.loadFile(videoSource.toString());
|
||||
Utils.dbg("Setting position to: " + vidStartTime + " and end is " + vidEndTime);
|
||||
if (editMode) {
|
||||
console.log("WHY AREN'T YOU PASUING!");
|
||||
pauseTimer.restart();
|
||||
}
|
||||
blackTimer.restart();
|
||||
}
|
||||
}
|
||||
/* Timer { */
|
||||
/* id: mpvLoadingTimer */
|
||||
/* interval: 500 */
|
||||
/* onTriggered: { */
|
||||
/* /\* showPassiveNotification("YIPPEEE!") *\/ */
|
||||
/* mpv.stop(); */
|
||||
/* if (vidStartTime > 0 && vidStartTime < vidEndTime) { */
|
||||
/* /\* mpv.seek(vidStartTime); *\/ */
|
||||
/* let start = "+" + vidStartTime; */
|
||||
/* let end = "+" + vidEndTime; */
|
||||
/* mpv.setProperty("start", start); */
|
||||
/* mpv.setProperty("end", end); */
|
||||
/* Utils.dbg("Setting position to: " + mpv.position); */
|
||||
/* } else { */
|
||||
/* mpv.setProperty("start", "none"); */
|
||||
/* mpv.setProperty("end", "none"); */
|
||||
/* } */
|
||||
/* mpv.loadFile(videoSource.toString()); */
|
||||
/* Utils.dbg("Setting position to: " + vidStartTime + " and end is " + vidEndTime); */
|
||||
/* if (editMode) { */
|
||||
/* console.log("WHY AREN'T YOU PASUING!"); */
|
||||
/* pauseTimer.restart(); */
|
||||
/* } */
|
||||
/* blackTimer.restart(); */
|
||||
/* } */
|
||||
/* } */
|
||||
|
||||
Timer {
|
||||
id: pauseTimer
|
||||
|
@ -132,13 +119,15 @@ Item {
|
|||
visible: false
|
||||
}
|
||||
|
||||
MpvObject {
|
||||
MediaPlayer {
|
||||
id: audio
|
||||
useHwdec: true
|
||||
enableAudio: true
|
||||
audioOutput: AudioOutput {}
|
||||
/* useHwdec: true */
|
||||
/* enableAudio: true */
|
||||
|
||||
// embeded mpv allows to set commandline propertys using the options/<name>
|
||||
// syntax. This could be abstracted later, but for now this works.
|
||||
Component.onCompleted: audio.setProperty("options/audio-display", "no");
|
||||
/* Component.onCompleted: audio.setProperty("options/audio-display", "no"); */
|
||||
}
|
||||
|
||||
Image {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue