diff --git a/boblight/bobchannel.cpp b/boblight/bobchannel.cpp index 497bf43a..3c3fd005 100644 --- a/boblight/bobchannel.cpp +++ b/boblight/bobchannel.cpp @@ -26,7 +26,6 @@ BobChannel::BobChannel(const int &id, QObject *parent) : { m_animation = new QPropertyAnimation(this, "finalColor", this); m_animation->setDuration(500); - m_animation->setEasingCurve(QEasingCurve::InOutQuad); } int BobChannel::id() const @@ -41,13 +40,14 @@ QColor BobChannel::color() const void BobChannel::setColor(const QColor &color) { - m_color = color; - emit colorChanged(); - if (m_animation->state() == QPropertyAnimation::Running) { m_animation->stop(); + m_finalColor = m_color; } + m_color = color; + emit colorChanged(); + m_animation->setStartValue(m_finalColor); m_animation->setEndValue(color); m_animation->start(); diff --git a/boblight/bobclient.cpp b/boblight/bobclient.cpp index 863d126b..809b3d68 100644 --- a/boblight/bobclient.cpp +++ b/boblight/bobclient.cpp @@ -35,7 +35,7 @@ BobClient::BobClient(const QString &host, const int &port, QObject *parent) : { m_syncTimer = new QTimer(this); m_syncTimer->setSingleShot(false); - m_syncTimer->setInterval(50); + m_syncTimer->setInterval(25); connect(m_syncTimer, SIGNAL(timeout()), this, SLOT(sync())); } @@ -103,7 +103,7 @@ BobChannel *BobClient::getChannel(const int &id) if (channel->id() == id) return channel; } - return 0; + return nullptr; } void BobClient::setColor(int channel, QColor color) @@ -148,7 +148,7 @@ void BobClient::sync() boblight_addpixel(m_boblight, channel->id(), rgb); } - if (!boblight_sendrgb(m_boblight, 1, NULL)) { + if (!boblight_sendrgb(m_boblight, 1, nullptr)) { qCWarning(dcBoblight) << "Boblight connection error:" << boblight_geterror(m_boblight); boblight_destroy(m_boblight); qDeleteAll(m_channels); diff --git a/boblight/bobclient.h b/boblight/bobclient.h index dd323deb..85c943a1 100644 --- a/boblight/bobclient.h +++ b/boblight/bobclient.h @@ -34,7 +34,7 @@ class BobClient : public QObject { Q_OBJECT public: - explicit BobClient(const QString &host = "127.0.0.1", const int &port = 19333, QObject *parent = 0); + explicit BobClient(const QString &host = "127.0.0.1", const int &port = 19333, QObject *parent = nullptr); ~BobClient(); bool connectToBoblight(); diff --git a/boblight/devicepluginboblight.cpp b/boblight/devicepluginboblight.cpp index 118d233e..1099147d 100644 --- a/boblight/devicepluginboblight.cpp +++ b/boblight/devicepluginboblight.cpp @@ -58,12 +58,12 @@ void DevicePluginBoblight::startMonitoringAutoDevices() foreach (Device *device, myDevices()) { deviceIds.insert(device->id(), device); if (device->deviceClassId() == boblightServerDeviceClassId) { - qWarning() << "Device" << device->id() << "is bridge"; +// qWarning() << "Device" << device->id() << "is bridge"; if (!parentDevices.contains(device->id())) { parentDevices[device->id()] = 0; } } else if (device->deviceClassId() == boblightDeviceClassId) { - qWarning() << "Device" << device->id() << "is child to bridge" << device->parentId(); +// qWarning() << "Device" << device->id() << "is child to bridge" << device->parentId(); parentDevices[device->parentId()] += 1; } }