Rockbox mail archiveSubject: Re: Implementing a search feature
Re: Implementing a search feature
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 8 May 2003 16:58:52 +0200 (CEST)
On Thu, 8 May 2003, Boris Maras wrote:
> My first idea was to get rid of those .idx files, and search directly in
> the directories. I was told it would be too slow
If you implement it, you'll notice. Someone did it before, and it could take
a really long time to find certain songs. There are 80GB disks available now.
Doing a casual estimatate, at least 14000 songs could fit on it...
> As there's already a feature that creates a playlist with all the mp3s of
> the hard-disk, I thought it would be a better idea to search inside this
> playlist (and use it as a kind of index file). In fact, the .idx files seem
> to have the same structure as m3u files, except that there aren't any
> commented lines (beginning with #)
> This is already done : I added an "onplay" option on .m3u files that
> launches the search feature. You type your search string and then it creates
> a new m3u with the matching results
I like that approach.
> Anyway, there seems to be a flaw in the search algorithm (sometimes it gives
> me mp3s that do not match). And I don't manage to find where. So I was
> thinking of re-coding it.
> I was told to implement a Boyer-Moore algorithm, and found several examples
> of implementation on the web.
Boyer-Moore is a killer-algorithm for searching for a string within a huge
text. Such as this case. It surely beats comparing every single byte in the
> 1- Do you have any other ideas/suggestions about making a search feature?
You can be sure people will want to be able to search in the ID3 tags as
well, so it would cool if the .idx file format had support for it.
> 2- As I'm a newby, I would need a kind of "debug" mode : how could I do? I
> did not manage to compile the win32 simulator : would it help me? I also
> found in the code some "//fprintf(stderr ..." : is there a way to see the
> stderr on the jukebox?
I would recommend that you work harder on getting the simulator to work. It
makes everything much easier to develop and debug. No, there's no stderr on
target unless you do the gdb-mod.
> - being able to handle the id3 tags. I think it would be too slow to read
> them for each file.
The search feature will always be best if the .idx file was generated
properly by the host-PC when Archos was connected on USB.
-- Daniel Stenberg -- http://rockbox.haxx.se/ -- http://daniel.haxx.se/Received on 2003-05-08