public PersistentBeamPlaylist(PimpSession session, PimpWebSocket webSocket, BeamPlayer player) : base(session, webSocket, player) { fileName = session.Username + ".json"; webSocket.Welcomed += webSocket_Welcomed; webSocket.Disconnected += PlayerDisconnected; }
public WebSocketPlaylistBase(PimpWebSocket webSocket) { this.webSocket = webSocket; IsEventBased = true; AutoPlay = true; webSocket.PlaylistModified += Sync; webSocket.PlaylistIndexChanged += index => Index = index; }
public TimeBasedPlaylist(PimpWebSocket webSocket) { this.webSocket = webSocket; StartedFromSeconds = 0; AutoPlay = true; webSocket.PlaylistModified += Sync; webSocket.PlaylistIndexChanged += index => Index = index; webSocket.TimeUpdated += webSocket_TimeUpdated; }
private Task UpdateShortStatus(ShortStatusJsonEvent ev) { return(OnUiThread(() => { CurrentPlayerState = PimpWebSocket.FromName(ev.state); TrackPosition = TimeSpan.FromSeconds(ev.position); Volume = ev.volume; IsMute = ev.mute; })); }
public BeamPlayer(PimpSession session, PimpWebSocket webSocket, CoverService coverService) : base(session, webSocket) { IsSkipAndSeekSupported = false; Volume = 100; IsMute = false; webSocket.Welcomed += webSocket_Welcomed; webSocket.Disconnected += webSocket_Disconnected; TrackChanged += BeamPlayer_TrackChanged; }
public WebSocketPlayer(SimplePimpSession session, PimpWebSocket webSocket) { Session = session; this.webSocket = webSocket; this.session = session; // the lifetime of this player is the same as the websocket // so we don't care about deregistering event handlers // Update: I believe the above is untrue. webSocket.MuteToggled += async muteOrNot => await OnUiThread(() => IsMute = muteOrNot); webSocket.VolumeChanged += async volume => await OnUiThread(() => Volume = volume); webSocket.TimeUpdated += OnTimeUpdated; webSocket.TrackChanged += async track => { // TODO do better FeedbackMessage = null; await OnUiThread(() => NowPlaying = track); }; webSocket.PlayStateChanged += async state => await OnUiThread(() => CurrentPlayerState = state); webSocket.StatusUpdateReceived += UpdateStatus; webSocket.ShortStatusUpdateReceived += async shortStatus => await UpdateShortStatus(shortStatus); webSocket.Welcomed += async() => { await OnUiThread(() => IsOnline = true); await Utils.SuppressAsync <Exception>(async() => await PostSimple("status")); }; //webSocket.Disconnected += str => IsOnline = false; webSocket.SocketClosed += async str => { await OnUiThread(() => IsOnline = false); // Tries to reconnect, once await Utils.SuppressAsync <Exception>(OpenWebSocketAsync); }; webSocket.ErrorOccurred += async() => await OnUiThread(() => IsOnline = false); IsEventBased = true; }
public PhoneBeamPlayer(PimpSession session, PimpWebSocket webSocket) : base(session, webSocket, PhoneCoverService.Instance) { BeamPlaylist = new PhoneBeamPlaylist(session, webSocket, this); Init(); }
public PimpPlayer(PimpSession s, Func <MusicEndpoint> musicSource, PimpWebSocket webSocket) : this(s, webSocket, new PimpPlaylist(s, musicSource, webSocket)) { }
//public static readonly string postResource = "/playback"; public PimpPlayer(SimplePimpSession s, PimpWebSocket webSocket, BasePlaylist playlist) : base(s, webSocket) { Playlist = playlist; }
public PimpWebPlayer(PimpSession session, PimpWebSocket webSocket) : base(session, webSocket) { Playlist = new PimpWebPlaylist(session, webSocket); }
public BasePlayer NewBeamPlayer(PimpSession session, PimpWebSocket socket) { return(impl.NewBeamPlayer(session, socket)); }
public PimpPlaylist(PimpSession session, Func <MusicEndpoint> musicSource, PimpWebSocket webSocket) : base(session, webSocket) { this.s = session; this.musicSource = musicSource; }
public StoreBeamPlaylist(PimpSession session, PimpWebSocket webSocket, BeamPlayer player) : base(session, webSocket, player) { roaming = new RoamingSettings(); }
public BeamPlaylist(PimpSession session, PimpWebSocket webSocket, BeamPlayer player) : base(webSocket) { this.session = session; this.player = player; }
public PimpBasePlayer(SimplePimpSession session, PimpWebSocket pimpSocket) : base(session, pimpSocket) { }
private static PlayerState playerState(StatusPimpResponse status) { return(PimpWebSocket.FromName(status.state)); }
public SimplePimpPlaylist(SimplePimpSession session, PimpWebSocket webSocket) : base(webSocket) { this.session = session; }
public PimpWebPlaylist(PimpSessionBase session, PimpWebSocket webSocket) : base(webSocket) { this.session = session; }
public PhoneBeamPlaylist(PimpSession session, PimpWebSocket webSocket, BeamPlayer player) : base(session, webSocket, player) { }