public GetPlaylistsQuery(ISpotifySession spotifySession)
        {
            if (spotifySession == null)
            {
                throw new ArgumentNullException("spotifySession");
            }

            _spotifySession = spotifySession;
        }
Exemplo n.º 2
0
        public LoginCommandHandler(ISpotifySession spotifySession)
        {
            if (spotifySession == null)
            {
                throw new ArgumentNullException("spotifySession");
            }

            _spotifySession = spotifySession;
        }
        public int MusicDelivery(ISpotifySession session, AudioFormat format, IntPtr frames, int num_frames)
        {
            if (num_frames == 0)
            {
                return(0);
            }

            _soundOutput.AddSamples(frames, num_frames);

            return(num_frames);
        }
        public void LoggedIn(ISpotifySession session, SpotifyError error)
        {
            Log.Debug("LoggedIn");

            if (error != SpotifyError.Ok)
            {
                _bus.PublishAsync(new LoginFailedEvent());
                return;
            }

            _bus.PublishAsync(new LoggedInEvent());
        }
        public void LoggedIn(ISpotifySession session, SpotifyError error)
        {
            Log.Debug("LoggedIn");

            if (error != SpotifyError.Ok)
            {
                _bus.PublishAsync(new LoginFailedEvent());
                return;
            }

            _bus.PublishAsync(new LoggedInEvent());
        }
Exemplo n.º 6
0
        public PreviousSongCommandHandler(ISpotifySession spotifySession, ISession session)
        {
            if (spotifySession == null)
            {
                throw new ArgumentNullException("spotifySession");
            }
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            _spotifySession = spotifySession;
            _session        = session;
        }
Exemplo n.º 7
0
        public SetActivePlaylistCommandHandler(ISpotifySession spotifySession, ISession session)
        {
            if (spotifySession == null)
            {
                throw new ArgumentNullException("spotifySession");
            }
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            _spotifySession = spotifySession;
            _session        = session;
        }
        public LoggedOutEventHandler(ISpotifySession spotifySession, ISession session)
        {
            if (spotifySession == null)
            {
                throw new ArgumentNullException("spotifySession");
            }
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            _spotifySession = spotifySession;
            _session        = session;
        }
Exemplo n.º 9
0
        public StopCommandHandler(ISpotifySession spotifySession, ISoundOutput soundOutput, ISession session)
        {
            if (spotifySession == null)
            {
                throw new ArgumentNullException("spotifySession");
            }
            if (soundOutput == null)
            {
                throw new ArgumentNullException("soundOutput");
            }
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            _spotifySession = spotifySession;
            _soundOutput    = soundOutput;
            _session        = session;
        }
