Ejemplo n.º 1
0
        /// <summary>
        /// Called when a playlist is removed
        /// </summary>
        void playlist_Renamed(SpotiFire.Playlist sender, PlaylistEventArgs e)
        {
            var toucheePlaylist = GetToucheePlaylist(sender);

            if (toucheePlaylist != null)
            {
                toucheePlaylist.Update(sender);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Called when an update action of a introduced playlist is started or has ended.
 /// If the playlist is in the playlist container and the update is completed,
 /// the playlist will be stored / updated.
 /// </summary>
 void playlist_UpdateInProgress(SpotiFire.Playlist sender, PlaylistEventArgs e)
 {
     lock (sender) {
         //LogPlaylist(sender, "update in progress", e);
         sender.SetUpdateInProgress(!e.UpdateComplete);
         if (this.IsInSession(sender) && e.UpdateComplete)
         {
             CreateOrUpdate(sender);
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Called when the state of a playlist changes.
 /// If the playlist is in the playlist container and fully loaded, it introduces the
 /// playlist if that has not happened before.
 /// If no pending changes are present and no update is in progress, the playlist
 /// will be stored / updated.
 /// </summary>
 void playlist_StateChanged(SpotiFire.Playlist sender, PlaylistEventArgs e)
 {
     lock (sender) {
         //LogPlaylist(sender, "state changed");
         if (this.IsInSession(sender) && sender.IsFullyLoaded())
         {
             if (!sender.IsKnown())
             {
                 Introduce(sender);
             }
             if (!sender.HasPendingChanges && !sender.IsUpdateInProgress())
             {
                 CreateOrUpdate(sender);
             }
         }
     }
 }
Ejemplo n.º 4
0
 void LogPlaylist(SpotiFire.Playlist playlist, string ev, PlaylistEventArgs e = null)
 {
     lock (this) {
         Console.WriteLine(ev.ToUpper());
         Console.WriteLine("  Playlist: " + (playlist.IsLoaded ? playlist.Name : "<unknown>"));
         Console.WriteLine("  - Loaded:             " + playlist.IsLoaded.ToString());
         Console.WriteLine("  - Known:              " + playlist.IsKnown().ToString());
         if (playlist.IsLoaded)
         {
             Console.WriteLine("  - IsCollaborative:    " + playlist.IsCollaborative.ToString());
             Console.WriteLine("  - HasPendingChanges:  " + playlist.HasPendingChanges.ToString());
             Console.WriteLine("  - IsUpdateInProgress: " + playlist.IsUpdateInProgress().ToString());
             Console.WriteLine("  - AllTracksLoaded:    " + playlist.AllTracksLoaded().ToString());
         }
         if (e != null)
         {
             Console.WriteLine("  - Update completed:   " + e.UpdateComplete.ToString());
         }
     }
 }
Ejemplo n.º 5
0
 void LogPlaylistSimple(SpotiFire.Playlist playlist, string ev, PlaylistEventArgs e = null)
 {
     lock (this) {
         Console.WriteLine("= " + ev.ToUpper() + " - " + (playlist.IsLoaded ? playlist.Name : "<unknown>"));
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Called when the image of a playlist is changed
 /// </summary>
 void playlist_ImageChanged(SpotiFire.Playlist sender, PlaylistEventArgs e)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Called when the metadata of one or more tracks of a playlist is changed.
 /// </summary>
 void playlist_MetadataUpdated(SpotiFire.Playlist sender, PlaylistEventArgs e)
 {
     //LogPlaylist(sender, "metadata updated");
 }
Ejemplo n.º 8
0
 void LogPlaylist(SpotiFire.Playlist playlist, string ev, PlaylistEventArgs e = null) {
     lock (this) {
         Console.WriteLine(ev.ToUpper());
         Console.WriteLine("  Playlist: " + (playlist.IsLoaded ? playlist.Name : "<unknown>"));
         Console.WriteLine("  - Loaded:             " + playlist.IsLoaded.ToString());
         Console.WriteLine("  - Known:              " + playlist.IsKnown().ToString());
         if (playlist.IsLoaded) {
             Console.WriteLine("  - IsCollaborative:    " + playlist.IsCollaborative.ToString());
             Console.WriteLine("  - HasPendingChanges:  " + playlist.HasPendingChanges.ToString());
             Console.WriteLine("  - IsUpdateInProgress: " + playlist.IsUpdateInProgress().ToString());
             Console.WriteLine("  - AllTracksLoaded:    " + playlist.AllTracksLoaded().ToString());
         }
         if (e != null) {
             Console.WriteLine("  - Update completed:   " + e.UpdateComplete.ToString());
         }
     }
 }
Ejemplo n.º 9
0
 void LogPlaylistSimple(SpotiFire.Playlist playlist, string ev, PlaylistEventArgs e = null) {
     lock (this) {
         Console.WriteLine("= " + ev.ToUpper() + " - " + (playlist.IsLoaded ? playlist.Name : "<unknown>"));
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Called when the image of a playlist is changed
 /// </summary>
 void playlist_ImageChanged(SpotiFire.Playlist sender, PlaylistEventArgs e) {
     throw new NotImplementedException();
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Called when a playlist is removed
 /// </summary>
 void playlist_Renamed(SpotiFire.Playlist sender, PlaylistEventArgs e) {
     var toucheePlaylist = GetToucheePlaylist(sender);
     if (toucheePlaylist != null)
         toucheePlaylist.Update(sender);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Called when the metadata of one or more tracks of a playlist is changed.
 /// </summary>
 void playlist_MetadataUpdated(SpotiFire.Playlist sender, PlaylistEventArgs e) {
     //LogPlaylist(sender, "metadata updated");
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Called when an update action of a introduced playlist is started or has ended.
 /// If the playlist is in the playlist container and the update is completed,
 /// the playlist will be stored / updated.
 /// </summary>
 void playlist_UpdateInProgress(SpotiFire.Playlist sender, PlaylistEventArgs e) {
     lock (sender) {
         //LogPlaylist(sender, "update in progress", e);
         sender.SetUpdateInProgress(!e.UpdateComplete);
         if (this.IsInSession(sender) && e.UpdateComplete)
             CreateOrUpdate(sender);
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Called when the state of a playlist changes.
 /// If the playlist is in the playlist container and fully loaded, it introduces the 
 /// playlist if that has not happened before.
 /// If no pending changes are present and no update is in progress, the playlist
 /// will be stored / updated.
 /// </summary>
 void playlist_StateChanged(SpotiFire.Playlist sender, PlaylistEventArgs e) {
     lock (sender) {
         //LogPlaylist(sender, "state changed");
         if (this.IsInSession(sender) && sender.IsFullyLoaded()) {
             if (!sender.IsKnown())
                 Introduce(sender);
             if (!sender.HasPendingChanges && !sender.IsUpdateInProgress())
                 CreateOrUpdate(sender);
         }
     }
 }