added artwork update on execute browse item

This commit is contained in:
nymea 2019-10-09 12:33:51 +02:00 committed by bernhard.trinnes
parent 6dce9a2ad6
commit 9388a563ff
3 changed files with 22 additions and 46 deletions

View File

@ -880,13 +880,13 @@ void Heos::readData()
}
}
} else if (command.contains("player_now_playing_changed")) {
qDebug() << "Player now playing changed";
qDebug(dcDenon()) << "Player now playing changed";
if (message.hasQueryItem("pid")) {
int playerId = message.queryItemValue("pid").toInt();
emit playerNowPlayingChanged(playerId);
}
} else if (command.contains("player_now_playing_progress")) {
qDebug() << "Player now playing progress";
qDebug(dcDenon()) << "Player now playing progress";
if (message.hasQueryItem("pid")) {
int playerId = message.queryItemValue("pid").toInt();
int currentPossition = message.queryItemValue("cur_pos").toInt();
@ -894,7 +894,7 @@ void Heos::readData()
emit playerNowPlayingProgressReceived(playerId, currentPossition, duration);
}
} else if (command.contains("player_playback_error")) {
qDebug() << "Player playback error";
qDebug(dcDenon) << "Player playback error";
int playerId = 0;
if (message.hasQueryItem("pid")) {
playerId = message.queryItemValue("pid").toInt();
@ -902,14 +902,14 @@ void Heos::readData()
emit playerPlaybackErrorReceived(playerId, errorMessage);
}
} else if (command.contains("player_queue_changed")) {
qDebug() << "Player queue Changed";
qDebug(dcDenon()) << "Player queue Changed";
int playerId = 0;
if (message.hasQueryItem("pid")) {
playerId = message.queryItemValue("pid").toInt();
emit playerQueueChanged(playerId);
}
} else if (command.contains("player_volume_changed")) {
qDebug() << "Event player volume Changed";
qDebug(dcDenon()) << "Event player volume Changed";
int playerId = 0;
if (message.hasQueryItem("pid")) {
playerId = message.queryItemValue("pid").toInt();
@ -929,7 +929,7 @@ void Heos::readData()
}
}
} else if (command.contains("repeat_mode_changed")) {
qDebug() << "Repeat mode Changed";
qDebug(dcDenon()) << "Repeat mode Changed";
int playerId = 0;
if (message.hasQueryItem("pid")) {
playerId = message.queryItemValue("pid").toInt();
@ -947,7 +947,7 @@ void Heos::readData()
}
}
} else if (command.contains("shuffle_mode_changed")) {
qDebug() << "Shuffle mode Changed";
qDebug(dcDenon()) << "Shuffle mode Changed";
int playerId = 0;
if (message.hasQueryItem("pid")) {
playerId = message.queryItemValue("pid").toInt();
@ -963,8 +963,7 @@ void Heos::readData()
}
}
} else if (command.contains("group_volume_changed")) {
qDebug() << "Event group volume Changed";
qDebug(dcDenon()) << "Event group volume Changed";
int playerId = 0;
if (message.hasQueryItem("gid")) {
playerId = message.queryItemValue("gid").toInt();
@ -984,6 +983,8 @@ void Heos::readData()
}
}
} else if (command.contains("user_changed")) {
qDebug(dcDenon()) << "Event user changed";
bool signedIn;
QString username;
if (message.hasQueryItem("signed_out")){

View File

@ -28,26 +28,6 @@
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
<<<<<<< HEAD:denon/integrationplugindenon.cpp
/*!
\page denon.html
\title Denon
\brief Plugin for Denon AV and Heos Devices
\ingroup plugins
\ingroup nymea-plugins
This plug-in supports the
\l {http://www.denon.de/de/product/hometheater/avreceivers/avrx1000}{Denon AV Amplifier AVR-X1000}
\chapter Plugin properties
Following JSON file contains the definition and the description of all available \l{ThingClass}{DeviceClasses}
and \l{Vendor}{Vendors} of this \l{IntegrationPlugin}.
For more details how to read this JSON file please check out the documentation for \l{The plugin JSON File}.
\quotefile plugins/IntegrationPlugins/denon/IntegrationPlugindenon.json
*/
#include "integrationplugindenon.h"
#include "plugininfo.h"
@ -211,7 +191,7 @@ void IntegrationPluginDenon::setupThing(ThingSetupInfo *info)
QHostAddress address(thing->paramValue(heosThingIpParamTypeId).toString());
Heos *heos = new Heos(address, this);
<<<<<<< HEAD:denon/integrationplugindenon.cpp
connect(heos, &Heos::connectionStatusChanged, this, &IntegrationPluginDenon::onHeosConnectionChanged);
connect(heos, &Heos::playerDiscovered, this, &IntegrationPluginDenon::onHeosPlayerDiscovered);
@ -224,24 +204,11 @@ void IntegrationPluginDenon::setupThing(ThingSetupInfo *info)
connect(heos, &Heos::musicSourcesReceived, this, &IntegrationPluginDenon::onHeosMusicSourcesReceived);
connect(heos, &Heos::mediaItemsReceived, this, &IntegrationPluginDenon::onHeosMediaItemsReceived);
connect(heos, &Heos::browseRequestReceived, this, &IntegrationPluginDenon::onHeosBrowseRequestReceived);
connect(heos, &Heos::browseErrorReceived, this, &IntegrationPluginDenon::onHeosBrowseErrorReceived);
connect(heos, &Heos::playerQueueChanged, this, &IntegrationPluginDenon::onHeosPlayerQueueChanged);
m_heos.insert(thing->id(), heos);
=======
connect(heos, &Heos::connectionStatusChanged, this, &DevicePluginDenon::onHeosConnectionChanged);
connect(heos, &Heos::playersChanged, this, &DevicePluginDenon::onHeosPlayersChanged);
connect(heos, &Heos::playerDiscovered, this, &DevicePluginDenon::onHeosPlayerDiscovered);
connect(heos, &Heos::playerPlayStateReceived, this, &DevicePluginDenon::onHeosPlayStateReceived);
connect(heos, &Heos::playerRepeatModeReceived, this, &DevicePluginDenon::onHeosRepeatModeReceived);
connect(heos, &Heos::playerShuffleModeReceived, this, &DevicePluginDenon::onHeosShuffleModeReceived);
connect(heos, &Heos::playerMuteStatusReceived, this, &DevicePluginDenon::onHeosMuteStatusReceived);
connect(heos, &Heos::playerVolumeReceived, this, &DevicePluginDenon::onHeosVolumeStatusReceived);
connect(heos, &Heos::nowPlayingMediaStatusReceived, this, &DevicePluginDenon::onHeosNowPlayingMediaStatusReceived);
connect(heos, &Heos::musicSourcesReceived, this, &DevicePluginDenon::onHeosMusicSourcesReceived);
connect(heos, &Heos::browseRequestReceived, this, &DevicePluginDenon::onHeosBrowseRequestReceived);
connect(heos, &Heos::browseErrorReceived, this, &DevicePluginDenon::onHeosBrowseErrorReceived);
m_heos.insert(device->id(), heos);
>>>>>>> improved browsing on TuneIn:denon/deviceplugindenon.cpp
m_asyncHeosSetups.insert(heos, info);
// In case the setup is cancelled before we finish it...
connect(info, &QObject::destroyed, this, [this, info, heos]() { m_asyncHeosSetups.remove(heos); });
@ -871,6 +838,13 @@ void IntegrationPluginDenon::onHeosPlayerNowPlayingChanged(int playerId)
heos->getNowPlayingMedia(playerId);
}
void DevicePluginDenon::onHeosPlayerQueueChanged(int playerId)
{
Heos *heos = static_cast<Heos *>(sender());
heos->getNowPlayingMedia(playerId);
}
void IntegrationPluginDenon::onAvahiServiceEntryAdded(const ZeroConfServiceEntry &serviceEntry)
{
qCDebug(dcDenon()) << "Avahi service entry added:" << serviceEntry;

View File

@ -108,6 +108,7 @@ private slots:
void onHeosBrowseRequestReceived(const QString &sourceId, const QString &containerId, QList<MusicSourceObject> musicSources, QList<MediaObject> mediaItems);
void onHeosBrowseErrorReceived(const QString &sourceId, const QString &containerId, int errorId, const QString &errorMessage);
void onHeosPlayerNowPlayingChanged(int playerId);
void onHeosPlayerQueueChanged(int playerId);
void onAvahiServiceEntryAdded(const ZeroConfServiceEntry &serviceEntry);
void onAvahiServiceEntryRemoved(const ZeroConfServiceEntry &serviceEntry);