Help - Search - Members - Calendar
Full Version: Help Making a Sub-Progress Bar For Playback Time
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
FootageOfACop
Hello. Currently, my track display has a progress bar that simply fills bullets with color using the $progress2 function.

CODE

$progress2(%playback_time_seconds%,%length_seconds%,22,$rgb(50,50,250)●,$rgb(255,255,255)●)$rgb()$char(10)


However, I have a lot of long songs, meaning that a new bullet is sometimes only filled less than once a minute. I want to implement an additional progress bar for longer tracks that is below my current one that monitors how long until a new bullet is filled. So every time the new bar fills, the current one will have a new bullet and then the lower one will start over again. How can I do this? I have tried scripting it myself, but I can't seem to wrap my head around it. crying.gif

Could anyone explain how I can do this or provide me with the code? Thanks a bunch!
FootageOfACop
Thanks for the overwhelming support guys. biggrin.gif

Well, after giving it another crack last night, I finally got it to work. For those that are interested, here is the script. It might be helpful to one of you out there. Just paste it in a track display panel.

CODE

//////////////////////////////////////////
//START DUAL-BAR CODE//
//////////////////////////////////////////

//Usage Notes:
//The first bar displays the overall progress of the track
//The second bar displays the progress towards filling up a single character of the first bar
//Edit the following variables to customize:

//START OF CUSTOMIZATION

//The fill color - default is $rgb(50,50,250) (blue)
$puts(fill,$rgb(50,50,250))

//The empty color - default is $rgb(255,255,255) (white)
$puts(empty,$rgb(255,255,255))

//The number of characters in the first bar - default is 22
$puts(bars,22)

//First bar character - default is ●
$puts(char1,●)

//The number of characters in the second bar - default is 25
$puts(bars2,25)

//Second bar character - default is ♦
$puts(char2,♦)

//Any song less than or equal to this length will use only one bar - default is 219
$puts(minseconds,219)

//END OF CUSTOMIZATION

$puts(length,$mul($get(bars),%length_seconds%))
$puts(played,$mul($get(bars),%playback_time_seconds%))
$ifgreater(%length_seconds%,$get(minseconds),
$progress2($div($mul($get(bars),$get(played)),$get(length)),$get(bars),$get(bars),
$get(fill)$get(char1),$get(empty)$get(char1))$rgb()$char(10)
$progress2($mod($get(played),$div($get(length),$get(bars))),$div($get(length),$get(bars)),$get(bars2),
$get(fill)$get(char2),$get(empty)$get(char2))$rgb()$char(10),
$progress2(%playback_time_seconds%,%length_seconds%,$get(bars),
$get(fill)$get(char1),$get(empty)$get(char1))$rgb()$char(10))

///////////////////////////////////////
///END DUAL-BAR CODE//
///////////////////////////////////////


You can customize how many bars and things on each bar. Just make sure you have enough room for it to display properly. And it doesn't work right unless the track is playing, either, so be sure to write your script around that fact. The code might be a little bulky, but it's the best I could do lol. Anyone with a better solution please share.

Oh, and mine is pre-configured to look best with 9-pt. Arial.

Edit: fixed page overflow.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.