Total playlist time & total remaining time

Bug #136141 reported by Adam Olsen
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Wishlist
Mathias Brodala

Bug Description

The title essentially says it all - I think it would be quite useful to display the total duration of a playlist, and the remaining time if it is played sequentially. This could be added to the statusbar (perhaps left justified), or directly below the playlist, right justified.

This can probably be done through the plugin system, but I think an implementation in main would be better. A plugin would be overkill, and would likely require events like PlaylistUpdated and EverySecond (for time remaining). I'd code it myself, but this is probably a quickie for one intimately familiar with the project.

Thanks!

This ticket was migrated from the old trac: re #680

Related branches

Revision history for this message
J.M. Hardin (jmhardin) wrote :

Yes, PLEASE! I often set up a playlist so use as music to go to sleep by and I often wish I could see how much music time I've programmed to see if I've added enough (sometimes it takes me some time to find the sandman) or way too much time (I'm a night owl but sometimes need to get up early and don't want my playlist still running when my alarm goes off).

Changed in exaile:
importance: Undecided → Wishlist
importance: Wishlist → Undecided
reacocard (reacocard)
Changed in exaile:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Florian Demmer (fdemmer) wrote :

i hacked together a "total duration of playlist" and a "duration of currently selected tracks" for the statusbar... had to add a "tracks_selected" event to xlgui/playlist.py for the latter. i guess it could be quite easily extended to also include "duration from currently playing track to end of playlist".

it looks like shown in the attachment...
- it does not seem to affect performance much to loop through playlists to sum up the track duration.
- i used the datetime module to format the duration integer to hh:mm:ss
- the "tracks_selected" event "throws" for each mouse button down

i am however not sure if the whole thing is a good idea. i think it would be better to add this as a plugin that allows customizing of the information shown in the statusbar not hard coded.

Revision history for this message
Florian Demmer (fdemmer) wrote :

i made this a plugin for 0.3.1+ now... attached the exz file.

it has a configuration tab to set a string with tags for a number of "counters":
{t} number of tracks in current playlist
{d} duration of tracks in current playlist
{ts} number of selected tracks
{ds} duration of all selected tracks
{tq} number of tracks in queue
{dq} duration of all tracks in queue
{tc} number of tracks in collection

i find the queue duration especially useful.

the plugin does however need the following patch too to work for the new event when one or more tracks get selected in a playlist. please let me know if something like that events already exists or should be implemented differently.

=== modified file 'xlgui/playlist.py'
--- xlgui/playlist.py 2009-10-27 17:56:58 +0000
+++ xlgui/playlist.py 2009-11-07 22:22:13 +0000
@@ -175,5 +175,6 @@
     def selection_changed(self):
         tracks = self.get_selected_tracks()
         self.builder.get_object('track_properties_item').set_sensitive(bool(tracks))
+ event.log_event('tracks_selected', self, tracks)

     def on_stop_track(self, event, queue, stop_track):

Revision history for this message
Florian Demmer (fdemmer) wrote :

here's also a screenshot demonstrating the looks and the plethora of information

Revision history for this message
Florian Demmer (fdemmer) wrote :

fixed something... importing the exz file now works.

Revision history for this message
Thangalin (thangalin-deactivatedaccount) wrote :

Was looking for this feature! Thanks for writing it.

Revision history for this message
John Barnes (jcb7385) wrote :

Using Exaile 3.1.1 and this plugin gives the error "'Track' object has no attribute 'get_duration'" and won't initialize.

Revision history for this message
Florian Demmer (fdemmer) wrote :

"they" changes stuff... the attached updated version should work.

Revision history for this message
Florian Demmer (fdemmer) wrote :

"they" changed stuff... the attached, updated version should work.

Revision history for this message
Florian Demmer (fdemmer) wrote :

fixed the preferences panel too now and added the plugin to my 0.3.x branch:
http://bazaar.launchpad.net/~fdemmer/exaile/0.3.x/files/head:/plugins/statusbar

Revision history for this message
migash.r (migash-r) wrote :

Hi Florian,
I've tried installing the plugin, but I get an error:

Could not enable plugin:
No module named prefs

Are there any dependencies I might be missing, or does it only work on some development version of Exaile?
I'm running Exaile 0.3.1.1 from the official Ubuntu repositories.

Revision history for this message
Mathias Brodala (mathbr) wrote :

Fixed with r3455 for the status bar and r3463 for the progress bar.

Changed in exaile:
assignee: nobody → Mathias Brodala (mathbr)
milestone: none → 0.3.3
status: Triaged → Fix Committed
Revision history for this message
Lasse Seebeck (ihez) wrote :

I'm running Exaile 3.2.2. and get
this message when I try to activate/enable the status bar plugin 0.1.1.

'module' object has no attribute '_SETTINGSMANAGER'

What's wring here?

Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.