-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more stuff working ..more stuff working ....
Signed-off-by: Conrad Hübler <Conrad.Huebler@gmx.net>
- Loading branch information
1 parent
e066880
commit 5c0c47a
Showing
9 changed files
with
148 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,100 @@ | ||
// AlbumPage.qml | ||
import QtQuick 2.0 | ||
import Sailfish.Silica 1.0 | ||
import QtMultimedia 5.6 | ||
import Sailfish.Media 1.0 | ||
|
||
import "widgets" | ||
|
||
|
||
Page { | ||
property int track_id | ||
|
||
id: albumPage | ||
property int albumId: -1 | ||
property var albumData: null | ||
|
||
// The effective value will be restricted by ApplicationWindow.allowedOrientations | ||
allowedOrientations: Orientation.All | ||
|
||
// To enable PullDownMenu, place our content in a SilicaFlickable | ||
SilicaFlickable { | ||
width: parent.width | ||
id: flickable | ||
anchors { | ||
fill: parent | ||
bottomMargin: minPlayerPanel.margin | ||
} | ||
|
||
contentHeight: column.height | ||
|
||
PullDownMenu { | ||
MenuItem { | ||
text: qsTr("Show Playlist") | ||
onClicked: | ||
{ | ||
onClicked: pageStack.push(Qt.resolvedUrl("PlaylistPage.qml")) | ||
} | ||
} | ||
|
||
MenuItem { | ||
text: minPlayerPanel.open ? "Hide player" : "Show player" | ||
onClicked: minPlayerPanel.open = !minPlayerPanel.open | ||
anchors.horizontalCenter: parent.horizontalCenter | ||
} | ||
} | ||
|
||
|
||
Column { | ||
id: infoCoulumn | ||
id: column | ||
width: parent.width | ||
spacing: Theme.paddingMedium | ||
|
||
PageHeader { | ||
id: header | ||
title: qsTr("Album Info") | ||
title: albumData ? albumData.title : qsTr("Album Info") | ||
} | ||
spacing: 10 // Abstand zwischen den Elementen in der Column | ||
width: parent.width // Die Column nimmt die volle Breite des Eltern-Elements (Item) ein | ||
|
||
Image { | ||
id: coverImage | ||
anchors { | ||
top: header.bottom | ||
horizontalCenter: albumPage.isPortrait ? parent.horizontalCenter : undefined | ||
} | ||
width: parent.width * 0.8 | ||
height: width | ||
anchors.horizontalCenter: parent.horizontalCenter | ||
fillMode: Image.PreserveAspectFit | ||
source: albumData ? albumData.image : "" | ||
|
||
sourceSize.width: { | ||
var maxImageWidth = Screen.width | ||
var leftMargin = Theme.horizontalPageMargin | ||
var rightMargin = albumPage.isPortrait ? Theme.horizontalPageMargin : 0 | ||
return (maxImageWidth - leftMargin - rightMargin)*3/2 | ||
Rectangle { | ||
color: Theme.rgba(Theme.highlightBackgroundColor, 0.1) | ||
anchors.fill: parent | ||
visible: coverImage.status !== Image.Ready | ||
} | ||
|
||
fillMode: Image.PreserveAspectFit | ||
} | ||
Label | ||
{ | ||
|
||
Label { | ||
id: artistName | ||
anchors { | ||
top : coverImage.bottom | ||
} | ||
width: parent.width | ||
horizontalAlignment: Text.AlignHCenter | ||
text: albumData ? albumData.artist : "" | ||
truncationMode: TruncationMode.Fade | ||
color: Theme.highlightColor | ||
font.pixelSize: Theme.fontSizeLarge | ||
} | ||
} | ||
TrackList { | ||
id: aLtrackList | ||
type: 2 | ||
anchors { | ||
top: infoCoulumn.bottom// Anker oben an den unteren Rand der Column | ||
topMargin: 600 // Abstand zwischen der Column und dem ListView | ||
left: parent.left // Anker links am linken Rand des Eltern-Elements (Page) | ||
right: parent.right // Anker rechts am rechten Rand des Eltern-Elements (Page) | ||
leftMargin: Theme.horizontalPageMargin | ||
rightMargin: Theme.horizontalPageMargin | ||
bottom: parent.bottom// Anker unten am unteren Rand des Eltern-Elements (Page) | ||
} | ||
} | ||
|
||
|
||
Connections { | ||
target: tidalApi | ||
Label { | ||
width: parent.width | ||
horizontalAlignment: Text.AlignHCenter | ||
text: albumData ? Format.formatDuration(albumData.duration, Format.DurationLong) : "" | ||
color: Theme.secondaryHighlightColor | ||
font.pixelSize: Theme.fontSizeMedium | ||
} | ||
|
||
onAlbumChanged: | ||
{ | ||
// artistName.text =artist | ||
header.title = title + " - " + artist | ||
coverImage.source = image | ||
Item { | ||
width: parent.width | ||
height: Theme.paddingLarge | ||
} | ||
|
||
onTrackAdded: | ||
{ | ||
aLtrackList.type = 2 | ||
aLtrackList.addTrack(title, artist, album, id, duration) | ||
TrackList { | ||
id: trackList | ||
width: parent.width | ||
height: albumPage.height - y - (minPlayerPanel.open ? minPlayerPanel.height : 0) | ||
type: "album" | ||
albumId: albumPage.albumId | ||
} | ||
} | ||
|
||
VerticalScrollDecorator {} | ||
} | ||
|
||
onTrackChanged: | ||
{ | ||
for(var i = 1; i < aLtrackList.listModel.count; ++i) | ||
if(aLtrackList.listModel.get(i).name === title) | ||
{ | ||
aLtrackList.scrollTo(i); | ||
} | ||
Component.onCompleted: { | ||
if (albumId > 0) { | ||
albumData = cacheManager.getAlbum(albumId) | ||
if (!albumData) { | ||
console.log("Album nicht im Cache gefunden:", albumId) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.