Skip to content
Permalink
Browse files

Update on media player

  • Loading branch information
martonborzak committed Nov 23, 2019
1 parent d867d3d commit a1e34618c43c7a588c8f39c60773df0a26baf562
@@ -7,7 +7,7 @@ Rectangle {
id: card
width: parent.width
height: parent.height
color: mediaplayerUtils.pixelColor === "#000000" ? colorDark : mediaplayerUtils.pixelColor
color: mediaplayerUtils.pixelColor == "#000000" ? colorDark : mediaplayerUtils.pixelColor

Behavior on color {
ColorAnimation { duration: 300 }
@@ -188,10 +188,7 @@ Rectangle {

Component {
id: cardSearch
Rectangle {
anchors.fill: parent
color: "red"
}
CardSearch {}
}

Component {
@@ -257,6 +254,7 @@ Rectangle {
height: width

onClicked: {
haptic.playEffect("click");
cardSwipeView.currentIndex = 0;
}
}
@@ -281,6 +279,7 @@ Rectangle {
height: width

onClicked: {
haptic.playEffect("click");
cardSwipeView.currentIndex = features.indexOf("SEARCH");
}
}
@@ -305,6 +304,7 @@ Rectangle {
height: width

onClicked: {
haptic.playEffect("click");
cardSwipeView.currentIndex = features.indexOf("LIST");
}
}
@@ -329,6 +329,7 @@ Rectangle {
height: width

onClicked: {
haptic.playEffect("click");
cardSwipeView.currentIndex = features.indexOf("SPEAKER_CONTROL");
}
}
@@ -0,0 +1,58 @@
import QtQuick 2.0
import QtQuick.Controls 2.5

import "qrc:/basic_ui" as BasicUI

Item {
width: parent.width
height: parent.height

Rectangle {
width: parent.width - 60
height: 80
anchors.top: parent.top
anchors.topMargin: 100
anchors.horizontalCenter: parent.horizontalCenter
color: colorText
radius: cornerRadius

Text {
id: searchIcon
color: colorBackground
text: "\uE90C"
renderType: Text.NativeRendering
width: 70
height: 70
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font {family: "icons"; pixelSize: 80 }
anchors.left: parent.left
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
}

TextField {
id: searchTextField
cursorVisible: false
width: parent.width-90
height: parent.height
anchors.left: searchIcon.right
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
placeholderText: qsTr("Search") + translateHandler.emptyString
color: colorBackground
font.family: "Open Sans"
font.weight: Font.Normal
font.pixelSize: 27

background: Rectangle {
color: colorBackgroundTransparent
border.width: 0
}

onAccepted: {
obj.search(searchTextField.text)
}
}
}
}
@@ -212,5 +212,6 @@
<file>basic_ui/CustomImageLoader.qml</file>
<file>components/media_player/ui/Card.qml</file>
<file>components/media_player/ui/CardHome.qml</file>
<file>components/media_player/ui/CardSearch.qml</file>
</qresource>
</RCC>
@@ -158,9 +158,9 @@ void MediaPlayer::playMedia(const QString& cmd, const QString& itemKey)
{
command("play:" + cmd, itemKey);
}
void MediaPlayer::search(const QString& searchString, const QString& itemKey)
void MediaPlayer::search(const QString& searchString)
{
command("search:" + searchString, itemKey);
command("SEARCH", searchString);
}

MediaPlayer::MediaPlayer(const QVariantMap& config, QObject* integrationObj, QObject *parent):
@@ -69,7 +69,7 @@ class MediaPlayer : public Entity, MediaPlayerInterface
// extension for "generic" media browsing
Q_INVOKABLE void browse (QString command); // Command item_key, "TOP", "BACK", "PLAY"
Q_INVOKABLE void playMedia (const QString& command, const QString& itemKey); // command PLAY, QUEUE
Q_INVOKABLE void search (const QString& searchText, const QString& itemKey); // Search
Q_INVOKABLE void search (const QString& searchText);

// only for C++ integrations
virtual void* getSpecificInterface () override;

0 comments on commit a1e3461

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