Skip to content
Permalink
Browse files

Merge pull request #341 from YIO-Remote/dev

Dev
  • Loading branch information
martonborzak committed Nov 26, 2019
2 parents 543a708 + 035bd40 commit 1dd11200ed3bd9699d8dce8c4a30ac765a589e97
Showing with 1,392 additions and 526 deletions.
  1. +7 βˆ’0 MainContainer.qml
  2. +5 βˆ’0 StandbyControl.qml
  3. +1 βˆ’1 basic_ui/LoadingScreen.qml
  4. +21 βˆ’25 basic_ui/MiniMediaPlayer.qml
  5. +2 βˆ’2 basic_ui/Volume.qml
  6. +16 βˆ’3 components/ButtonBase.qml
  7. +4 βˆ’3 components/blind/ui/Button.qml
  8. +3 βˆ’2 components/light/ui/Button.qml
  9. +9 βˆ’16 components/media_player/ui/Button.qml
  10. +258 βˆ’252 components/media_player/ui/Card.qml
  11. +247 βˆ’0 components/media_player/ui/CardHome.qml
  12. +83 βˆ’0 components/media_player/ui/CardSearch.qml
  13. +1 βˆ’1 components/remote/ui/Button.qml
  14. +12 βˆ’6 main.qml
  15. +2 βˆ’0 qml.qrc
  16. +4 βˆ’0 remote.pro
  17. +7 βˆ’0 sources/bluetootharea.cpp
  18. +1 βˆ’1 sources/bluetootharea.h
  19. +20 βˆ’0 sources/config.cpp
  20. +4 βˆ’0 sources/config.h
  21. +4 βˆ’3 sources/configinterface.h
  22. +61 βˆ’14 sources/entities/blind.cpp
  23. +26 βˆ’13 sources/entities/blind.h
  24. +37 βˆ’0 sources/entities/blindinterface.h
  25. +19 βˆ’10 sources/entities/entities.cpp
  26. +4 βˆ’5 sources/entities/entities.h
  27. +5 βˆ’2 sources/entities/entitiesinterface.h
  28. +32 βˆ’4 sources/entities/entity.cpp
  29. +31 βˆ’21 sources/entities/entity.h
  30. +41 βˆ’0 sources/entities/entityinterface.h
  31. +73 βˆ’22 sources/entities/light.cpp
  32. +31 βˆ’19 sources/entities/light.h
  33. +38 βˆ’0 sources/entities/lightinterface.h
  34. +134 βˆ’47 sources/entities/mediaplayer.cpp
  35. +82 βˆ’42 sources/entities/mediaplayer.h
  36. +48 βˆ’0 sources/entities/mediaplayerinterface.h
  37. +2 βˆ’1 sources/entities/remote.cpp
  38. +1 βˆ’1 sources/entities/remote.h
  39. +0 βˆ’6 sources/integrations/integrationinterface.h
  40. +4 βˆ’0 sources/integrations/integrations.cpp
  41. +1 βˆ’0 sources/launcher.cpp
  42. +4 βˆ’1 sources/logger.h
  43. +1 βˆ’1 sources/main.cpp
  44. +4 βˆ’0 sources/notifications.cpp
  45. +2 βˆ’2 sources/notificationsinterface.h
@@ -201,6 +201,13 @@ Item {
miniMediaPlayerLoader.setSource("qrc:/basic_ui/MiniMediaPlayer.qml")
miniMediaPlayerLoader.active = true;
}

if (entities.mediaplayersPlaying.length === 0) {
loader_main.state = "visible";
miniMediaPlayer.height = 0;
miniMediaPlayer.miniMediaPlayerLoader.source = "";
miniMediaPlayer.miniMediaPlayerLoader.active = false;
}
}
}

