Commit 57dd52ff authored by camilo higuita's avatar camilo higuita

style ux ui migration

parent dfbc997b
......@@ -35,22 +35,22 @@ add_executable(vvave
services/local/taginfo.cpp
services/local/player.cpp
services/local/youtubedl.cpp
services/local/linking.cpp
# services/local/linking.cpp
services/local/socket.cpp
services/web/babeit.cpp
# services/web/babeit.cpp
services/web/youtube.cpp
services/web/Spotify/spotify.cpp
# services/web/Spotify/spotify.cpp
db/collectionDB.cpp
# settings/BabeSettings.cpp
# settings/fileloader.cpp
# utils/brain.cpp
utils/babeconsole.cpp
# utils/babeconsole.cpp
models/tracks/tracksmodel.cpp
models/basemodel.cpp
models/baselist.cpp
models/playlists/playlistsmodel.cpp
models/albums/albumsmodel.cpp
models/cloud/cloud.cpp
# models/cloud/cloud.cpp
)
if (ANDROID)
......
......@@ -313,24 +313,24 @@ Layout.fillWidth: true
Layout.fillHeight: true
Layout.fillWidth: true
leftContent: Maui.ToolButton
leftContent: ToolButton
{
iconName: "headphones"
icon.name: "headphones"
visible: _drawer.modal
iconColor: _drawer.visible ? babeColor : textColor
icon.color: _drawer.visible ? babeColor : textColor
onClicked: _drawer.visible = !_drawer.visible
colorScheme.highlightColor: babeColor
Kirigami.Theme.highlightColor: babeColor
// text: qsTr("Now")
}
middleContent: [
Maui.ToolButton
ToolButton
{
id: babeBtnIcon
iconName: "love"
iconColor: currentBabe ? babeColor : textColor
icon.name: "love"
enabled: currentTrackIndex >= 0
icon.color: currentBabe ? babeColor : textColor
onClicked: if (!mainlistEmpty)
{
mainPlaylist.list.fav(currentTrackIndex, !(mainPlaylist.list.get(currentTrackIndex).fav == "1"))
......@@ -338,36 +338,37 @@ Layout.fillWidth: true
}
},
Maui.ToolButton
ToolButton
{
iconName: "media-skip-backward"
iconColor: textColor
icon.name: "media-skip-backward"
icon.color: textColor
onClicked: Player.previousTrack()
onPressAndHold: Player.playAt(prevTrackIndex)
},
Maui.ToolButton
ToolButton
{
id: playIcon
iconColor: textColor
iconName: isPlaying ? "media-playback-pause" : "media-playback-start"
enabled: currentTrackIndex >= 0
icon.color: textColor
icon.name: isPlaying ? "media-playback-pause" : "media-playback-start"
onClicked: player.playing = !player.playing
},
Maui.ToolButton
ToolButton
{
id: nextBtn
iconColor: textColor
iconName: "media-skip-forward"
icon.color: textColor
icon.name: "media-skip-forward"
onClicked: Player.nextTrack()
onPressAndHold: Player.playAt(Player.shuffle())
},
Maui.ToolButton
ToolButton
{
id: shuffleBtn
iconColor: babeColor
iconName: isShuffle ? "media-playlist-shuffle" : "media-playlist-normal"
icon.color: babeColor
icon.name: isShuffle ? "media-playlist-shuffle" : "media-playlist-normal"
onClicked:
{
isShuffle = !isShuffle
......
......@@ -3,9 +3,9 @@
#include "utils/brain.h"
#include <QtConcurrent>
AlbumsModel::AlbumsModel(QObject *parent) : BaseList(parent)
AlbumsModel::AlbumsModel(QObject *parent) : BaseList(parent),
db(CollectionDB::getInstance())
{
this->db = CollectionDB::getInstance();
connect(this, &AlbumsModel::queryChanged, this, &AlbumsModel::setList);
}
......
#include "playlistsmodel.h"
#include "db/collectionDB.h"
PlaylistsModel::PlaylistsModel(QObject *parent) : BaseList(parent)
PlaylistsModel::PlaylistsModel(QObject *parent) : BaseList(parent),
db(CollectionDB::getInstance())
{
this->db = CollectionDB::getInstance();
this->setList();
}
......
......@@ -2,9 +2,9 @@
#include "db/collectionDB.h"
TracksModel::TracksModel(QObject *parent) : BaseList(parent)
TracksModel::TracksModel(QObject *parent) : BaseList(parent),
db(CollectionDB::getInstance())
{
this->db = CollectionDB::getInstance();
connect(this, &TracksModel::queryChanged, this, &TracksModel::setList);
}
......
......@@ -2,23 +2,22 @@
#include "../../utils/bae.h"
Player::Player(QObject *parent) : QObject(parent)
Player::Player(QObject *parent) : QObject(parent),
player(new QMediaPlayer(this)),
updater(new QTimer(this))
{
this->player = new QMediaPlayer(this);
this->buffer = new QBuffer(this->player);
connect(this->player, &QMediaPlayer::durationChanged, this, [&](qint64 dur)
{
emit this->durationChanged(/*BAE::transformTime(dur/1000)*/);
});
// connect(this->player, &QMediaPlayer::durationChanged, this, [&](qint64 dur)
// {
// emit this->durationChanged(/*BAE::transformTime(dur/1000)*/);
// });
this->player->setVolume(this->volume);
this->updater = new QTimer(this);
connect(this->updater, &QTimer::timeout, this, &Player::update);
}
bool Player::play()
bool Player::play() const
{
if(this->url.isEmpty()) return false;
......@@ -30,7 +29,7 @@ bool Player::play()
return true;
}
void Player::pause()
void Player::pause() const
{
if(this->player->isAvailable())
this->player->pause();
......@@ -73,9 +72,9 @@ void Player::emitState()
QString Player::transformTime(const int &pos)
{
auto time = BAE::transformTime(pos);
return time;
return BAE::transformTime(pos);
}
void Player::appendBuffe(QByteArray &array)
{
qDebug()<<"APENDING TO BUFFER"<< array << this->array;
......@@ -105,7 +104,7 @@ void Player::setUrl(const QString &value)
this->pos = 0;
emit this->posChanged();
auto media = QMediaContent(QUrl::fromLocalFile(this->url));
const auto media = QMediaContent(QUrl::fromLocalFile(this->url));
this->player->setMedia(media);
this->emitState();
}
......@@ -166,7 +165,7 @@ bool Player::getFinished()
void Player::setPos(const int &value)
{
this->pos = value;
this->player->setPosition( this->player->duration() / 1000 * this->pos);
this->player->setPosition(this->player->duration() / 1000 * this->pos);
this->emitState();
this->posChanged();
}
......
......@@ -63,8 +63,8 @@ private:
bool playing = false;
bool finished = false;
bool play();
void pause();
bool play() const;
void pause() const;
void emitState();
......@@ -82,7 +82,7 @@ signals:
void posChanged();
public slots:
QString transformTime(const int &pos);
static QString transformTime(const int &pos);
void playRemote(const QString &url);
void stop();
......
......@@ -35,7 +35,7 @@ BabeList
property bool group : false
property alias contextMenu : contextMenu
property alias contextMenuItems : contextMenu.content
property alias contextMenuItems : contextMenu.contentData
property alias playAllBtn : playAllBtn
property alias appendBtn : appendBtn
......@@ -207,14 +207,14 @@ BabeList
MenuSeparator {}
Maui.MenuItem
MenuItem
{
text: qsTr("Go to Artist")
onTriggered: goToArtist()
}
Maui.MenuItem
MenuItem
{
text: qsTr("Go to Album")
onTriggered: goToAlbum()
......
......@@ -7,8 +7,9 @@ import ".."
import "../../utils/Help.js" as H
import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.6 as Kirigami
Maui.Menu
Menu
{
id: control
width: unit * 200
......@@ -32,9 +33,9 @@ Maui.Menu
signal infoClicked()
signal copyToClicked()
property alias menuItem : control.content
property alias menuItem : control.contentData
Maui.MenuItem
MenuItem
{
text: qsTr("Select...")
onTriggered:
......@@ -46,7 +47,7 @@ Maui.Menu
MenuSeparator {}
Maui.MenuItem
MenuItem
{
text: !fav ? qsTr("Fav it"): qsTr("UnFav it")
onTriggered:
......@@ -56,7 +57,7 @@ Maui.Menu
}
}
Maui.MenuItem
MenuItem
{
text: qsTr("Queue")
onTriggered:
......@@ -66,7 +67,7 @@ Maui.Menu
}
}
Maui.MenuItem
MenuItem
{
text: qsTr("Add to...")
onTriggered:
......@@ -78,7 +79,7 @@ Maui.Menu
MenuSeparator {}
Maui.MenuItem
MenuItem
{
text: qsTr("Share...")
onTriggered:
......@@ -89,7 +90,7 @@ Maui.Menu
}
Maui.MenuItem
MenuItem
{
visible: root.showAccounts
text: qsTr("Copy to cloud")
......@@ -100,7 +101,7 @@ Maui.Menu
}
}
Maui.MenuItem
MenuItem
{
text: isAndroid ? qsTr("Open with...") : qsTr("Show in folder...")
......@@ -113,7 +114,7 @@ Maui.Menu
MenuSeparator {}
Maui.MenuItem
MenuItem
{
visible: false
text: qsTr("Edit...")
......@@ -135,10 +136,10 @@ Maui.Menu
// }
Maui.MenuItem
MenuItem
{
text: qsTr("Remove")
colorScheme.textColor: dangerColor
Kirigami.Theme.textColor: dangerColor
onTriggered:
{
removeClicked()
......@@ -149,7 +150,7 @@ Maui.Menu
MenuSeparator {}
Maui.MenuItem
MenuItem
{
id: starsRow
width: parent.width
......@@ -237,7 +238,7 @@ Maui.Menu
}
Maui.MenuItem
MenuItem
{
id: colorsRow
width: parent.width
......
......@@ -25,9 +25,10 @@
* */
vvave::vvave(QObject *parent) : QObject(parent)
vvave::vvave(QObject *parent) : QObject(parent),
notify(new Notify(this)),
db(CollectionDB::getInstance())
{
this->db = CollectionDB::getInstance();
for(const auto &path : {BAE::CachePath, BAE::YoutubeCachePath})
{
QDir dirPath(path);
......@@ -39,7 +40,6 @@ vvave::vvave(QObject *parent) : QObject(parent)
if(!FMH::fileExists(BAE::NotifyDir+"/vvave.notifyrc"))
QFile::copy(":/assets/vvave.notifyrc", BAE::NotifyDir+"/vvave.notifyrc");
this->notify = new Notify(this);
connect(this->notify, &Notify::babeSong, [this]()
{
// emit this->babeIt();
......
......@@ -2,32 +2,32 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import org.kde.mauikit 1.0 as Maui
Maui.Menu
Menu
{
signal clearOut()
signal clean()
signal callibrate()
signal hideCover()
signal saveToClicked()
Maui.MenuItem
MenuItem
{
text: qsTr("Clear out...")
onTriggered: clearOut()
}
Maui.MenuItem
MenuItem
{
text: qsTr("Clean...")
onTriggered: clean()
}
Maui.MenuItem
MenuItem
{
text: qsTr("Save list to...")
onTriggered: saveToClicked()
}
Maui.MenuItem
MenuItem
{
enabled: syncPlaylist.length > 0
text: syncPlaylist.length > 0 && sync ? qsTr("Pause syncing") : qsTr("Continue syncing")
......
......@@ -110,7 +110,7 @@ ColumnLayout
holder.emojiSize: iconSizes.huge
contextMenuItems:
Maui.MenuItem
MenuItem
{
text: qsTr("Remove from playlist")
}
......
......@@ -8,10 +8,10 @@ import "../utils/Help.js" as H
import "../utils/Player.js" as Player
import "../view_models"
import org.kde.kirigami 2.6 as Kirigami
import org.kde.mauikit 1.0 as Maui
Maui.Menu
Menu
{
id: control
width: unit * 200
......@@ -24,7 +24,7 @@ Maui.Menu
signal rateClicked(int rate)
Maui.MenuItem
MenuItem
{
text: qsTr("Play...")
onTriggered:
......@@ -39,13 +39,13 @@ Maui.Menu
}
}
Maui.MenuItem
MenuItem
{
text: qsTr("Append...")
onTriggered: Player.appendAll(_selectionBarModelList.getAll())
}
Maui.MenuItem
MenuItem
{
text: qsTr("Queue")
onTriggered:
......@@ -58,7 +58,7 @@ Maui.Menu
MenuSeparator {}
Maui.MenuItem
MenuItem
{
text: qsTr("Fav/UnFav them")
onTriggered:
......@@ -70,7 +70,7 @@ Maui.Menu
}
Maui.MenuItem
MenuItem
{
text: qsTr("Add to...")
onTriggered:
......@@ -83,7 +83,7 @@ Maui.Menu
MenuSeparator {}
Maui.MenuItem
MenuItem
{
text: qsTr("Share...")
onTriggered:
......@@ -96,10 +96,10 @@ Maui.Menu
MenuSeparator {}
Maui.MenuItem
MenuItem
{
text: qsTr("Remove")
colorScheme.textColor: dangerColor
Kirigami.Theme.textColor: dangerColor
onTriggered:
{
close()
......@@ -108,7 +108,7 @@ Maui.Menu
MenuSeparator {}
Maui.MenuItem
MenuItem
{
id: starsRow
width: parent.width
......@@ -194,7 +194,7 @@ Maui.Menu
}
Maui.MenuItem
MenuItem
{
id: colorsRow
width: parent.width
......
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