Permalink
Browse files

Add notification for client connection/disconnection

  • Loading branch information...
jyavenard committed Jul 1, 2013
1 parent e3fd20c commit 626cde51d586b5bb53c401706b4643a252e82b28
Showing with 8 additions and 1 deletion.
  1. +8 −1 mythtv/libs/libmythtv/AirPlay/mythraopdevice.cpp
@@ -7,6 +7,7 @@
#include "mthread.h"
#include "mythlogging.h"
#include "mythcorecontext.h"
#include "mythuinotificationcenter.h"
#include "bonjourregister.h"
#include "mythraopconnection.h"
@@ -61,7 +62,6 @@ bool MythRAOPDevice::Create(void)
gMythRAOPDeviceThread->start(QThread::LowestPriority);
}
LOG(VB_GENERAL, LOG_INFO, LOC + "Created RAOP device objects.");
return true;
}
@@ -209,6 +209,10 @@ void MythRAOPDevice::newConnection(QTcpSocket *client)
LOG(VB_GENERAL, LOG_INFO, LOC + QString("New connection from %1:%2")
.arg(client->peerAddress().toString()).arg(client->peerPort()));
MythNotification n(tr("New Connection"), tr("AirTunes"),
tr("from %1:%2").arg(client->peerAddress().toString()).arg(client->peerPort()));
MythUINotificationCenter::GetInstance()->Queue(n);
MythRAOPConnection *obj =
new MythRAOPConnection(this, client, m_hardwareId, 6000);
@@ -233,6 +237,9 @@ void MythRAOPDevice::deleteClient(void)
QMutexLocker locker(m_lock);
QList<MythRAOPConnection *>::iterator it = m_clients.begin();
MythNotification n(tr("Client disconnected"), tr("AirTunes"));
MythUINotificationCenter::GetInstance()->Queue(n);
while (it != m_clients.end())
{
if ((*it)->GetSocket()->state() == QTcpSocket::UnconnectedState)

0 comments on commit 626cde5

Please sign in to comment.