@@ -29,6 +29,9 @@ Item {
property int screenOnTime: 0
property int screenOffTime: 0

signal standByOn()
signal standByOff()

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TOUCH EVENT DETECTOR
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -207,10 +210,12 @@ Item {
// if mode is on change processor to ondemand
if (mode === "on") {
standbyLauncher.launch("/usr/bin/yio-remote/ondemand.sh");
standByOff();
}
// if mode is standby change processor to powersave
if (mode === "standby") {
standbyLauncher.launch("/usr/bin/yio-remote/powersave.sh");
standByOn();
}
}

@@ -44,7 +44,7 @@ Rectangle {
id: endAnim
running: false

PauseAnimation {duration: 3000}
// PauseAnimation {duration: 3000}
PropertyAnimation { target: loadingIconAnim; properties: "running";to: false; duration: 0 }
PropertyAnimation { target: yio_O; properties: "opacity"; to: 0; easing.type: Easing.OutExpo; duration: 400 }
PauseAnimation {duration: 200}
@@ -45,7 +45,7 @@ Item {
},
Transition {to: "open";
ParallelAnimation {
PropertyAnimation { target: miniMediaPlayer; properties: "height"; easing.type: Easing.OutBack; easing.overshoot: 1; duration: 300 }
PropertyAnimation { target: miniMediaPlayer; properties: "height"; easing.type: Easing.OutBack; easing.overshoot: 1.2; duration: 300 }
ParentAnimation {
NumberAnimation { properties: "scale"; easing.type: Easing.OutBack; easing.overshoot: 1; duration: 300 }
}
@@ -71,19 +71,6 @@ Item {
}
}

Connections {
target: entities

onMediaplayersPlayingChanged: {
if (entities.mediaplayersPlaying.length == 0) {
loader_main.state = "visible";
loader_main.item.miniMediaPlayer.height = 0;
loader_main.item.miniMediaPlayer.miniMediaPlayerLoader.source = "";
loader_main.item.miniMediaPlayer.miniMediaPlayerLoader.active = false;
}
}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CONNECT TO BUTTONS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -120,6 +107,7 @@ Item {

Connections {
target: buttonHandler
enabled: loader_main.state == "visible" || miniMediaPlayer.state == "open" ? true : false

onButtonPress: {
switch (button) {
@@ -156,16 +144,16 @@ Item {
volume.volumePosition = mediaPlayers.currentItem.player.obj.volume;
volume.state = "visible";
}
var newvolume = mediaPlayers.currentItem.player.obj.volume + 0.02;
if (newvolume > 1) newvolume = 1;
var newvolume = mediaPlayers.currentItem.player.obj.volume + 2;
if (newvolume > 100) newvolume = 100;
mediaPlayers.currentItem.player.obj.setVolume(newvolume);
volume.volumePosition = newvolume;
} else {
if (volume.state != "visible") {
volume.volumePosition = mediaPlayers.currentItem.player.obj.volume;
volume.state = "visible";
}
newvolume = mediaPlayers.currentItem.player.obj.volume - 0.02;
newvolume = mediaPlayers.currentItem.player.obj.volume - 2;
if (newvolume < 0) newvolume = 0;
mediaPlayers.currentItem.player.obj.setVolume(newvolume);
volume.volumePosition = newvolume;
@@ -211,11 +199,11 @@ Item {
PropertyChanges {target: artistOpen; opacity: 0.8 }
PropertyChanges {target: indicator; opacity: 1 }
PropertyChanges {target: speaker; opacity: 1 }
PropertyChanges {target: playButton; opacity: 1 }
PropertyChanges {target: playButton; opacity: 1; anchors.bottomMargin: 80 }
PropertyChanges {target: prevButton; opacity: 1 }
PropertyChanges {target: nextButton; opacity: 1 }
PropertyChanges {target: sourceText; opacity: 1 }
PropertyChanges {target: bgImage; opacity: 1; visible: true }
PropertyChanges {target: bgImage; opacity: 1; visible: true; anchors.topMargin: 86; scale: 1 }
PropertyChanges {target: image; opacity: 0 }
},
State {
@@ -228,11 +216,11 @@ Item {
PropertyChanges {target: artistOpen; opacity: 0 }
PropertyChanges {target: indicator; opacity: 0 }
PropertyChanges {target: speaker; opacity: 0 }
PropertyChanges {target: playButton; opacity: 0 }
PropertyChanges {target: playButton; opacity: 0; anchors.bottomMargin: 40 }
PropertyChanges {target: prevButton; opacity: 0 }
PropertyChanges {target: nextButton; opacity: 0 }
PropertyChanges {target: sourceText; opacity: 0 }
PropertyChanges {target: bgImage; opacity: 0; visible: false }
PropertyChanges {target: bgImage; opacity: 0; visible: false; anchors.topMargin: 126; scale: 0.8 }
PropertyChanges {target: image; opacity: 1 }
}]

@@ -256,14 +244,18 @@ Item {
PropertyAnimation { target: artistOpen; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
ParallelAnimation {
PropertyAnimation { target: playButton; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: playButton; properties: "anchors.bottomMargin"; easing.type: Easing.OutBack; easing.overshoot: 1.4; duration: 300 }
PropertyAnimation { target: prevButton; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: nextButton; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
}
}
PropertyAnimation { target: speaker; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
SequentialAnimation {
PropertyAnimation { target: bgImage; properties: "visible"; duration: 1 }
PropertyAnimation { target: bgImage; properties: "opacity"; easing.type: Easing.OutExpo; duration: 500 }
ParallelAnimation {
PropertyAnimation { target: bgImage; properties: "opacity"; easing.type: Easing.OutExpo; duration: 400 }
PropertyAnimation { target: bgImage; properties: "anchors.topMargin, scale"; easing.type: Easing.OutBack; easing.overshoot: 1.4; duration: 400 }
}
}
}
}
@@ -273,7 +265,7 @@ Item {
Transition {
to: "closed"
SequentialAnimation {
PropertyAnimation { target: bgImage; properties: "opacity"; easing.type: Easing.OutExpo; duration: 200 }
PropertyAnimation { target: bgImage; properties: "opacity, anchors.topMargin, scale"; easing.type: Easing.OutExpo; duration: 200 }
PropertyAnimation { target: bgImage; properties: "visible"; duration: 1 }
ParallelAnimation {
PropertyAnimation { target: title; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
@@ -283,7 +275,7 @@ Item {
PropertyAnimation { target: artistOpen; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: indicator; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: speaker; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: playButton; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: playButton; properties: "opacity, anchors.bottomMargin"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: prevButton; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: nextButton; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
PropertyAnimation { target: sourceText; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
@@ -585,7 +577,11 @@ Item {

onClicked: {
haptic.playEffect("click");
entities.mediaplayersPlaying[mediaPlayers.currentIndex].play();
if (entities.mediaplayersPlaying[mediaPlayers.currentIndex].state == 3) {
entities.mediaplayersPlaying[mediaPlayers.currentIndex].pause();
} else {
entities.mediaplayersPlaying[mediaPlayers.currentIndex].play();
}
}
}
}
@@ -7,7 +7,7 @@ Item {
width: parent.width
height: 160

property double volumePosition
property int volumePosition

state: "hidden"

@@ -74,7 +74,7 @@ Item {
Rectangle {
id: volumeBar
height: parent.height
width: bg.width * volumePosition
width: bg.width * volumePosition/100
color: colorLine
anchors.left: parent.left
}
@@ -24,6 +24,7 @@ Rectangle {
onDisconnected: {
buttonContainer.opacity = 0.3
buttonContainer.enabled = false
buttonContainer.state = "closed"
}
}

@@ -94,7 +95,7 @@ Rectangle {
Transition {
to: "open"
ParallelAnimation {
PropertyAnimation { target: buttonContainer; properties: "width, height"; easing.type: Easing.OutBack; easing.overshoot: 0.8; duration: 300 }
PropertyAnimation { target: buttonContainer; properties: "width, height"; easing.type: Easing.OutBack; easing.overshoot: 1.2; duration: 300 }
PropertyAnimation { target: buttonContainer; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
ParentAnimation {
NumberAnimation { properties: "x,y"; easing.type: Easing.OutBack; easing.overshoot: 0.8; duration: 300 }
@@ -126,7 +127,8 @@ Rectangle {
onClicked: {
haptic.playEffect("click");
originParent = buttonContainer.parent
buttonContainer.state = "open"
// buttonContainer.state = "open"
cardLoader.active = true;
}
}

@@ -350,10 +352,16 @@ Rectangle {
width: buttonContainer.width
height: buttonContainer.height
asynchronous: true
active: buttonContainer.state == "open"
active: false //buttonContainer.state == "open"
source: "qrc:/components/remote/ui/Card.qml"
opacity: cardLoader.status == Loader.Ready ? 1 : 0

onStatusChanged: {
if (cardLoader.status == Loader.Ready) {
buttonContainer.state = "open";
}
}

Behavior on opacity {
NumberAnimation {
duration: 300
@@ -376,12 +384,15 @@ Rectangle {
switch (button) {
case "top right":
buttonContainer.state = "closed"
cardLoader.active = false;
break;
}
}
}
}

property alias closeButtonMouseArea: closeButtonMouseArea

Text {
id: closeButton
color: colorText
@@ -399,13 +410,15 @@ Rectangle {
anchors.topMargin: 20

MouseArea {
id: closeButtonMouseArea
width: parent.width + 20
height: parent.height + 20
anchors.centerIn: parent

onClicked: {
haptic.playEffect("click");
buttonContainer.state = "closed"
cardLoader.active = false;
}
}
}
@@ -24,6 +24,7 @@ Rectangle {
onDisconnected: {
blindButton.opacity = 0.3
blindButton.enabled = false
blindButton.state = "closed"
}
}

@@ -132,7 +133,7 @@ Rectangle {
Transition {
to: "open"
ParallelAnimation {
PropertyAnimation { target: blindButton; properties: "width, height"; easing.type: Easing.OutBack; easing.overshoot: 0.8; duration: 300 }
PropertyAnimation { target: blindButton; properties: "width, height"; easing.type: Easing.OutBack; easing.overshoot: 1.2; duration: 300 }
PropertyAnimation { target: button; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
ParentAnimation {
NumberAnimation { properties: "x, y, scale"; easing.type: Easing.OutBack; easing.overshoot: 0.8; duration: 300 }
@@ -166,7 +167,7 @@ Rectangle {

originParent = blindButton.parent

loader_main.state = "hidden"
// loader_main.state = "hidden"
blindButton.state = "open"
}
}
@@ -383,7 +384,7 @@ Rectangle {
asynchronous: true
active: blindButton.state == "open"
source: "qrc:/components/blind/ui/Card.qml"
// opacity: cardLoader.status == Loader.Ready ? 1 : 0
opacity: cardLoader.status == Loader.Ready ? 1 : 0

Behavior on opacity {
NumberAnimation {
@@ -24,6 +24,7 @@ Rectangle {
onDisconnected: {
lightButton.opacity = 0.3
lightButton.enabled = false
lightButton.state = "closed"
}
}

@@ -134,7 +135,7 @@ Rectangle {
Transition {
to: "open"
ParallelAnimation {
PropertyAnimation { target: lightButton; properties: "width, height"; easing.type: Easing.OutBack; easing.overshoot: 0.8; duration: 300 }
PropertyAnimation { target: lightButton; properties: "width, height"; easing.type: Easing.OutBack; easing.overshoot: 1.2; duration: 300 }
PropertyAnimation { target: button; properties: "opacity"; easing.type: Easing.OutExpo; duration: 300 }
ParentAnimation {
NumberAnimation { properties: "x, y, scale"; easing.type: Easing.OutBack; easing.overshoot: 0.8; duration: 300 }
@@ -390,7 +391,7 @@ Rectangle {
asynchronous: true
active: lightButton.state == "open"
source: getSource() //lightButton.state != "open" ? "" : (obj.supported_features.indexOf("obj.brightness") > -1 ? "qrc:/components/light/CardDimmable.qml" : "qrc:/components/light/CardSwitch.qml")
// opacity: cardLoader.status == Loader.Ready ? 1 : 0
opacity: cardLoader.status == Loader.Ready ? 1 : 0

Behavior on opacity {
NumberAnimation {
@@ -9,13 +9,13 @@ import "qrc:/basic_ui" as BasicUI
import MediaPlayerUtils 1.0

Comp.ButtonBase {
id: remoteButton
id: mediaplayerButton
icon: "\uE903"
cardLoader.source: "qrc:/components/media_player/ui/Card.qml"

// override default settings
title.anchors.verticalCenterOffset: obj.source === "" ? 0 : -15
button.enabled: true
button.enabled: obj.supported_features.indexOf("TURN_ON") > -1 ? true : false

// include mediaplayer utils
MediaPlayerUtils {
@@ -39,7 +39,11 @@ Comp.ButtonBase {
font.weight: Font.Normal
font.pixelSize: 20
lineHeight: 1
visible: remoteButton.state == "closed" ? true : false
visible: mediaplayerButton.state == "closed" ? true : false
}

closeButtonMouseArea.onClicked: {
inputPanel.active = false
}

// album art
@@ -50,13 +54,13 @@ Comp.ButtonBase {

BasicUI.CustomImageLoader {
id: image
visible: remoteButton.state == "closed" ? true : false
visible: mediaplayerButton.state == "closed" ? true : false
width: 80
height: 80
anchors.left: parent.left
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
url: mediaplayerUtils.smallImage == "" ? "qrc:/images/mini-music-player/no_image.png" : mediaplayerUtils.smallImage
url: mediaplayerUtils.smallImage == "" ? "" : mediaplayerUtils.smallImage

layer.enabled: true
layer.effect: OpacityMask {
@@ -70,15 +74,4 @@ Comp.ButtonBase {
}
}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CONNECT TO BUTTONS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Connections {
target: buttonHandler
enabled: state == "open" ? true : false

onButtonPress: {
}
}
}

0 comments on commit 1dd1120

Please sign in to comment.
You can’t perform that action at this time.