示例#1
0
 private static bool ReadID3v2(IntPtr p, TAG_INFO tags)
 {
     if ((p == IntPtr.Zero) || (tags == null))
     {
         return(false);
     }
     try
     {
         tags.ResetTags();
         ID3v2Reader reader = new ID3v2Reader(p);
         while (reader.Read())
         {
             string key  = reader.GetKey();
             object obj2 = reader.GetValue();
             if ((key.Length > 0) && (obj2 is string))
             {
                 tags.EvalTagEntry(string.Format("{0}={1}", key, obj2));
             }
         }
         reader.Close();
     }
     catch
     {
         return(false);
     }
     return(true);
 }
示例#2
0
 public static string[] BASS_ChannelGetTagsID3V2(int handle)
 {
     IntPtr ptr = BASS_ChannelGetTags(handle, BASSTag.BASS_TAG_ID3V2);
     if (ptr != IntPtr.Zero)
     {
         try
         {
             ArrayList list = new ArrayList();
             ID3v2Reader reader = new ID3v2Reader(ptr);
             while (reader.Read())
             {
                 string key = reader.GetKey();
                 object obj2 = reader.GetValue();
                 if ((key.Length > 0) && (obj2 is string))
                 {
                     list.Add(string.Format("{0}={1}", key, obj2));
                 }
             }
             reader.Close();
             if (list.Count > 0)
             {
                 return (string[]) list.ToArray(typeof (string));
             }
             return null;
         }
         catch
         {
             return null;
         }
     }
     return null;
 }
示例#3
0
 private static bool ReadID3v2(IntPtr p, TAG_INFO tags)
 {
     if ((p == IntPtr.Zero) || (tags == null))
     {
         return false;
     }
     try
     {
         tags.ResetTags();
         ID3v2Reader reader = new ID3v2Reader(p);
         while (reader.Read())
         {
             string key = reader.GetKey();
             object obj2 = reader.GetValue();
             if ((key.Length > 0) && (obj2 is string))
             {
                 tags.EvalTagEntry(string.Format("{0}={1}", key, obj2));
             }
         }
         reader.Close();
     }
     catch
     {
         return false;
     }
     return true;
 }