Add big hack to make KittehPlayer run on pinephone without config changes.
This commit is contained in:
parent
15862e5c44
commit
0dba1c9146
23
src/main.cpp
23
src/main.cpp
|
@ -89,7 +89,6 @@ spdLogger(QtMsgType type, const QMessageLogContext& context, const QString& msg)
|
|||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
qInstallMessageHandler(spdLogger);
|
||||
|
||||
auto launcherLogger = initLogger("launcher");
|
||||
|
@ -102,13 +101,27 @@ main(int argc, char* argv[])
|
|||
app.setOrganizationDomain("namedkitten.pw");
|
||||
app.setApplicationName("KittehPlayer");
|
||||
|
||||
#ifdef __linux__
|
||||
catchUnixSignals({ SIGQUIT, SIGINT, SIGTERM, SIGHUP });
|
||||
#endif
|
||||
|
||||
QSettings settings;
|
||||
Utils::SetDPMS(false);
|
||||
|
||||
#ifdef __linux__
|
||||
catchUnixSignals({ SIGQUIT, SIGINT, SIGTERM, SIGHUP });
|
||||
|
||||
// WARNING, THIS IS A BIG HACK
|
||||
// this is only to make it so KittehPlayer works first try on pinephone.
|
||||
// TODO: launch a opengl window or use offscreen to see if GL_ARB_framebuffer_object
|
||||
// can be found
|
||||
if (! settings.value("Backend/disableSunxiCheck", false).toBool()) {
|
||||
FILE *fd = popen("grep sunxi /proc/modules", "r");
|
||||
char buf[16];
|
||||
if (fread(buf, 1, sizeof (buf), fd) > 0)
|
||||
launcherLogger->info("Running on sunxi, switching to NoFBO.");
|
||||
settings.setValue("Backend/fbo", false);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
QString newpath =
|
||||
QProcessEnvironment::systemEnvironment().value("APPDIR", "") +
|
||||
"/usr/bin:" + QProcessEnvironment::systemEnvironment().value("PATH", "");
|
||||
|
|
|
@ -29,7 +29,6 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
setControlsTheme(appearance.themeName)
|
||||
}
|
||||
|
@ -117,7 +116,8 @@ Item {
|
|||
|
||||
VideoProgress {
|
||||
id: progressBar
|
||||
visible: controlsBarItem.controlsShowing && (appearance.themeName == "RoosterTeeth" ? false : true)
|
||||
visible: controlsBarItem.controlsShowing
|
||||
&& (appearance.themeName == "RoosterTeeth" ? false : true)
|
||||
anchors.bottom: controlsBackground.top
|
||||
anchors.left: controlsBackground.left
|
||||
anchors.right: controlsBackground.right
|
||||
|
|
|
@ -98,7 +98,6 @@ Slider {
|
|||
onEntered: timestampBox.visible = true
|
||||
onExited: timestampBox.visible = false
|
||||
|
||||
|
||||
onPositionChanged: {
|
||||
var a = (progressBar.to / progressBar.availableWidth)
|
||||
* (mouseAreaProgressBar.mapToItem(
|
||||
|
@ -179,7 +178,8 @@ Slider {
|
|||
id: handleRect
|
||||
x: progressBar.visualPosition * (progressBar.availableWidth - width)
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: progressBar.center ? (progressBar.height / 2) - (height / 2) : -height / 4
|
||||
anchors.bottomMargin: progressBar.center ? (progressBar.height / 2)
|
||||
- (height / 2) : -height / 4
|
||||
implicitHeight: radius
|
||||
implicitWidth: radius
|
||||
radius: mainWindow.virtualHeight / 59
|
||||
|
|
|
@ -26,8 +26,8 @@ Window {
|
|||
|
||||
Item {
|
||||
id: globalConnections
|
||||
signal showUI()
|
||||
signal hideUI()
|
||||
signal showUI
|
||||
signal hideUI
|
||||
}
|
||||
|
||||
function getAppearanceValueForTheme(themeName, name) {
|
||||
|
@ -336,7 +336,6 @@ Window {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
Item {
|
||||
id: controlsOverlay
|
||||
anchors.centerIn: player
|
||||
|
@ -355,7 +354,6 @@ Window {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
MouseArea {
|
||||
id: mouseAreaBar
|
||||
width: parent.width
|
||||
|
@ -384,7 +382,6 @@ Window {
|
|||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
|
||||
|
||||
Timer {
|
||||
id: mouseTapTimer
|
||||
interval: 200
|
||||
|
@ -398,16 +395,17 @@ Window {
|
|||
function doubleMouseClick(mouse) {
|
||||
if (appearance.doubleTapToSeek) {
|
||||
if (mouse.x > (mouseAreaPlayer.width / 2)) {
|
||||
player.playerCommand(Enums.Commands.Seek, String(appearance.doubleTapToSeekBy))
|
||||
player.playerCommand(Enums.Commands.Seek, String(
|
||||
appearance.doubleTapToSeekBy))
|
||||
} else {
|
||||
player.playerCommand(Enums.Commands.Seek,"-" + String(appearance.doubleTapToSeekBy))
|
||||
player.playerCommand(Enums.Commands.Seek, "-" + String(
|
||||
appearance.doubleTapToSeekBy))
|
||||
}
|
||||
} else {
|
||||
toggleFullscreen()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onClicked: function (mouse) {
|
||||
if (mouseTapTimer.running) {
|
||||
doubleMouseClick(mouse)
|
||||
|
|
Loading…
Reference in a new issue