Logo Search packages:      
Sourcecode: taglib-sharp version File versions


    copyright            : (C) 2005-2007 by Brian Nickel
    email                : brian.nickel@gmail.com
    based on             : id3v1genres.cpp from TagLib

 *   This library is free software; you can redistribute it and/or modify  *
 *   it  under the terms of the GNU Lesser General Public License version  *
 *   2.1 as published by the Free Software Foundation.                     *
 *                                                                         *
 *   This library is distributed in the hope that it will be useful, but   *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   Lesser General Public License for more details.                       *
 *                                                                         *
 *   You should have received a copy of the GNU Lesser General Public      *
 *   License along with this library; if not, write to the Free Software   *
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
 *   USA                                                                   *

using System.Collections;
using System;

namespace TagLib
   public static class Genres
      private static readonly string [] audio = {
         "Classic Rock",
         "New Age",
         "Death Metal",
         "Sound Clip",
         "Alternative Rock",
         "Instrumental Pop",
         "Instrumental Rock",
         "Southern Rock",
         "Top 40",
         "Christian Rap",
         "Native American",
         "New Wave",
         "Acid Punk",
         "Acid Jazz",
         "Rock & Roll",
         "Hard Rock",
         "National Folk",
         "Gothic Rock",
         "Progressive Rock",
         "Psychedelic Rock",
         "Symphonic Rock",
         "Slow Rock",
         "Big Band",
         "Easy Listening",
         "Chamber Music",
         "Booty Bass",
         "Porn Groove",
         "Slow Jam",
         "Power Ballad",
         "Rhythmic Soul",
         "Punk Rock",
         "Drum Solo",
         "A Cappella",
         "Dance Hall",
         "Drum & Bass",
         "Polsk Punk",
         "Christian Gangsta Rap",
         "Heavy Metal",
         "Black Metal",
         "Contemporary Christian",
         "Christian Rock",
         "Thrash Metal",
      private static readonly string [] video = new string []
         "Extremal Sport",
         "Military & War",
         "Music Video",
         "Political Satire",
         "Popular Science",
         "Psychological Thriller",
         "Science Fiction",
         "Scifi Action",
      public static string [] Audio
            return (string []) audio.Clone ();
      public static string [] Video
            return (string []) video.Clone ();
      public static byte AudioToIndex (string name)
         for (byte i = 0; i < audio.Length; i ++)
            if (name == audio [i])
               return i;
         return 255;
      public static string IndexToAudio (byte index)
         return (index < audio.Length) ? audio [index] : null;
      public static string IndexToAudio (string text)
         return IndexToAudio (StringToByte (text));
      public static byte VideoToIndex (string name)
         for (byte i = 0; i < video.Length; i ++)
            if (name == video [i])
               return i;
         return 255;
      public static string IndexToVideo (byte index)
         return (index < video.Length) ? video [index] : null;
      public static string IndexToVideo (string text)
         return IndexToVideo (StringToByte (text));
      private static byte StringToByte (string text)
         byte value;
         int last_pos;
         if (text != null && text.Length > 2 && text [0] == '(' && (last_pos = text.IndexOf (')')) != -1 && 
             byte.TryParse (text.Substring (1, last_pos - 1), out value))
            return value;
         if (text != null && byte.TryParse (text, out value))
            return value;
         return 255;

Generated by  Doxygen 1.6.0   Back to index