History log of /haiku/src/apps/mediaplayer/playlist/PlaylistItem.h
Revision Date Author Comments
# ba6a1df4 16-Oct-2021 Kacper Kasper <kacperkasper@gmail.com>

MediaPlayer: cache file duration in memory

* SetAttribute() will fail for read-only volumes.
* Duration() is called in playlist's Draw() method.
Since _CalculateDuration() is very expensive because it parses
file metadata, it causes visible drawing glitches and playlist is
almost unusable.
* Mitigates #15221. I don't consider this a fix because first draw
is still going to block for a long time, but at least scrolling
works smoothly now. Ideally, file metadata would be parsed
asynchronously in a separate thread and drawn as it becomes
available.

Change-Id: If198d61c77a7746bcc0e19b7caeed89ce829c247
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4597
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 3248de3d 10-Jul-2018 Julien Lepiller <julien@lepiller.eu>

Mediaplayer: remember position and volume

Change-Id: I43fa7cbcedd39c39e4b136e9e1f9bb34bf3eb570


# 70efd0db 29-Jun-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

MediaPlayer: Avoid to recreate the supplier more than needed

* MediaPlayer attempted to recreate each time the media supplier(s),
and implictly it recreated also the BMediaFile. This works fine with
local data that can be accessed fastly, but makes lots of troubles
with network streams such as BMediaIO. The result of this was that
the Streamer plugin has been recreated each time having memory and
network wasted other than performances.
* I tried to keep intact the previous logic, and it looks OK for me,
this has been done by moving out of the Controller the ownership of
the TrackSupplier and adding a little utility class that do the
releasing job previously done by the ObjectDeleter.
* Reviews are appreciated.


# b5387eff 06-Jan-2016 Markus Himmel <markus@himmel-villmar.de>

MediaPlayer: Show individual track length in playlist window

Signed-off-by: Dario Casalinuovo <b.vitruvio@gmail.com>


# 1c68b67a 04-Jan-2016 Markus Himmel <markus@himmel-villmar.de>

MediaPlayer: Show total playlist length

Signed-off-by: Dario Casalinuovo <b.vitruvio@gmail.com>


# f70b711f 18-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Flesh out attribute support in PlaylistItem/FilePlaylistItem
some more.
* Finish refactoring and abstracting BMediaFile/BMediaTrack
out of the Controller. There is TrackSupplier now and
MediaFileTrackSupplier. One could now implement another
PlaylistItem class besides FilePlaylistItem, which provides
other implementations for TrackSupplier (i.e. for testing
DVD playback).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38722 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e663610e 18-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

* Made opening playlist items asynchronous (in the Controller thread).
* Resolved TODO: Use the existing "FileChanged" notification in the main
window to adopt the UI to the currently playing item.
* When opening a file takes some time, the window is now free to start hidden
and setup a message runner to unhide it after 150 msecs.
* When launching MediaPlayer with files, the 150 msecs delay is used to
start the window hidden and pop up right at the correct location for audio.
If opening the first audio file takes less than 150 msecs, the window will
already show as soon as possible.
* While opening a file in the Controller, the window will say so in the
disabled seek slider instead of showing the message "Drop media files here.".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34132 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c60fcc87 23-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Changed the PlaylistItem interface to be hopefully more flexible. It can
probably still be improved.
* Renamed EntryRefPlaylistItem to just FilePlaylistItem.
* Moved the "move into Trash" and "restore from Trash" implementation into
FilePlaylistItem. Also added what's needed to allow Tracker to restore the
entry itself.
* Refactored everything to make Playlist use PlaylistItems instead of
entry_refs and all that entails...
* The transition to virtualize PlaylistItems is not complete yet in the
Controller, since it still uses BMediaFile there. But it's much easier to
change that now.
* Objects which keep a PlaylistItem around do correct reference counting, but
some commands could be simplified if they were using references as well. It
still should work correctly, though, if I didn't miss anything. It should also
fix theoretical situations of encountering out-of-memory while messing with
the Playlist leading to inconsistent state between Undo/Redo and then leaking
items because of that.
* Added the discussed change that MediaPlayer checks it's own supported types
before rejecting a file by super type. (untested)
* When importing playlist items, the currently playling item is better
maintained during Undo/Redo.
* Some debugging code added in MediaTrackAudioSupplier, no functional changes.
* Fixed a number of coding style issues and automatic whitespace cleanup.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30834 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dd091096 16-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Refactor the "Remove and Put into Trash" backend a bit to allow giving it an
index and not work on the current selection only.
* Reenable the code in MainWin that implements the shortcuts to trigger this
feature during playback. Now it uses the Undo/Redo stack and profits from
existing polish.
* Add missing fPlaylist locking in MainWin at several places. Should not have
caused any realworld problems, though.
* Add Undo/Redo shortcuts to MainWin and forward to Playlist window.
* Make sure the Playlist window opens on the same workspace as the player
window. This could be seen when launching MediaPlayer on one workspace, later
moving the window and then opening the Playlist window, it would open on
the original workspace. The new behavior additionally pulls the playlist
when it's already open and you invoke the "Playlist" menu item.
* Added the beginnings of a refactoring to make the Playlist and everything
else use a PlaylistItem class, instead of entry_refs directly. This stuff is
not yet used, though, just compiles.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30776 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f70b711fe02a4aae30692678c1c7c143050bc849 18-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Flesh out attribute support in PlaylistItem/FilePlaylistItem
some more.
* Finish refactoring and abstracting BMediaFile/BMediaTrack
out of the Controller. There is TrackSupplier now and
MediaFileTrackSupplier. One could now implement another
PlaylistItem class besides FilePlaylistItem, which provides
other implementations for TrackSupplier (i.e. for testing
DVD playback).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38722 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e663610e84ed96e246aa7bb6d416bd51c1166447 18-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

* Made opening playlist items asynchronous (in the Controller thread).
* Resolved TODO: Use the existing "FileChanged" notification in the main
window to adopt the UI to the currently playing item.
* When opening a file takes some time, the window is now free to start hidden
and setup a message runner to unhide it after 150 msecs.
* When launching MediaPlayer with files, the 150 msecs delay is used to
start the window hidden and pop up right at the correct location for audio.
If opening the first audio file takes less than 150 msecs, the window will
already show as soon as possible.
* While opening a file in the Controller, the window will say so in the
disabled seek slider instead of showing the message "Drop media files here.".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34132 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c60fcc87e04b0af21ed9f01581b23d1f714a366f 23-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Changed the PlaylistItem interface to be hopefully more flexible. It can
probably still be improved.
* Renamed EntryRefPlaylistItem to just FilePlaylistItem.
* Moved the "move into Trash" and "restore from Trash" implementation into
FilePlaylistItem. Also added what's needed to allow Tracker to restore the
entry itself.
* Refactored everything to make Playlist use PlaylistItems instead of
entry_refs and all that entails...
* The transition to virtualize PlaylistItems is not complete yet in the
Controller, since it still uses BMediaFile there. But it's much easier to
change that now.
* Objects which keep a PlaylistItem around do correct reference counting, but
some commands could be simplified if they were using references as well. It
still should work correctly, though, if I didn't miss anything. It should also
fix theoretical situations of encountering out-of-memory while messing with
the Playlist leading to inconsistent state between Undo/Redo and then leaking
items because of that.
* Added the discussed change that MediaPlayer checks it's own supported types
before rejecting a file by super type. (untested)
* When importing playlist items, the currently playling item is better
maintained during Undo/Redo.
* Some debugging code added in MediaTrackAudioSupplier, no functional changes.
* Fixed a number of coding style issues and automatic whitespace cleanup.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30834 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dd09109647c709561a966752f1c2346f4f5a0e20 16-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Refactor the "Remove and Put into Trash" backend a bit to allow giving it an
index and not work on the current selection only.
* Reenable the code in MainWin that implements the shortcuts to trigger this
feature during playback. Now it uses the Undo/Redo stack and profits from
existing polish.
* Add missing fPlaylist locking in MainWin at several places. Should not have
caused any realworld problems, though.
* Add Undo/Redo shortcuts to MainWin and forward to Playlist window.
* Make sure the Playlist window opens on the same workspace as the player
window. This could be seen when launching MediaPlayer on one workspace, later
moving the window and then opening the Playlist window, it would open on
the original workspace. The new behavior additionally pulls the playlist
when it's already open and you invoke the "Playlist" menu item.
* Added the beginnings of a refactoring to make the Playlist and everything
else use a PlaylistItem class, instead of entry_refs directly. This stuff is
not yet used, though, just compiles.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30776 a95241bf-73f2-0310-859d-f6bbb57e9c96