Commit 97d6e327 authored by Camilo higuita's avatar Camilo higuita

update to changes on mauikit

parent 0d14cba6
......@@ -10,86 +10,86 @@ class Socket;
namespace LINK
{
Q_NAMESPACE
enum CODE
{
CONNECTED = 1,
ERROR = 2,
DISCONNECTED = 3,
SEARCHFOR = 4,
PLAYLISTS = 5,
FILTER = 6,
QUERY = 7,
PLAY = 8,
COLLECT = 9
};
Q_ENUM_NS(CODE);
static QMap<CODE, QString> DECODE =
{
{CODE::CONNECTED, "CONNECTED"},
{CODE::ERROR, "ERROR"},
{CODE::DISCONNECTED, "DISCONNECTED"},
{CODE::SEARCHFOR, "SEARCHFOR"},
{CODE::PLAYLISTS, "PLAYLISTS"},
{CODE::FILTER, "FILTER"},
{CODE::QUERY, "QUERY"},
{CODE::PLAY, "PLAY"},
{CODE::COLLECT, "COLLECT"}
};
Q_NAMESPACE
enum CODE
{
CONNECTED = 1,
ERROR = 2,
DISCONNECTED = 3,
SEARCHFOR = 4,
PLAYLISTS = 5,
FILTER = 6,
QUERY = 7,
PLAY = 8,
COLLECT = 9
};
Q_ENUM_NS(CODE);
static QMap<CODE, QString> DECODE =
{
{CODE::CONNECTED, "CONNECTED"},
{CODE::ERROR, "ERROR"},
{CODE::DISCONNECTED, "DISCONNECTED"},
{CODE::SEARCHFOR, "SEARCHFOR"},
{CODE::PLAYLISTS, "PLAYLISTS"},
{CODE::FILTER, "FILTER"},
{CODE::QUERY, "QUERY"},
{CODE::PLAY, "PLAY"},
{CODE::COLLECT, "COLLECT"}
};
}
class Linking : public QObject
{
Q_OBJECT
private:
QWebSocket client;
QString IP;
QString stringify(const QVariantMap &map);
QByteArray trackArray;
int arraySize =0;
public:
Socket *server;
explicit Linking(QObject *parent = nullptr);
QString deviceName;
QVariantMap packResponse(const LINK::CODE &code, const QVariant &content);
void init(const int &index);
Q_INVOKABLE void setIp(const QString &ip);
Q_INVOKABLE QString getIp();
Q_INVOKABLE QString deviceIp();
Q_INVOKABLE QString getPort();
Q_INVOKABLE QString getDeviceName();
Q_INVOKABLE void ask(int code, QString msg);
Q_INVOKABLE void collectTrack(QString url);
QVariantMap decode(const QString &json);
void onConnected();
QStringList checkAddresses();
Q_INVOKABLE void connectTo(QString ip, QString port);
Q_INVOKABLE void sendToClient(QVariantMap map);
void sendArrayToClient(const QByteArray &array);
signals:
void devicesLinked();
void serverConReady(QString deviceName);
void serverConDisconnected(QString index);
void clientConDisconnected();
void clientConError(QString message);
void parseAsk(QString json);
void responseReady(QVariantMap res);
void arrayReady(QByteArray array);
void bytesFrame(QByteArray array);
public slots:
void handleError(QAbstractSocket::SocketError error);
Q_OBJECT
private:
QWebSocket client;
QString IP;
QString stringify(const QVariantMap &map);
QByteArray trackArray;
int arraySize =0;
public:
Socket *server;
explicit Linking(QObject *parent = nullptr);
QString deviceName;
QVariantMap packResponse(const LINK::CODE &code, const QVariant &content);
void init(const int &index);
Q_INVOKABLE void setIp(const QString &ip);
Q_INVOKABLE QString getIp();
Q_INVOKABLE QString deviceIp();
Q_INVOKABLE QString getPort();
Q_INVOKABLE QString getDeviceName();
Q_INVOKABLE void ask(int code, QString msg);
Q_INVOKABLE void collectTrack(QString url);
QVariantMap decode(const QString &json);
void onConnected();
QStringList checkAddresses();
Q_INVOKABLE void connectTo(QString ip, QString port);
Q_INVOKABLE void sendToClient(QVariantMap map);
void sendArrayToClient(const QByteArray &array);
signals:
void devicesLinked();
void serverConReady(QString deviceName);
void serverConDisconnected(QString index);
void clientConDisconnected();
void clientConError(QString message);
void parseAsk(QString json);
void responseReady(QVariantMap res);
void arrayReady(QByteArray array);
void bytesFrame(QByteArray array);
public slots:
void handleError(QAbstractSocket::SocketError error);
};
......
......@@ -110,20 +110,21 @@ ItemDelegate
(artwork.length > 0 && artwork !== "NONE")? "file://"+encodeURIComponent(artwork) : "qrc:/assets/cover.png"
else "qrc:/assets/cover.png"
}
layer.enabled: albumRadius > 0
layer.enabled: albumRadius
layer.effect: OpacityMask
{
maskSource: Item
{
width: img.width
height: img.height
Rectangle
{
anchors.centerIn: parent
width: img.adapt ? img.width : Math.min(img.width, img.height)
height: img.adapt ? img.height : width
radius: albumRadius
// radius: Math.min(width, height)
border.color: borderColor
}
}
}
......
......@@ -36,8 +36,7 @@ Page
Maui.Holder
{
id: lyricsHolder
fgColor: darkTextColor
// anchors.fill: parent
colorScheme.textColor: darkTextColor
visible: lyricsText.text.length > 0 ? false : true
message: "Couldn't find the lyrics!"
}
......
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