Exemplo n.º 10
0
        public LoggedInEventHandler(ISpotifySession spotifySession, IBus bus, ISession session)
        {
            if (spotifySession == null)
            {
                throw new ArgumentNullException("spotifySession");
            }
            if (bus == null)
            {
                throw new ArgumentNullException("bus");
            }
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            _spotifySession = spotifySession;
            _bus            = bus;
            _session        = session;
        }
 public void GetAudioBufferStats(ISpotifySession session, out AudioBufferStats stats)
 {
     stats.samples = _soundOutput.GetSamplesInBufferCount() / 2;
     stats.stutter = 0;
 }
 public void CredentialsBlobUpdated(ISpotifySession session, string blob)
 {
     Log.Debug("CredentialsBlobUpdated");
 }
 public void ConnectionError(ISpotifySession session, SpotifyError error)
 {
     Log.Debug("ConnectionError");
 }
 public void StreamingError(ISpotifySession session, SpotifyError error)
 {
     Log.Debug("StreamingError");
 }
 public void ScrobbleError(ISpotifySession session, SpotifyError error)
 {
     Log.Debug("ScrobbleError");
 }
 public void PlayTokenLost(ISpotifySession session)
 {
     Log.Debug("PlayTokenLost");
 }
 public void NotifyMainThread(ISpotifySession session)
 {
     Log.Debug("NotifyMainThread");
     _bus.PublishAsync(new NotifyMainThreadEvent());
 }
 public void CredentialsBlobUpdated(ISpotifySession session, string blob)
 {
     Log.Debug("CredentialsBlobUpdated");
 }
 public void ConnectionError(ISpotifySession session, SpotifyError error)
 {
     Log.Debug("ConnectionError");
 }
 public void MessageToUser(ISpotifySession session, string message)
 {
     Log.Debug("MessageToUser");
 }
 public void MetadataUpdated(ISpotifySession session)
 {
     Log.Debug("MetadataUpdated");
 }
        public void LoggedOut(ISpotifySession session)
        {
            Log.Debug("LoggedOut");

            _bus.PublishAsync(new LoggedOutEvent());
        }
 public void ConnectionstateUpdated(ISpotifySession session)
 {
     Log.Debug("ConnectionstateUpdated");
 }
        public void LoggedOut(ISpotifySession session)
        {
            Log.Debug("LoggedOut");

            _bus.PublishAsync(new LoggedOutEvent());
        }
 public void PlayTokenLost(ISpotifySession session)
 {
     Log.Debug("PlayTokenLost");
 }
 public void MessageToUser(ISpotifySession session, string message)
 {
     Log.Debug("MessageToUser");
 }
 public void LogMessage(ISpotifySession session, string data)
 {
     _spotifyLogProcessor.Log(data);
 }
 public void PrivateSessionModeChanged(ISpotifySession session, bool is_private)
 {
     Log.Debug("PrivateSessionModeChanged");
 }
 public void OfflineError(ISpotifySession session, SpotifyError error)
 {
     Log.Debug("OfflineError");
 }
 public void PrivateSessionModeChanged(ISpotifySession session, bool is_private)
 {
     Log.Debug("PrivateSessionModeChanged");
 }
 public void OfflineStatusUpdated(ISpotifySession session)
 {
     Log.Debug("OfflineStatusUpdated");
 }
 public void StopPlayback(ISpotifySession session)
 {
     Log.Debug("StopPlayback");
 }
 public void GetAudioBufferStats(ISpotifySession session, out AudioBufferStats stats)
 {
     stats.samples = _soundOutput.GetSamplesInBufferCount() / 2;
     stats.stutter = 0;
 }
 public void UserinfoUpdated(ISpotifySession session)
 {
     Log.Debug("UserinfoUpdated");
 }
 public void StreamingError(ISpotifySession session, SpotifyError error)
 {
     Log.Debug("StreamingError");
 }
 public void ConnectionstateUpdated(ISpotifySession session)
 {
     Log.Debug("ConnectionstateUpdated");
 }
 public void StopPlayback(ISpotifySession session)
 {
     Log.Debug("StopPlayback");
 }
 public void EndOfTrack(ISpotifySession session)
 {
     Log.Debug("EndOfTrack");
     _bus.PublishAsync(new TrackFinishedEvent());
 }
        public int MusicDelivery(ISpotifySession session, AudioFormat format, IntPtr frames, int num_frames)
        {
            if (num_frames == 0)
            {
                return 0;
            }

            _soundOutput.AddSamples(frames, num_frames);

            return num_frames;
        }
 public void UserinfoUpdated(ISpotifySession session)
 {
     Log.Debug("UserinfoUpdated");
 }
 public void NotifyMainThread(ISpotifySession session)
 {
     Log.Debug("NotifyMainThread");
     _bus.PublishAsync(new NotifyMainThreadEvent());
 }
 public void LogMessage(ISpotifySession session, string data)
 {
     _spotifyLogProcessor.Log(data);
 }
 public void OfflineError(ISpotifySession session, SpotifyError error)
 {
     Log.Debug("OfflineError");
 }
 public void MetadataUpdated(ISpotifySession session)
 {
     Log.Debug("MetadataUpdated");
 }
 public void OfflineStatusUpdated(ISpotifySession session)
 {
     Log.Debug("OfflineStatusUpdated");
 }
 public void EndOfTrack(ISpotifySession session)
 {
     Log.Debug("EndOfTrack");
     _bus.PublishAsync(new TrackFinishedEvent());
 }
 public void ScrobbleError(ISpotifySession session, SpotifyError error)
 {
     Log.Debug("ScrobbleError");
 }