Logo Search packages:      
Sourcecode: libmpdclient version File versions  Download package

mpd_pure const char* mpd_song_get_tag ( const struct mpd_song song,
enum mpd_tag_type  type,
unsigned  idx 

Queries a tag value.

song the song object
type the tag type
idx pass 0 to get the first value for this tag type. This argument may be used to iterate all values, until this function returns NULL
the tag value, or NULL if this tag type (or this index) does not exist

Definition at line 268 of file song.c.

References mpd_song_get_tag(), and mpd_song::tags.

Referenced by mpd_song_get_tag().

      const struct mpd_tag_value *tag = &song->tags[type];

      if ((int)type < 0)
            return NULL;

      if (tag->value == NULL)
            return NULL;

      while (idx-- > 0) {
            tag = tag->next;
            if (tag == NULL)
                  return NULL;

      return tag->value;

Generated by  Doxygen 1.6.0   Back to index