Mediabrowser and Thumbnail of album covers

stefanoa

Active Member
Licensed User
Longtime User
i've read great tutorial of Informatix "How they do... #2" because for my app "YouMediaPlayer" i need to display image of album art (album covers) next to each song or the album list (as in this tutorial)..

i use this method to load files with mediabrowser:
B4X:
Dim MB As MediaBrowser
   Dim m As Map
   m = MB.GetMediaAudioList(True, "artist COLLATE UNICODE, title COLLATE UNICODE" )

   For i = 0 To (m.Size / 9) - 1
             ........
             Artist = m.Get("Artist" & i)
             Album = m.Get("Album" & i)
             Location = m.Get("Location" & i)
             ....
     next

now i'm studying the example, but i don't know how retrieve picture path and filename (coverdir e coverFile in your tutorial):
B4X:
lstAlbums.AddThumbnail(LoadBitmapSample(CoverDir, CoverFile, lstAlbums.SizeInGrid, lstAlbums.SizeInGrid), i)

i need to create a specific folder for the albums images ?
and what method i've to use to connect the single image (of album) with song file and then retrieve them?
:confused:
thanks
 

Informatix

Expert
Licensed User
Longtime User
The lack of information in the tutorial on this subject is voluntary because that's not related to the UI. It's the machinery behind the scene. And this machinery, very simple in my project, is probably of no use in a real project. I think it is not worth publishing it as is. I don't read covers embedded in MP3 for example.
But here are some leads:
- most of MP3 players look into the folders containing the music files to find a image; if they find one they assume it is the artwork file
- some others are connected to a database on the net (or a search engine) to retrieve these information
- they also read the artwork embedded in the music files
- some of them offer to select images on the card to bind them to music files (e.g. to populate the pictures list of artists)
Once you get the informations, you have to save them somewhere (a cache folder) where they are stored with the right size, the right format.
 
Upvote 0
Top