private Track LoadNewTrack(string filename, bool updateLength = false) { var track = TrackHelper.LoadTrack(filename, updateLength); if (track == null) { return(null); } lock (Tracks) { Tracks.Add(track); } return(track); }
/// <summary> /// Reloads a track. /// </summary> /// <param name="filename">The filename.</param> /// <param name="updateLength">if set to <c>true</c> [update length].</param> /// <returns></returns> public Track LoadTrack(string filename, bool updateLength = true) { var track = GetTrackByFilename(filename); if (track == null) { track = LoadNewTrack(filename); } else { TrackHelper.LoadTrack(track, updateLength); } ShufflerHelper.LoadShufflerDetails(track); return(track); }
private void ImportExternalShufflerTrack(string file, string externalFolder) { var externalTrack = TrackHelper.LoadTrack(file, false); var isShufflerFile = ExtenedAttributesHelper.HasExtendedAttributes(externalTrack.Description); if (!isShufflerFile) { return; } if (GetTrack(externalTrack.Artist, externalTrack.Title) != null) { return; } var newFile = CopyExternalFileToLibraryFolder(file, externalFolder); LoadTrack(newFile); }
/// <summary> /// Saves a track. /// </summary> /// <param name="track">The track.</param> /// <param name="updateAxillaryFiles">If set to true, update axillary files.</param> /// <returns></returns> public bool SaveTrack(Track track, bool updateAxillaryFiles = true) { return(TrackHelper.SaveTrack(track) && TrackHelper.RenameTrack(track)); }
public bool SaveNonLibraryTrack(Track track) { return(TrackHelper.SaveTrack(track)); }
public Track LoadNonLibraryTrack(string filename) { return(TrackHelper.LoadTrack(filename)); }
public void SetRank(List <Track> tracks, int rank) { TrackHelper.SetRank(tracks, rank); }