Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progressbar overlaps the main window of foobar2k when inf-looping feature enabled #3

Closed
CarterLi opened this issue May 20, 2015 · 5 comments

Comments

@CarterLi
Copy link

Well done on the "ThBGM Loop Forever" feature, but it should not mess the main UI of foobar2000, which looks ... really bad.
Can we reset the progressbar when the music looping? If not possible, can we let it stop at the end?

@nyfair
Copy link
Owner

nyfair commented May 20, 2015

Which UI plugin are you using?
I just checked with WSH panels progress bar and fb2k's default progress bar, both of them stop at the end.

@CarterLi
Copy link
Author

(Foobox 4)[http://tieba.baidu.com/p/3238830600?pn=1]. You may download it here:
http://pan.baidu.com/s/1kTIF6wn#path=%252Ffbx_latest_version

default

@nyfair
Copy link
Owner

nyfair commented May 22, 2015

That progress bar is controlled by JScript code, you should ask its author to fix this
FYI
http://www.fooblog2000.com/2007-02/how-to-make-a-progress-bar/

@nyfair nyfair closed this as completed May 22, 2015
@CarterLi
Copy link
Author

Althougth the url you gave me doesn't help, I managed to find out where the progress bar is painted myself.

// skin\foobox\guiext.js: 28
this.Paint = function(gr){
    if(this.Enabled){
        var progress = this.Value/(this.MaxValue - this.MinValue);
        if (progress > 1) {
            progress -= progress | 0;
        }
        var pos = (progress*this.Width)|0;
        if(fixedWidth){
            gr.DrawImage(ImgBg,this.X,this.Y,this.Width,h,0,0,ImgBg.Width,h,0);
            gr.DrawImage(ImgOverlay,this.X,this.Y,pos,h,0,0,pos,h,0);
        }
        else{
            DrawThemedBox(gr,this.X,this.Y,this.Width,h,ImgBg,paddingLeft,0,paddingRight,0);
            DrawThemedBox(gr,this.X,this.Y,pos,h,ImgOverlay,paddingLeft,0,paddingRight,0);
        }
        gr.DrawImage(ImgKnob,Math.floor(this.X+pos-(ImgKnob.Width/2)),this.Y,ImgKnob.Width,ImgKnob.Height,0,0,ImgKnob.Width,ImgKnob.Height,0);
    }
}

Simply reset the position to 0 if it exceeds 1. The code is ugly but it works...

@nyfair
Copy link
Owner

nyfair commented May 23, 2015

lol, awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants