#6564: [MediaPlayer] show duration in playlist window (easy)
----------------------------------------+----------------------------
Reporter: diver | Owner: stippi
Type: enhancement | Status: new
Priority: normal | Milestone: R1
Component: Applications/MediaPlayer | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 1 | Platform: All
----------------------------------------+----------------------------
Comment (by Barrett):
The main problem of looking for attributes is that there's not any
assurance that it's set.
For example you might add a track from a non befs volume. If that
attribute is available, this is good but I'll propose another solution in
the general case.
One possible solution you can look is to create a temporary BMediaFile
before to add the track to the playlist, once a (set of) track(s) have to
be processed, you will use BMediaFile::SetTo() to reset that BMediaFile to
your specific entry_ref each time. You can then cache this value (by
adding an attribute to the class) so that you don't have to build/delete
the TrackSupplier(s) which is expensive. Also CreateTrackSupplier() is
doing something similar but this way you can optimize that operation.
--
Ticket URL: <https://dev.haiku-os.org/ticket/6564#comment:8>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.