From c4332375271e4ee355b9d9db245d97f21bb82eea Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Sun, 14 Jul 2013 17:04:25 +1000 Subject: [PATCH] Have AirTunes sends a TVPlaybackStopped( signal when it stops. Used by MythMusic to know when to resume playback --- mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp | 8 +++++++- mythtv/libs/libmythtv/AirPlay/mythraopconnection.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp b/mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp index a4a4b4485f2..7b664351ec5 100644 --- a/mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp +++ b/mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp @@ -83,7 +83,7 @@ MythRAOPConnection::MythRAOPConnection(QObject *parent, QTcpSocket *socket, m_clockSkew(0), m_audioTimer(NULL), m_progressStart(0), m_progressCurrent(0), m_progressEnd(0), - m_firstsend(false) + m_firstsend(false), m_playbackStarted(false) { m_id = MythUINotificationCenter::GetInstance()->Register(this); } @@ -182,6 +182,11 @@ void MythRAOPConnection::CleanUp(void) // close audio device CloseAudioDevice(); + // Tell listeners we're done + if (m_playbackStarted) + { + gCoreContext->emitTVPlaybackStopped(); + } } bool MythRAOPConnection::Init(void) @@ -1123,6 +1128,7 @@ void MythRAOPConnection::ProcessRequest(const QStringList &header, // New client is trying to play audio, disconnect all the other clients ((MythRAOPDevice*)parent())->DeleteAllClients(this); gCoreContext->WantingPlayback(parent()); + m_playbackStarted = true; int control_port = 0; int timing_port = 0; diff --git a/mythtv/libs/libmythtv/AirPlay/mythraopconnection.h b/mythtv/libs/libmythtv/AirPlay/mythraopconnection.h index 4d021d47c84..a296679e854 100644 --- a/mythtv/libs/libmythtv/AirPlay/mythraopconnection.h +++ b/mythtv/libs/libmythtv/AirPlay/mythraopconnection.h @@ -190,6 +190,7 @@ class MTV_PUBLIC MythRAOPConnection : public QObject // Notification Center registration Id int m_id; bool m_firstsend; + bool m_playbackStarted; private slots: void ProcessAudio(void);