Exemple #1
0
        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);
        }
Exemple #2
0
        /// <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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 /// <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));
 }
Exemple #5
0
 public bool SaveNonLibraryTrack(Track track)
 {
     return(TrackHelper.SaveTrack(track));
 }
Exemple #6
0
 public Track LoadNonLibraryTrack(string filename)
 {
     return(TrackHelper.LoadTrack(filename));
 }
Exemple #7
0
 public void SetRank(List <Track> tracks, int rank)
 {
     TrackHelper.SetRank(tracks, rank);
 }