Table of Contents

Class MrpPushUpdater

Namespace
AppleTvControlLibrary.Mrp.PlayerState
Assembly
AppleTvControlLibrary.Mrp.dll

Forwards MrpPlayerStateManager updates for the active client/player to a registered IMrpPushUpdaterListener, mirroring pyatv's MrpPushUpdater.

public sealed class MrpPushUpdater : IMrpPlayerStateListener
Inheritance
MrpPushUpdater
Implements
Inherited Members

Remarks

Unlike pyatv, which installs itself as PlayerStateManager.listener and receives a no-argument callback (reading self.psm.playing itself), this type both installs itself as IMrpPlayerStateListener and does the "read playing" step, since that is exactly what pyatv's state_updated() does synchronously before dispatch.

Constructors

MrpPushUpdater(MrpPlayerStateManager)

Forwards MrpPlayerStateManager updates for the active client/player to a registered IMrpPushUpdaterListener, mirroring pyatv's MrpPushUpdater.

public MrpPushUpdater(MrpPlayerStateManager psm)

Parameters

psm MrpPlayerStateManager

The player state manager to source updates from.

Remarks

Unlike pyatv, which installs itself as PlayerStateManager.listener and receives a no-argument callback (reading self.psm.playing itself), this type both installs itself as IMrpPlayerStateListener and does the "read playing" step, since that is exactly what pyatv's state_updated() does synchronously before dispatch.

Properties

Active

Gets a value indicating whether this instance is currently registered to receive push updates.

public bool Active { get; }

Property Value

bool

Listener

Gets or sets the listener notified of push updates and errors.

public IMrpPushUpdaterListener? Listener { get; set; }

Property Value

IMrpPushUpdaterListener

Methods

Start()

Starts forwarding push updates from the device to Listener, immediately delivering the current state once.

public void Start()

Exceptions

MrpNoAsyncListenerException

No Listener has been set.

StateUpdated()

Called when relevant player state has changed.

public void StateUpdated()

Stop()

Stops forwarding push updates to Listener.

public void Stop()