Commit b54934ec authored by camilo higuita's avatar camilo higuita

some mroe fixes and add animation to indicate a song ahs been added to the playlist

parent 91b05269
# includes openssl libs onto android build
android {
ANDROID_EXTRA_LIBS += $$PWD/3rdparty/openssl/lib/libcrypto.so
ANDROID_EXTRA_LIBS += $$PWD/3rdparty/openssl/lib/libssl.so
}
......@@ -320,7 +320,32 @@ Maui.ApplicationWindow
}
Kirigami.Theme.highlightColor: babeColor
// text: qsTr("Now")
Connections
{
target: mainPlaylist.table
onCountChanged: anim.start()
}
NumberAnimation on x
{
property int count : 0
id: anim
to: 10
duration: 100
onStopped:
{
if(anim.to===10) { anim.from=10; anim.to=0; } else { anim.from=0; anim.to=10 }
count++;
if(count < 5)
start()
else
{
anim.to = 0
count = 0
}
}
}
}
middleContent: [
......@@ -1026,7 +1051,7 @@ Maui.ApplicationWindow
{
target: vvave
// onRefreshTables: H.refreshCollection(size)
onRefreshTables: H.refreshCollection(size)
// onRefreshTracks: H.refreshTracks()
// onRefreshAlbums: H.refreshAlbums()
// onRefreshArtists: H.refreshArtists()
......
......@@ -10,10 +10,7 @@ import AlbumsList 1.0
Maui.Page
{
id: gridPage
// readonly property int screenSize : bae.screenGeometry("width")*bae.screenGeometry("height");
// property int hintSize : Math.sqrt(root.width*root.height)*0.3
property int albumCoverSize: Math.min(160, width * 0.4)
property int albumCoverSize: Math.min(160, width * 0.3)
property int albumCoverRadius : Maui.Style.radiusV
property bool albumCardVisible : true
......
......@@ -52,45 +52,44 @@ Maui.SwipeBrowserDelegate
label2.visible: coverArt ? !sameAlbum : true
label3.text: model.fav ? (model.fav == "1" ? "\uf2D1" : "") : ""
label3.font.family: "Material Design Icons"
label4.font.family: "Material Design Icons"
label4.text: model.rate ? H.setStars(model.rate) : ""
label3.font.family: "Material Design Icons"
label4.font.family: "Material Design Icons"
label4.text: model.rate ? H.setStars(model.rate) : ""
iconVisible: !sameAlbum && coverArt
imageSource: typeof model.artwork === 'undefined' ?
"qrc:/assets/cover.png" :
remoteArtwork ? model.artwork :
((model.artwork && model.artwork.length > 0 && model.artwork !== "NONE")? "file://"+encodeURIComponent(model.artwork) : "qrc:/assets/cover.png")
iconVisible: !sameAlbum && coverArt
imageSource: typeof model.artwork === 'undefined' ?
"qrc:/assets/cover.png" :
remoteArtwork ? model.artwork :
((model.artwork && model.artwork.length > 0 && model.artwork !== "NONE")? "file://"+encodeURIComponent(model.artwork) : "qrc:/assets/cover.png")
signal play()
signal leftClicked()
signal play()
signal leftClicked()
signal artworkCoverClicked()
signal artworkCoverDoubleClicked()
signal artworkCoverClicked()
signal artworkCoverDoubleClicked()
Kirigami.Theme.backgroundColor: trackMood.length > 0 ? Qt.tint(bgColor, Qt.rgba(Qt.lighter(trackMood, 1.3).r, Qt.lighter(trackMood, 1.3).g, Qt.lighter(trackMood, 1.3).b, 0.3)): bgColor
Kirigami.Theme.backgroundColor: trackMood.length > 0 ? Qt.tint(bgColor, Qt.rgba(Qt.lighter(trackMood, 1.3).r, Qt.lighter(trackMood, 1.3).g, Qt.lighter(trackMood, 1.3).b, 0.3)): bgColor
quickActions: [
Action
{
icon.name: "love"
onTriggered: list.fav(index, !(list.get(index).fav == "1"))
checked: model.fav === "1"
},
Action
{
icon.name: "view-media-recent"
onTriggered: queueTrack(index)
},
Action
{
icon.name: "love"
icon.color: model.fav === "1" ? babeColor : Kirigami.Theme.textColor
onTriggered: list.fav(index, !(list.get(index).fav == "1"))
},
Action
{
icon.name: "view-media-recent"
onTriggered: queueTrack(index)
},
Action
{
icon.name: "media-playback-start"
onTriggered: play()
}
Action
{
icon.name: "media-playback-start"
onTriggered: play()
}
]
......
......@@ -47,13 +47,14 @@ vvave::~vvave() {}
void vvave::checkCollection(const QStringList &paths, std::function<void(uint)> cb)
{
QFutureWatcher<uint> *watcher = new QFutureWatcher<uint>;
connect(watcher, &QFutureWatcher<uint>::finished, [=]()
connect(watcher, &QFutureWatcher<uint>::finished, [cb, watcher]()
{
const uint newTracks = watcher->future().result();
qDebug()<< "FINISHED SCANING CXOLLECTION";
if(cb)
cb(newTracks);
watcher->deleteLater();
});
const auto func = [=]() -> uint
{
auto newPaths = paths;
......@@ -69,6 +70,11 @@ void vvave::checkCollection(const QStringList &paths, std::function<void(uint)>
watcher->setFuture(t1);
}
void vvave::emitSignal()
{
emit this->refreshTables(10);
}
//// PUBLIC SLOTS
QVariantList vvave::sourceFolders()
{
......
......@@ -13,6 +13,7 @@ private:
CollectionDB *db;
void checkCollection(const QStringList &paths = BAE::defaultSources, std::function<void (uint)> cb = nullptr);
void emitSignal();
public:
explicit vvave(QObject *parent = nullptr);
~vvave();
......
......@@ -45,11 +45,11 @@ Maui.Page
footBar.width: parent.width
footBar.middleContent: AlbumsRoll
{
// height: Maui.Style.toolBarHeight * 1.3
// height: Maui.Style.toolBarHeight * 1.3
Layout.fillWidth: true
Layout.fillHeight: true
// width: footBar.width
// height: footBar.height
// width: footBar.width
// height: footBar.height
id: albumsRoll
}
......@@ -97,64 +97,53 @@ Maui.Page
}
}
ColumnLayout
BabeTable
{
id: playlistLayout
id: table
anchors.fill: parent
width: parent.width
spacing: 0
// anchors.bottom: mainPlaylistRoot.searchBox
BabeTable
focus: true
headBar.visible: false
footBar.visible: false
quickPlayVisible: false
coverArtVisible: true
trackRating: true
showIndicator : true
menuItemVisible: false
holder.emoji: "qrc:/assets/Radio.png"
holder.isMask: false
holder.title : "Meh!"
holder.body: "Start putting together your playlist!"
holder.emojiSize: Maui.Style.iconSizes.huge
onRowClicked: play(index)
onArtworkDoubleClicked: contextMenu.babeIt(index)
Component.onCompleted:
{
id: table
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignBottom | Qt.AlignTop
focus: true
headBar.visible: false
footBar.visible: false
quickPlayVisible: false
coverArtVisible: true
trackRating: true
showIndicator : true
menuItemVisible: false
holder.emoji: "qrc:/assets/Radio.png"
holder.isMask: false
holder.title : "Meh!"
holder.body: "Start putting together your playlist!"
holder.emojiSize: Maui.Style.iconSizes.huge
onRowClicked: play(index)
onArtworkDoubleClicked: contextMenu.babeIt(index)
Component.onCompleted:
{
var lastplaylist = Maui.FM.loadSettings("LASTPLAYLIST", "PLAYLIST", [])
var n = lastplaylist.length
var lastplaylist = Maui.FM.loadSettings("LASTPLAYLIST", "PLAYLIST", [])
var n = lastplaylist.length
if(n>0)
{
for(var i = 0; i < n; i++)
{
var where = "url = \""+lastplaylist[i]+"\""
var query = Q.GET.tracksWhere_.arg(where)
table.list.appendQuery(query);
}
}else
if(n>0)
{
for(var i = 0; i < n; i++)
{
where = "fav = 1"
query = Q.GET.tracksWhere_.arg(where)
var where = "url = \""+lastplaylist[i]+"\""
var query = Q.GET.tracksWhere_.arg(where)
table.list.appendQuery(query);
}
// if(autoplay)
// Player.playAt(0)
}else
{
where = "fav = 1"
query = Q.GET.tracksWhere_.arg(where)
table.list.appendQuery(query);
}
}
// if(autoplay)
// Player.playAt(0)
}
}
// function goFocusMode()
// {
......
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