Commit 471ebaed authored by camilo higuita's avatar camilo higuita

update ot latets mauikit

parent f38612b2
......@@ -409,107 +409,107 @@ Maui.ApplicationWindow
}
}
Maui.Page
footBar.rightContent: ToolButton
{
id: _mainPage
anchors.fill: parent
headBar.position: ToolBar.Footer
footBar.visible: isPlaying
headBar.rightContent: ToolButton
icon.name: _volumeSlider.value == 0 ? "media-silence" : "media-speaker"
onClicked:
{
icon.name: _volumeSlider.value == 0 ? "media-silence" : "media-speaker"
onClicked:
{
_sliderPopup.visible ? _sliderPopup.close() : _sliderPopup.open()
}
_sliderPopup.visible ? _sliderPopup.close() : _sliderPopup.open()
}
Popup
Popup
{
id: _sliderPopup
height: 150
width: parent.width
y: -150
x: 0
// closePolicy: Popup.CloseOnEscape | Popup.CloseOnPress
Slider
{
id: _sliderPopup
height: 150
width: parent.width
y: -150
x: 0
// closePolicy: Popup.CloseOnEscape | Popup.CloseOnPress
Slider
id: _volumeSlider
visible: true
height: parent.height
width: 20
anchors.horizontalCenter: parent.horizontalCenter
from: 0
to: 100
value: player.volume
orientation: Qt.Vertical
onMoved:
{
id: _volumeSlider
visible: true
height: parent.height
width: 20
anchors.horizontalCenter: parent.horizontalCenter
from: 0
to: 100
value: player.volume
orientation: Qt.Vertical
onMoved:
{
player.volume = value
}
player.volume = value
}
}
}
headBar.middleContent: [
ToolButton
{
id: babeBtnIcon
icon.name: "love"
enabled: currentTrackIndex >= 0
icon.color: currentTrack.fav == "0" ? Kirigami.Theme.textColor : babeColor
onClicked: if (!mainlistEmpty)
{
mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.listModel.get(currentTrackIndex).fav == "1"))
currentTrack = mainPlaylist.listModel.get(currentTrackIndex)
}
},
}
ToolButton
{
icon.name: "media-skip-backward"
icon.color: Kirigami.Theme.textColor
onClicked: Player.previousTrack()
onPressAndHold: Player.playAt(prevTrackIndex)
},
footBar.middleContent: [
ToolButton
{
id: babeBtnIcon
icon.name: "love"
enabled: currentTrackIndex >= 0
icon.color: currentTrack.fav == "0" ? Kirigami.Theme.textColor : babeColor
onClicked: if (!mainlistEmpty)
{
mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.listModel.get(currentTrackIndex).fav == "1"))
currentTrack = mainPlaylist.listModel.get(currentTrackIndex)
}
},
ToolButton
{
id: playIcon
enabled: currentTrackIndex >= 0
icon.color: Kirigami.Theme.textColor
icon.name: isPlaying ? "media-playback-pause" : "media-playback-start"
onClicked: player.playing = !player.playing
},
ToolButton
{
icon.name: "media-skip-backward"
icon.color: Kirigami.Theme.textColor
onClicked: Player.previousTrack()
onPressAndHold: Player.playAt(prevTrackIndex)
},
ToolButton
{
id: nextBtn
icon.color: Kirigami.Theme.textColor
icon.name: "media-skip-forward"
onClicked: Player.nextTrack()
onPressAndHold: Player.playAt(Player.shuffle())
},
ToolButton
{
id: playIcon
enabled: currentTrackIndex >= 0
icon.color: Kirigami.Theme.textColor
icon.name: isPlaying ? "media-playback-pause" : "media-playback-start"
onClicked: player.playing = !player.playing
},
ToolButton
{
id: nextBtn
icon.color: Kirigami.Theme.textColor
icon.name: "media-skip-forward"
onClicked: Player.nextTrack()
onPressAndHold: Player.playAt(Player.shuffle())
},
ToolButton
ToolButton
{
id: shuffleBtn
icon.color: babeColor
icon.name: isShuffle ? "media-playlist-shuffle" : "media-playlist-normal"
onClicked:
{
id: shuffleBtn
icon.color: babeColor
icon.name: isShuffle ? "media-playlist-shuffle" : "media-playlist-normal"
onClicked:
{
isShuffle = !isShuffle
Maui.FM.saveSettings("SHUFFLE", isShuffle, "PLAYBACK")
}
isShuffle = !isShuffle
Maui.FM.saveSettings("SHUFFLE", isShuffle, "PLAYBACK")
}
]
}
]
Maui.Page
{
id: _mainPage
anchors.fill: parent
footBar.visible: isPlaying
footBar.leftContent: Label
{
id: _label1
visible: text.length
Layout.fillHeight: true
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter
text: progressTimeLabel
......@@ -525,9 +525,6 @@ Maui.ApplicationWindow
{
id: progressBar
Layout.fillWidth: true
Layout.margins: Maui.Style.space.small
padding: 0
from: 0
to: 1000
......@@ -539,8 +536,6 @@ Maui.ApplicationWindow
player.pos = value
}
// background: Rectangle
// {
// implicitWidth: progressBar.width
......@@ -573,7 +568,6 @@ Maui.ApplicationWindow
{
id: _label2
visible: text.length
Layout.fillHeight: true
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter
text: player.transformTime(player.duration/1000)
......
......@@ -123,8 +123,8 @@ void AlbumsModel::setList()
this->sortList();
emit this->postListChanged();
//if(this->query == AlbumsModel::QUERY::ALBUMS)
//this->fetchInformation();
if(this->query == AlbumsModel::QUERY::ALBUMS)
this->fetchInformation();
}
void AlbumsModel::fetchInformation()
......@@ -173,11 +173,7 @@ void AlbumsModel::fetchInformation()
FMH::MODEL newTrack = request.track;
newTrack[FMH::MODEL_KEY::ARTWORK] = QUrl::fromLocalFile(path).toString();
this->db->insertArtwork(newTrack);
// this->updateArtwork(index, path);
album[FMH::MODEL_KEY::ARTWORK] = newTrack[FMH::MODEL_KEY::ARTWORK];
emit this->updateModel(index, {FMH::MODEL_KEY::ARTWORK});
this->updateArtwork(index, QUrl::fromLocalFile(path).toString());
_downloader->deleteLater();
});
......@@ -186,7 +182,7 @@ void AlbumsModel::fetchInformation()
QString name = !request.track[FMH::MODEL_KEY::ALBUM].isEmpty() ? request.track[FMH::MODEL_KEY::ARTIST] + "_" + request.track[FMH::MODEL_KEY::ALBUM] : request.track[FMH::MODEL_KEY::ARTIST];
name.replace("/", "-");
name.replace("&", "-");
downloader->setFile(res.value.toString(), BAE::CachePath + name + format);
downloader->downloadFile(res.value.toString(), BAE::CachePath + name + format);
qDebug()<<"SAVING ARTWORK FOR: " << request.track[FMH::MODEL_KEY::ALBUM]<< BAE::CachePath + name + format;
}
......@@ -199,15 +195,15 @@ void AlbumsModel::fetchInformation()
Pulpo pulpo;
QEventLoop loop;
QObject::connect(&pulpo, &Pulpo::finished, &loop, &QEventLoop::quit);
QObject::connect(this, &AlbumsModel::destroyed, [&pulpo, &loop, &stop]()
{
qDebug()<< stop << &stop;
pulpo.disconnect();
stop = true;
if(loop.isRunning())
loop.quit();
qDebug()<< stop << &stop;
});
// QObject::connect(this, &AlbumsModel::destroyed, [&pulpo, &loop, &stop]()
// {
// qDebug()<< stop << &stop;
// pulpo.disconnect();
// stop = true;
// if(loop.isRunning())
// loop.quit();
// qDebug()<< stop << &stop;
// });
for(const auto &req : requests)
{
......@@ -236,6 +232,7 @@ void AlbumsModel::updateArtwork(const int index, const QString &artwork)
return;
this->list[index][FMH::MODEL_KEY::ARTWORK] = artwork;
qDebug()<< "TRYIGN To UDPATE ARTWOIRK ALBUM" << index << artwork;
emit this->updateModel(index, {FMH::MODEL_KEY::ARTWORK});
}
......
......@@ -41,7 +41,7 @@ Maui.Page
id: webViewer
clip: true
anchors.fill: parent
source: isAndroid ? "qrc:/services/web/WebView_A.qml" : "qrc:/services/web/WebView.qml"
source: "qrc:/services/web/WebView_A.qml"
onVisibleChanged: if(!visible) webView.url = "about:blank"
}
......
......@@ -124,7 +124,7 @@ inline static QUEUE artistArtworks()
QString name = !request.track[FMH::MODEL_KEY::ALBUM].isEmpty() ? request.track[FMH::MODEL_KEY::ARTIST] + "_" + request.track[FMH::MODEL_KEY::ALBUM] : request.track[FMH::MODEL_KEY::ARTIST];
name.replace("/", "-");
name.replace("&", "-");
downloader->setFile(res.value.toString(), BAE::CachePath + name + format);
// downloader->downloadFile(res.value.toString(), BAE::CachePath + name + format);
}
}
};
......@@ -179,7 +179,6 @@ inline static QUEUE albumArtworks()
db->insertArtwork(newTrack);
downloader->deleteLater();
});
QStringList filePathList = res.value.toString().split('/');
......@@ -187,7 +186,7 @@ inline static QUEUE albumArtworks()
QString name = !request.track[FMH::MODEL_KEY::ALBUM].isEmpty() ? request.track[FMH::MODEL_KEY::ARTIST] + "_" + request.track[FMH::MODEL_KEY::ALBUM] : request.track[FMH::MODEL_KEY::ARTIST];
name.replace("/", "-");
name.replace("&", "-");
downloader->setFile(res.value.toString(), BAE::CachePath + name + format);
// downloader->downloadFile(res.value.toString(), BAE::CachePath + name + format);
}
}
};
......
......@@ -15,7 +15,6 @@ TEMPLATE = app
CONFIG += ordered
CONFIG += c++17
CONFIG += static
linux:unix:!android {
message(Building for Linux KDE)
......@@ -23,13 +22,23 @@ linux:unix:!android {
LIBS += -lMauiKit
} else:android|win32 {
message(Building helpers for Android)
message(Building helpers for Android or Windows)
android {
QMAKE_LINK += -nostdlib++
QT *= androidextras webview
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android_files
include($$PWD/3rdparty/taglib.pri)
TAGLIB_REPO = https://github.com/mauikit/taglib
exists($$PWD/3rdparty/taglib/taglib.pri) {
message("Using TagLib binaries for Android")
}else {
message("Getting Luv icon theme")
system(git clone $$TAGLIB_REPO $$PWD/3rdparty/taglib)
}
include($$PWD/3rdparty/taglib/taglib.pri)
}else:win32 {
LIBS += -L$$PWD/'../../../../Program Files (x86)/taglib/lib/' -ltag
......@@ -47,7 +56,8 @@ DEPENDPATH += $$PWD/'../../../../Program Files (x86)/taglib/include'
# COMPONENT_TERMINAL \
COMPONENT_TAGGING \
# COMPONENT_SYNCING \
MAUIKIT_STYLE
MAUIKIT_STYLE \
ANDROID_OPENSSL
include($$PWD/3rdparty/kirigami/kirigami.pri)
include($$PWD/3rdparty/mauikit/mauikit.pri)
......
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