public SinglePlaybackEventFeed(IPlaybackEventFeed parent, ushort channelId) { ChannelId = channelId; // TODO(@MattWindsor91): filter these properly ObserveIncomingCount = parent.ObserveIncomingCount; ObserveUnknownCommand = parent.ObserveUnknownCommand; ObservePlayerState = OnThisChannel(parent.ObservePlayerState); ObserveMarker = OnThisChannel(parent.ObserveMarker); ObserveTrackLoad = OnThisChannel(parent.ObserveTrackLoad); }
/// <summary> /// Creates an observable tracking the most recently loaded /// non-text track. /// <para> /// The most recently loaded text track generally gets handled /// in the <see cref="TextViewModel"/>. /// </para> /// </summary> /// <param name="playbackEvents"> /// The events feed to adapt for the observable. /// </param> /// <returns> /// An <see cref="IObservable{T}"/> that tracks the most /// recent track sent from <paramref name="playbackEvents"/> that /// is not a text item. /// </returns> private static IObservable <ITrack> NonTextLoadedTrack(IPlaybackEventFeed playbackEvents) => from x in playbackEvents.ObserveTrackLoad where !x.Track.IsTextItem select x.Track;