Exemplo n.º 1
0
        public static float GetReplayGain(Track Track, ReplayGainMode Type, bool FallBack)
        {
            if (Type == ReplayGainMode.Off)
            {
                return(0.0f);
            }

            switch (Type)
            {
            case ReplayGainMode.Album:
                if (!Track.HasReplayGainInfoAlbum)
                {
                    if (Track.HasReplayGainInfoTrack)
                    {
                        return(Track.ReplayGainTrack);
                    }
                    else
                    {
                        TrackWriter.LoadReplayGain(Track, BassTags.BASS_TAG_GetFromFile(Track.FilePath, true, false));
                    }
                }
                return(Track.ReplayGainAlbum);

            case ReplayGainMode.Track:
                if (!Track.HasReplayGainInfoTrack)
                {
                    if (Track.HasReplayGainInfoAlbum)
                    {
                        return(Track.ReplayGainAlbum);
                    }
                    else
                    {
                        TrackWriter.LoadReplayGain(Track, BassTags.BASS_TAG_GetFromFile(Track.FilePath, true, false));
                    }
                }
                return(Track.ReplayGainTrack);

            default:     // off
                return(0.0f);
            }
        }