Exemplo n.º 1
0
        private void HandleTag (Pad pad, TagList tag_list)
        {
            foreach (string tag in tag_list.Tags) {
                if (String.IsNullOrEmpty (tag)) {
                    continue;
                }

                if (tag_list.GetTagSize (tag) < 1) {
                    continue;
                }

                List tags = tag_list.GetTag (tag);

                foreach (object o in tags) {
                    OnTagFound (new StreamTag () { Name = tag, Value = o });
                }
            }
        }
Exemplo n.º 2
0
 private void HandleTag(TagList tag_list, string tagname)
 {
     for (uint i = 0; i < tag_list.GetTagSize (tagname); i++) {
         GLib.Value val = tag_list.GetValueIndex (tagname, i);
         OnTagFound (new StreamTag () { Name = tagname, Value = val.Val });
         val.Dispose ();
     }
 }
Exemplo n.º 3
0
public void ParseTag (out Gst.Pad pad, out TagList tags) {
  if (Type != MessageType.Tag)
    throw new ArgumentException ();

  IntPtr raw_ptr;
  IntPtr raw_ptr2;

  gst_message_parse_tag_full (Handle, out raw_ptr2, out raw_ptr);
  if (raw_ptr == IntPtr.Zero)
    tags = null;
  else
    tags = (TagList) Gst.GLib.Opaque.GetOpaque (raw_ptr, typeof (TagList), true);
  if (raw_ptr2 == IntPtr.Zero)
    pad = null;
  else
    pad = (Gst.Pad) Gst.GLib.Object.GetObject (raw_ptr2, true);
}
Exemplo n.º 4
0
        private TagList MakeTagList(TrackInfo track)
        {
            TagList tags = new TagList ();

            tags.Add (TagMergeMode.Replace, CommonTags.Artist, track.ArtistName);
            tags.Add (TagMergeMode.Replace, CommonTags.Album, track.AlbumTitle);
            tags.Add (TagMergeMode.Replace, CommonTags.Title, track.TrackTitle);
            tags.Add (TagMergeMode.Replace, CommonTags.Genre, track.Genre);

            tags.Add (TagMergeMode.Replace, CommonTags.TrackNumber, (uint)track.TrackNumber);
            tags.Add (TagMergeMode.Replace, CommonTags.TrackCount, (uint)track.TrackCount);
            tags.Add (TagMergeMode.Replace, CommonTags.AlbumDiscNumber, (uint)track.DiscNumber);
            tags.Add (TagMergeMode.Replace, CommonTags.AlbumDiscCount, (uint)track.DiscCount);

            tags.Add (TagMergeMode.Replace, CommonTags.Date, track.Year);
            tags.Add (TagMergeMode.Replace, CommonTags.Date, track.ReleaseDate);

            tags.Add (TagMergeMode.Replace, CommonTags.Composer, track.Composer);
            tags.Add (TagMergeMode.Replace, CommonTags.Copyright, track.Copyright);
            tags.Add (TagMergeMode.Replace, CommonTags.Comment, track.Comment);

            tags.Add (TagMergeMode.Replace, CommonTags.MusicBrainzTrackId, track.MusicBrainzId);
            tags.Add (TagMergeMode.Replace, CommonTags.MusicBrainzArtistId, track.ArtistMusicBrainzId);
            tags.Add (TagMergeMode.Replace, CommonTags.MusicBrainzAlbumId, track.AlbumMusicBrainzId);

            return tags;
        }
Exemplo n.º 5
0
public static Message NewTag (Gst.Object src, Gst.Pad pad, TagList tags) {
  Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_tag_full (src.Handle, pad.Handle, gst_tag_list_copy (tags.Handle)), true);

  return msg;
}