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

MTP::GenericObject *const MtpDevice::find ( count_t  in_id,
MtpObjectType  in_type 
) const [private]

Private function that performs a search on a specific object mapping Since MTP defines a protocol that crosslinks files with tracks, playlists, albums.

Parameters:
in_id the id of the requested crosslinked object
in_type the type of the requested crosslinked object
Returns:
the requested associated object, or NULL for invalid types or inconclusive searches

Definition at line 1016 of file MtpDevice.cpp.

Referenced by createFileStructure(), createFolderStructure(), and createTrackBasedStructures().

{
  switch(in_type)
  {
    case MtpTrack:
    {
      TrackMap::const_iterator iter = _trackMap.find(in_id);
      TrackMap::const_iterator iterEnd = _trackMap.end();
      if(iterEnd == iter)
        return NULL;
      else
        return iter->second;

    }
    case MtpFile:
    {
      FileMap::const_iterator iter = _fileMap.find(in_id);
      FileMap::const_iterator iterEnd = _fileMap.end();
      if(iterEnd == iter)
        return NULL;
      else
        return iter->second;
    }
    case MtpFolder:
    {
      FolderMap::const_iterator iter = _folderMap.find(in_id);
      FolderMap::const_iterator iterEnd = _folderMap.end();
      if(iterEnd == iter)
        return NULL;
      else
        return iter->second;
    }
    case MtpAlbum:
    {
      AlbumMap::const_iterator iter = _albumMap.find(in_id);
      AlbumMap::const_iterator iterEnd = _albumMap.end();
      if(iterEnd == iter)
        return NULL;
      else
        return iter->second;
    }
    case MtpPlaylist:
    {
      PlaylistMap::const_iterator iter = _playlistMap.find(in_id);
      PlaylistMap::const_iterator iterEnd = _playlistMap.end();
      if(iterEnd == iter)
        return NULL;
      else
        return iter->second;
    }
    default:
      return NULL;
  }
}


Generated by  Doxygen 1.6.0   Back to index