Commit cdff62ab authored by Camilo Higuita's avatar Camilo Higuita

append entire albums and check for valid artworks

parent e42238e7
......@@ -164,9 +164,14 @@ Kirigami.ApplicationWindow
onClicked:
{
if(player.isPaused())
{
Player.resumeTrack()
else Player.pauseTrack()
playIcon.text= MdiFont.Icon.pause
}else
{
Player.pauseTrack()
playIcon.text= MdiFont.Icon.play
}
}
}
......@@ -239,6 +244,12 @@ Kirigami.ApplicationWindow
for(var i in tracks)
appendTrack(tracks[i])
Player.playTrack(mainPlaylistTable.model.get(0))
playIcon.text= MdiFont.Icon.pause
}
onAppendAlbum:
{
for(var i in tracks)
appendTrack(tracks[i])
}
}
......@@ -252,6 +263,7 @@ Kirigami.ApplicationWindow
for(var i in tracks)
appendTrack(tracks[i])
Player.playTrack(mainPlaylistTable.model.get(0))
playIcon.text= MdiFont.Icon.pause
}
}
......
......@@ -5,15 +5,12 @@ function playTrack(track)
player.play()
root.title = currentTrack.title + " - " +currentTrack.artist
currentArtwork = con.getAlbumArt(currentTrack.album, currentTrack.artist) || con.getArtistArt(currentTrack.artist)
playIcon.text= MdiFont.Icon.pause
}
function pauseTrack()
{
player.pause()
playIcon.text= MdiFont.Icon.play
}
function resumeTrack()
......
......@@ -48,7 +48,7 @@ Item
fillMode: Image.PreserveAspectFit
source: (artwork && artwork !== "none")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
source: (artwork.length>0 && artwork !== "none")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
layer.enabled: true
layer.effect: OpacityMask
{
......
......@@ -32,14 +32,14 @@ Pane
focus: true
model: gridModel
highlight: Rectangle
{
id: highlight
width: albumSize
height: albumSize
color: "lightsteelblue"
radius: borderRadius
}
// highlight: Rectangle
// {
// id: highlight
// width: albumSize
// height: albumSize
// color: "lightsteelblue"
// radius: borderRadius
// }
// onWidthChanged:
// {
......
......@@ -15,6 +15,7 @@ BabeGrid
signal rowClicked(var track)
signal playAlbum(var tracks)
signal appendAlbum(var tracks)
Drawer
{
......@@ -41,10 +42,11 @@ BabeGrid
ToolButton
{
id: playAllBtn
width: parent.height
height: parent.height
id: playAllBtn
Icon {text: MdiFont.Icon.playBoxOutline}
onClicked:
......@@ -58,10 +60,30 @@ BabeGrid
}
}
ToolButton
{
id: appendBtn
width: parent.height
height: parent.height
Icon {text: MdiFont.Icon.playlistPlus}
onClicked:
{
var data = albumsView.gridModel.get(albumsView.grid.currentIndex)
var query = "select * from tracks where album = \""+data.album+"\" and artist = \""+data.artist+"\""
var tracks = con.get(query)
appendAlbum(tracks)
drawer.close()
}
}
Label
{
id: albumTitle
width: parent.width - closeBtn.width - playAllBtn.width
width: parent.width - closeBtn.width - playAllBtn.width - appendBtn.width
height: parent.height
elide: Text.ElideRight
font.pointSize: 12
......
......@@ -15,6 +15,7 @@ BabeGrid
signal rowClicked(var track)
signal playAlbum(var tracks)
signal appendAlbum(var tracks)
Drawer
{
......@@ -57,11 +58,29 @@ BabeGrid
drawer.close()
}
}
ToolButton
{
id: appendBtn
width: parent.height
height: parent.height
Icon {text: MdiFont.Icon.playlistPlus}
onClicked:
{
var data = albumsView.gridModel.get(albumsView.grid.currentIndex)
var query = "select * from tracks where album = \""+data.album+"\" and artist = \""+data.artist+"\""
var tracks = con.get(query)
appendAlbum(tracks)
drawer.close()
}
}
Label
{
id: artistTitle
width: parent.width - closeBtn.width - playAllBtn.width
width: parent.width - closeBtn.width - playAllBtn.width - appendBtn.width
height: parent.height
elide: Text.ElideRight
font.pointSize: 12
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment