Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #4
0
 public Track LoadNonLibraryTrack(string filename)
 {
     return(TrackHelper.LoadTrack(filename));
 }