summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-12-27 05:20:51 +0100
committerJavier <dev.git@javispedro.com>2015-12-27 05:20:51 +0100
commitc4da0adbbd4f83bf47b71046f01cd9f12742ec7e (patch)
tree5d666069d5da1b0883bf40211c7d1b0d52fa1bb8
parent36ec2c13b4d519231794c2262818e48526074f94 (diff)
downloadsapd-c4da0adbbd4f83bf47b71046f01cd9f12742ec7e.tar.gz
sapd-c4da0adbbd4f83bf47b71046f01cd9f12742ec7e.zip
pull latest libwatchfish, prepare for music support
-rw-r--r--musicagent.cc5
-rw-r--r--musicconn.cc14
-rw-r--r--musicconn.h1
-rw-r--r--rpm/sapd.yaml1
-rw-r--r--sapd.pro8
5 files changed, 22 insertions, 7 deletions
diff --git a/musicagent.cc b/musicagent.cc
index 5d7836a..f67cc1d 100644
--- a/musicagent.cc
+++ b/musicagent.cc
@@ -23,6 +23,7 @@ MusicAgent* MusicAgent::instance()
void MusicAgent::peerFound(SAPPeer *peer)
{
+ Q_UNUSED(peer);
}
void MusicAgent::requestConnection(SAPConnectionRequest *request)
@@ -40,12 +41,12 @@ void MusicAgent::registerServices(SAPManager *manager)
service.setProfile(music_profile);
service.setFriendlyName("Media controller");
- service.setRole(SAPServiceInfo::RoleConsumer);
+ service.setRole(SAPServiceInfo::RoleProvider);
service.setVersion(1, 0);
service.setConnectionTimeout(0);
channel.setChannelId(100);
- channel.setPayloadType(SAPChannelInfo::PayloadJson);
+ channel.setPayloadType(SAPChannelInfo::PayloadNone);
channel.setQoSType(SAPChannelInfo::QoSReliabilityDisable);
channel.setQoSDataRate(SAPChannelInfo::QoSDataRateLow);
channel.setQoSPriority(SAPChannelInfo::QoSPriorityLow);
diff --git a/musicconn.cc b/musicconn.cc
index 256e6a8..45a00fb 100644
--- a/musicconn.cc
+++ b/musicconn.cc
@@ -1,4 +1,5 @@
#include <QtCore/QDebug>
+#include <QtCore/QJsonDocument>
#include "sappeer.h"
#include "musicconn.h"
@@ -19,12 +20,21 @@ MusicConn::MusicConn(SAPConnection *conn, QObject *parent)
connect(_socket, SIGNAL(messageReceived()), SLOT(handleMessageReceived()));
}
-void MusicConn::handleConnected()
+MusicConn::~MusicConn()
{
+ qDebug() << "Music terminated";
+}
+void MusicConn::handleConnected()
+{
+ qDebug() << "Music connected";
}
void MusicConn::handleMessageReceived()
{
-
+ qDebug() << "Music msg received";
+ QByteArray data = _socket->receive();
+ qDebug() << data.toHex();
+ qDebug() << QString::fromLatin1(data);
+ qDebug() << "Fini";
}
diff --git a/musicconn.h b/musicconn.h
index a38bf94..7b0934d 100644
--- a/musicconn.h
+++ b/musicconn.h
@@ -11,6 +11,7 @@ class MusicConn : public QObject
public:
MusicConn(SAPConnection *conn, QObject *parent = 0);
+ ~MusicConn();
protected:
diff --git a/rpm/sapd.yaml b/rpm/sapd.yaml
index c7798eb..4c45974 100644
--- a/rpm/sapd.yaml
+++ b/rpm/sapd.yaml
@@ -21,6 +21,7 @@ PkgConfigBR:
- dbus-1
- timed-qt5
- bluez-qt5
+ - mpris-qt5
PkgBR:
# Workaround current sailfish qt5connectivity packaging bug
diff --git a/sapd.pro b/sapd.pro
index f52821a..b3bf4a4 100644
--- a/sapd.pro
+++ b/sapd.pro
@@ -9,11 +9,13 @@ PKGCONFIG += openssl
exists(/usr/lib/pkgconfig/sailfishapp.pc) {
# Building for Jolla Sailfish, Qt5, Bluez4(?)
DEFINES += SAILFISH
- PKGCONFIG += dbus-1 timed-qt5 bluez-qt5
+ PKGCONFIG += dbus-1 timed-qt5 bluez-qt5 mpris-qt5
SOURCES += libwatchfish/notificationmonitor.cpp libwatchfish/notification.cpp \
- libwatchfish/walltimemonitor.cpp
+ libwatchfish/walltimemonitor.cpp \
+ libwatchfish/musiccontroller.cpp
HEADERS += libwatchfish/notificationmonitor.h libwatchfish/notificationmonitor_p.h libwatchfish/notification.h \
- libwatchfish/walltimemonitor.h libwatchfish/walltimemonitor_p.h
+ libwatchfish/walltimemonitor.h libwatchfish/walltimemonitor_p.h \
+ libwatchfish/musiccontroller.h libwatchfish/musiccontroller_p.h
} else {
# Building for desktop, Qt5, Bluez5
DEFINES += DESKTOP