View Single Post
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#40
Originally Posted by velox View Post
Well, qml is not a bad thing in general. Actually I think it's really nice to do user interfaces and some other things with it. Directory based media handling, for example, sadly is not one of those things*: I haven't found a nice way to query file durations (or any way at all to get file meta data like ID3), so if you open a directory, it has to open each file and hope that it's a valid format that is read within the limits of a "watchdog timeout". For large directories that's taking a while and may even trigger the systems crash handler dialog.
Basically, opening files and searching for matching covers (easter egg: you can put different jpgs named somehow similarly to the corresponding audio files in the opened directory to match them) is just a bunch of more or less dirty hacks put together.

Also: Kudos for trying to port your device!

*) I really would like someone to prove me wrong here!
Well, tbh, when I create QML apps, I create everything possible in QML. Often it's much faster to write some QML code than to mess around with the C++ integration, which is not a one-liner. Of course you can't do everything in QML.

As for the concrete case: have you tried doing that in parallel? In QML it was called a WorkerScript or so iirc. Besides, I don't think you have any other way to find out the duration than to query every file unless you use tracker or any other indexer - which you don't want.

Maybe you could use some libmediainfo or so to query the data about the files and something for querying the MIME type (ignore the file if the MIME is bad). You could use a QThread so as to make it parallel. But I guess you can't do much more with QML only.

You really should ask for details on the mailing list or IRC because I don't know which libraries are on SFOS and which not.

As for the image querying, I don't get what you mean.

Anyway, you could simply document the quirks and say: "it's simply all that I need"
If someone needs more, they can always fork and implement it themselves and don't have to mess with the boring UI stuff.

/edit: btw. libmediainfo on Arch Linux
Code:
Depends On      : curl  libmms  libzen
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following User Says Thank You to marmistrz For This Useful Post: