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

bool mpd_entity_feed ( struct mpd_entity entity,
const struct mpd_pair pair 
)

Parses the pair, adding its information to the specified mpd_entity object.

Returns:
true if the pair was parsed and added to the entity (or if the pair was not understood and ignored), false if this pair is the beginning of the next entity

Definition at line 175 of file entity.c.

References mpd_entity::directory, mpd_entity::info, mpd_directory_feed(), mpd_entity_feed(), MPD_ENTITY_TYPE_DIRECTORY, MPD_ENTITY_TYPE_PLAYLIST, MPD_ENTITY_TYPE_SONG, MPD_ENTITY_TYPE_UNKNOWN, mpd_playlist_feed(), mpd_song_feed(), mpd_pair::name, mpd_entity::playlistFile, mpd_entity::song, mpd_entity::type, and mpd_pair::value.

Referenced by mpd_entity_feed(), and mpd_recv_entity().

{
      assert(pair != NULL);
      assert(pair->name != NULL);
      assert(pair->value != NULL);

      if (strcmp(pair->name, "file") == 0 ||
          strcmp(pair->name, "directory") == 0 ||
          strcmp(pair->name, "playlist") == 0)
            return false;

      switch (entity->type) {
      case MPD_ENTITY_TYPE_UNKNOWN:
            break;

      case MPD_ENTITY_TYPE_DIRECTORY:
            mpd_directory_feed(entity->info.directory, pair);
            break;

      case MPD_ENTITY_TYPE_SONG:
            mpd_song_feed(entity->info.song, pair);
            break;

      case MPD_ENTITY_TYPE_PLAYLIST:
            mpd_playlist_feed(entity->info.playlistFile, pair);
            break;
      }

      return true;
}


Generated by  Doxygen 1.6.0   Back to index