[UI+Backend] Fixed playlist menu pausing and added minor improvements.
This commit is contained in:
parent
e7c0e1af92
commit
13b4b53e9d
|
@ -16,6 +16,12 @@
|
||||||
#include "discord_rpc.h"
|
#include "discord_rpc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <QX11Info>
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -90,13 +96,19 @@ public:
|
||||||
.h = fbo->height(),
|
.h = fbo->height(),
|
||||||
.internal_format = 0 };
|
.internal_format = 0 };
|
||||||
int flip_y{ 0 };
|
int flip_y{ 0 };
|
||||||
|
#ifdef __linux__
|
||||||
|
Display* dpy = QX11Info::display();
|
||||||
|
#endif
|
||||||
mpv_render_param params[] = {
|
mpv_render_param params[] = {
|
||||||
// Specify the default framebuffer (0) as target. This will
|
// Specify the default framebuffer (0) as target. This will
|
||||||
// render onto the entire screen. If you want to show the video
|
// render onto the entire screen. If you want to show the video
|
||||||
// in a smaller rectangle or apply fancy transformations, you'll
|
// in a smaller rectangle or apply fancy transformations, you'll
|
||||||
// need to render into a separate FBO and draw it manually.
|
// need to render into a separate FBO and draw it manually.
|
||||||
{ MPV_RENDER_PARAM_OPENGL_FBO, &mpfbo },
|
{ MPV_RENDER_PARAM_OPENGL_FBO, &mpfbo },
|
||||||
|
#ifdef __linux__
|
||||||
|
{ MPV_RENDER_PARAM_X11_DISPLAY, dpy },
|
||||||
|
#endif
|
||||||
|
|
||||||
// Flip rendering (needed due to flipped GL coordinate system).
|
// Flip rendering (needed due to flipped GL coordinate system).
|
||||||
{ MPV_RENDER_PARAM_FLIP_Y, &flip_y },
|
{ MPV_RENDER_PARAM_FLIP_Y, &flip_y },
|
||||||
{ MPV_RENDER_PARAM_INVALID, nullptr }
|
{ MPV_RENDER_PARAM_INVALID, nullptr }
|
||||||
|
|
|
@ -116,9 +116,6 @@ main(int argc, char* argv[])
|
||||||
"/usr/bin:" + QProcessEnvironment::systemEnvironment().value("PATH", "");
|
"/usr/bin:" + QProcessEnvironment::systemEnvironment().value("PATH", "");
|
||||||
setenv("PATH", newpath.toUtf8().constData(), 1);
|
setenv("PATH", newpath.toUtf8().constData(), 1);
|
||||||
|
|
||||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
||||||
QApplication::setAttribute(Qt::AA_NativeWindows);
|
|
||||||
|
|
||||||
qmlRegisterUncreatableMetaObject(
|
qmlRegisterUncreatableMetaObject(
|
||||||
Enums::staticMetaObject, // static meta object
|
Enums::staticMetaObject, // static meta object
|
||||||
"player", // import statement (can be any string)
|
"player", // import statement (can be any string)
|
||||||
|
|
|
@ -13,11 +13,9 @@ Dialog {
|
||||||
width: 720
|
width: 720
|
||||||
modality: Qt.NonModal
|
modality: Qt.NonModal
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
player.titleChanged.connect(updatePlaylistMenu)
|
|
||||||
player.playlistChanged.connect(updatePlaylistMenu)
|
player.playlistChanged.connect(updatePlaylistMenu)
|
||||||
}
|
}
|
||||||
function updatePlaylistMenu() {
|
function updatePlaylistMenu(playlist) {
|
||||||
var playlist = player.playerCommand(Enums.Commands.GetPlaylist)
|
|
||||||
playlistModel.clear()
|
playlistModel.clear()
|
||||||
for (var thing in playlist) {
|
for (var thing in playlist) {
|
||||||
var item = playlist[thing]
|
var item = playlist[thing]
|
||||||
|
|
|
@ -9,12 +9,13 @@ import player 1.0
|
||||||
|
|
||||||
import "codes.js" as LanguageCodes
|
import "codes.js" as LanguageCodes
|
||||||
|
|
||||||
ApplicationWindow {
|
Window {
|
||||||
id: mainWindow
|
id: mainWindow
|
||||||
title: titleLabel.text
|
title: titleLabel.text
|
||||||
visible: true
|
visible: true
|
||||||
width: 720
|
width: 720
|
||||||
height: 480
|
height: 480
|
||||||
|
|
||||||
Translator {
|
Translator {
|
||||||
id: translate
|
id: translate
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue