Skip to content

Commit

Permalink
Have AirTunes sends a TVPlaybackStopped( signal when it stops.
Browse files Browse the repository at this point in the history
Used by MythMusic to know when to resume playback
  • Loading branch information
jyavenard committed Jul 14, 2013
1 parent 5ed3c41 commit c433237
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/AirPlay/mythraopconnection.h
Expand Up @@ -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);
Expand Down

0 comments on commit c433237

Please sign in to comment.