Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Sum all previous track lengths in a column (Read 1664 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Sum all previous track lengths in a column

Hello all,

I was wondering if there was a way to add the track lengths of the playlist item from the first item up to %list_index% (playlist index of specified item) and display that information in a separate column; kind of like a for-loop of track length up to a certain item.
Motivation: see how much time has passed at the current point in the playlist without the detour of selecting all item up to the item of interest and looking at the status bar or the properties dialog.

Example:

Track  Length  Total length
01      01:00    01:00
02      01:00    02:00
03      01:00    03:00

In pseudo-Excel-notation:
length( sum(length(1) : length(%list_index%)) )

Cheers!

Sum all previous track lengths in a column

Reply #1
it's not possible to anything like this with an existing playlist but this request has come up before and i made a script for the WSH panel mod component that can display this in a separate panel. the only way you can interact is to use your mouse wheel to scroll through the entries.

component here: https://code.google.com/p/foo-wsh-panel-mod/downloads/list
you just need to add a panel to your layout and put this script in it...

https://dl.dropboxusercontent.com/u/2280132...nuary/count.txt

how to install a component: http://wiki.hydrogenaud.io/index.php?title...all_a_component
layout editing mode: http://wiki.hydrogenaud.io/index.php?title...ut_Editing_Mode

Sum all previous track lengths in a column

Reply #2
That does the job.
Unfortunately, the scrolling in the separate panel doesn't synchronize with the playlist, but it is very nice and the layout is also customizable.
Thank you very much!

One last question:
Context-specific fields, such as the variable %list_index%, are not recognized in the script?

Generic fields all do fine.
The list_index would have been great to see the corresponding lines in the playlist and the separate panel more quickly.

Sum all previous track lengths in a column

Reply #3
although %list_index% is not available, you can workaround it. replace line 63...

Code: [Select]
        gr.GdiDrawText(titles[i + offset], font, colour, 5, i * font.Height, ww - 150, wh, DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);


with

Code: [Select]
        gr.GdiDrawText(i + 1 + offset + ". " + titles[i + offset], font, colour, 5, i * font.Height, ww - 150, wh, DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);

 

Sum all previous track lengths in a column

Reply #4
Great! Thank you very much.