Ejemplo n.º 1
0
        /// <summary>
        /// Set the value of a tag in the Ogg Vorbis file (THIS FUNCTION WRITES TO DISK)
        /// </summary>
        /// <param name="TagID">
        /// A <see cref="OggTags"/> indicating which tag to change
        /// </param>
        /// <param name="Value">
        /// A <see cref="System.String"/> containing the value to write
        /// </param>
        /// <returns>
        /// A <see cref="OggTagWriteCommandReturn"/> indicating the result of the operation
        /// </returns>
        public OggTagWriteCommandReturn SetQuickTag(OggTags TagID, string Value)
        {
            switch (TagID)
            {
            case OggTags.Title: m_TagLibFile.Tag.Title = Value; break;

            case OggTags.Artist: m_TagLibFile.Tag.Performers = new string[] { Value }; break;

            case OggTags.Album: m_TagLibFile.Tag.Album = Value; break;

            case OggTags.Genre: m_TagLibFile.Tag.Genres = new string[] { Value }; break;

            case OggTags.TrackNumber: m_TagLibFile.Tag.Track = uint.Parse(Value); break;

            case OggTags.Filename: return(OggTagWriteCommandReturn.ReadOnlyTag);

            case OggTags.Bitrate: return(OggTagWriteCommandReturn.ReadOnlyTag);

            case OggTags.Length: return(OggTagWriteCommandReturn.ReadOnlyTag);

            default: return(OggTagWriteCommandReturn.UnknownTag);
            }
            try { m_TagLibFile.Save(); } catch (Exception ex) { return(OggTagWriteCommandReturn.Error); }
            return(OggTagWriteCommandReturn.Success);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Retrieve the value of a Tag from the Ogg Vorbis file
        /// </summary>
        /// <param name="TagID">
        /// A <see cref="OggTags"/> indicating which tag to read
        /// </param>
        /// <returns>
        /// A <see cref="System.String"/> containing the data in the tag
        /// </returns>
        public string GetQuickTag(OggTags TagID)
        {
            switch (TagID)
            {
            case OggTags.Title: return(m_TagLibFile.Tag.Title);

            case OggTags.Artist: return(m_TagLibFile.Tag.FirstPerformer);

            case OggTags.Album: return(m_TagLibFile.Tag.Album);

            case OggTags.Genre: return(m_TagLibFile.Tag.FirstGenre);

            case OggTags.TrackNumber: return(m_TagLibFile.Tag.Track.ToString());

            case OggTags.Filename: return(m_Source.FileName);

            case OggTags.Bitrate: return(m_Bitrate.ToString());

            case OggTags.Length: return(m_LengthTime.ToString());

            default: return(null);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Converts an enumeration into a description string for display to a user
        /// </summary>
        /// <param name="oTag">
        /// An <see cref="OggTags"/> enumeration to interpret
        /// </param>
        /// <returns>
        /// A <see cref="System.String"/> containing the description
        /// </returns>
        static public string GetEnumString(OggTags oTag)
        {
            switch (oTag)
            {
            case OggTags.Album: return("Album");

            case OggTags.Artist: return("Artist");

            case OggTags.Filename: return("Filename");

            case OggTags.Genre: return("Genre");

            case OggTags.Bitrate: return("Bitrate");

            case OggTags.Length: return("Length");

            case OggTags.Title: return("Title");

            case OggTags.TrackNumber: return("Track Number");

            default: return("Unknown Tag Identity Value");
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Converts an enumeration into a description string for display to a user
 /// </summary>
 /// <param name="oTag">
 /// An <see cref="OggTags"/> enumeration to interpret
 /// </param>
 /// <returns>
 /// A <see cref="System.String"/> containing the description
 /// </returns>
 public static string GetEnumString(OggTags oTag)
 {
     switch (oTag)
     {
     case OggTags.Album: return "Album";
     case OggTags.Artist: return "Artist";
     case OggTags.Filename: return "Filename";
     case OggTags.Genre: return "Genre";
     case OggTags.Bitrate: return "Bitrate";
     case OggTags.Length: return "Length";
     case OggTags.Title: return "Title";
     case OggTags.TrackNumber: return "Track Number";
     default: return "Unknown Tag Identity Value";
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Set the value of a tag in the Ogg Vorbis file (THIS FUNCTION WRITES TO DISK)
 /// </summary>
 /// <param name="TagID">
 /// A <see cref="OggTags"/> indicating which tag to change
 /// </param>
 /// <param name="Value">
 /// A <see cref="System.String"/> containing the value to write
 /// </param>
 /// <returns>
 /// A <see cref="OggTagWriteCommandReturn"/> indicating the result of the operation
 /// </returns>
 public OggTagWriteCommandReturn SetQuickTag(OggTags TagID, string Value)
 {
     switch (TagID)
     {
     case OggTags.Title: m_TagLibFile.Tag.Title = Value; break;
     case OggTags.Artist: m_TagLibFile.Tag.Performers = new string[] { Value }; break;
     case OggTags.Album: m_TagLibFile.Tag.Album = Value; break;
     case OggTags.Genre: m_TagLibFile.Tag.Genres = new string[] { Value }; break;
     case OggTags.TrackNumber: m_TagLibFile.Tag.Track = uint.Parse(Value); break;
     case OggTags.Filename: return OggTagWriteCommandReturn.ReadOnlyTag;
     case OggTags.Bitrate: return OggTagWriteCommandReturn.ReadOnlyTag;
     case OggTags.Length: return OggTagWriteCommandReturn.ReadOnlyTag;
     default: return OggTagWriteCommandReturn.UnknownTag;
     }
     try { m_TagLibFile.Save(); } catch (Exception ex) { return OggTagWriteCommandReturn.Error; }
     return OggTagWriteCommandReturn.Success;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Retrieve the value of a Tag from the Ogg Vorbis file
 /// </summary>
 /// <param name="TagID">
 /// A <see cref="OggTags"/> indicating which tag to read
 /// </param>
 /// <returns>
 /// A <see cref="System.String"/> containing the data in the tag
 /// </returns>
 public string GetQuickTag(OggTags TagID)
 {
     switch (TagID)
     {
     case OggTags.Title: return m_TagLibFile.Tag.Title;
     case OggTags.Artist: return m_TagLibFile.Tag.FirstPerformer;
     case OggTags.Album: return m_TagLibFile.Tag.Album;
     case OggTags.Genre: return m_TagLibFile.Tag.FirstGenre;
     case OggTags.TrackNumber: return m_TagLibFile.Tag.Track.ToString();
     case OggTags.Filename: return m_Filename;
     case OggTags.Bitrate: return m_Bitrate.ToString();
     case OggTags.Length: return m_LengthTime.ToString();
     default: return null;
     }
 }
Ejemplo n.º 7
0
 public string GetQuickTag(OggTags TagID)
 {
     switch (TagID)
     {
         case OggTags.Bitrate: return m_Bitrate.ToString();
         case OggTags.Length: return m_LengthTime.ToString();
         default: return null;
     }
 }