Beispiel #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is RPMusicGenre))
            {
                return(false);
            }

            RPMusicGenre objGenre = (RPMusicGenre)obj;

            return(this.GetHashCode() == objGenre.GetHashCode());
        }
Beispiel #2
0
        public List<RPMusicGenre> GetAllGenres()
        {
            if (!Settings.Default.EnableMusicLibrary) return new List<RPMusicGenre>();

            WindowsMediaPlayer WMPlayer = new WindowsMediaPlayer();
            List<RPMusicGenre> output = new List<RPMusicGenre>();

            IWMPStringCollection scGenres = WMPlayer.mediaCollection.getAttributeStringCollection("Genre", "Audio");

            for (int i = 0; i < scGenres.count; i++)
            {
                RPMusicGenre genre = new RPMusicGenre(scGenres.Item(i));
                output.Add(genre);
            }

            WMPlayer.close();

            // Sort output A-Z
            CommonEPG.Comparers.RPMusicGenreTitleComparer myComparer = new CommonEPG.Comparers.RPMusicGenreTitleComparer();
            output.Sort(myComparer);

            return output;
        }