forked from ghostfox/qyouradio
Fix theme on native light mode, implement volume slider
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -87,4 +87,5 @@ out/
|
||||
|
||||
.direnv
|
||||
dist
|
||||
CMakePresets.json
|
||||
CMakeUserPresets.json
|
||||
17
.vscode/tasks.json
vendored
Normal file
17
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "cmake",
|
||||
"label": "CMake: build",
|
||||
"command": "build",
|
||||
"options": {"cwd": "${workspaceFolder}/build"},
|
||||
"targets": [
|
||||
"all"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": [],
|
||||
"detail": "CMake template build task"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"configurePresets": [
|
||||
{
|
||||
"hidden": true,
|
||||
"name": "Qt",
|
||||
"cacheVariables": {
|
||||
"CMAKE_PREFIX_PATH": "$env{QTDIR}"
|
||||
},
|
||||
"vendor": {
|
||||
"qt-project.org/Qt": {
|
||||
"checksum": "wVa86FgEkvdCTVp1/nxvrkaemJc="
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"vendor": {
|
||||
"qt-project.org/Presets": {
|
||||
"checksum": "67SmY24ZeVbebyKD0fGfIzb/bGI="
|
||||
}
|
||||
}
|
||||
}
|
||||
5
Main.qml
5
Main.qml
@@ -42,6 +42,9 @@ ApplicationWindow {
|
||||
TabBar {
|
||||
id: tabbar
|
||||
spacing: 10
|
||||
|
||||
background: Item{}
|
||||
|
||||
TabButton {
|
||||
text: qsTr("Autoradio")
|
||||
}
|
||||
@@ -95,7 +98,7 @@ ApplicationWindow {
|
||||
visible: status == Loader.Ready
|
||||
sourceComponent: ViewPlayer {
|
||||
title: qsTr("Deep Bass")
|
||||
streamURL: "https://youradio.nonamesoft.xyz/api/deepbass"
|
||||
streamURL: "https://youradio.nonamesoft.xyz/api/bassboosted"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
Player.qml
11
Player.qml
@@ -5,6 +5,13 @@ pragma Singleton
|
||||
MediaPlayer {
|
||||
source: ""
|
||||
|
||||
audioOutput: AudioOutput {
|
||||
id: output
|
||||
volume: 0.4
|
||||
}
|
||||
|
||||
property alias volume: output.volume
|
||||
|
||||
function startPlaying(url) {
|
||||
if (playing) {
|
||||
return;
|
||||
@@ -20,10 +27,6 @@ MediaPlayer {
|
||||
stop();
|
||||
}
|
||||
|
||||
audioOutput: AudioOutput {
|
||||
volume: 0.4
|
||||
}
|
||||
|
||||
onErrorOccurred: function(error, errorString) {
|
||||
stopPlaying();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import QtQuick.Controls.Basic 6.8
|
||||
Label {
|
||||
property string heading: "base"
|
||||
|
||||
color: Colors.text
|
||||
font.family: Colors.fontFamily
|
||||
font.pixelSize: Colors.fontSize[heading]
|
||||
}
|
||||
|
||||
@@ -8,20 +8,20 @@ Slider {
|
||||
implicitWidth: 130
|
||||
implicitHeight: 20
|
||||
|
||||
// OpacityAnimator on opacity{
|
||||
// from: 0.7
|
||||
// to: 1
|
||||
// duration: 200
|
||||
// target: parent
|
||||
// running: parent.hovered
|
||||
// }
|
||||
// OpacityAnimator on opacity{
|
||||
// from: 1
|
||||
// to: 0.7
|
||||
// duration: 200
|
||||
// target: parent
|
||||
// running: !parent.hovered
|
||||
// }
|
||||
OpacityAnimator on opacity{
|
||||
from: 0.7
|
||||
to: 1
|
||||
duration: 200
|
||||
target: this
|
||||
running: parent.hovered
|
||||
}
|
||||
OpacityAnimator on opacity{
|
||||
from: 1
|
||||
to: 0.7
|
||||
duration: 200
|
||||
target: this
|
||||
running: !parent.hovered
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: "#555"
|
||||
|
||||
@@ -80,6 +80,8 @@ ColumnLayout {
|
||||
from: 0.1
|
||||
to: 1.1
|
||||
stepSize: 0.1
|
||||
value: Player.volume + 0.1
|
||||
onMoved: Player.volume = value - 0.1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user