Jump to content

Vertical progressbar fills in from top to bottom on some systems


Recommended Posts

$soundvolpb = GuiCtrlCreateProgress(390, $soundvolpbstart, 20, $soundvolpbheight, $PBS_VERTICAL)
GuiCtrlSetdata($soundvolpb, $vol)
where $vol is just a number from 0 to 100. And when it's a 0, the progressbar is full, and when it's 30, it's filled 70%... and so on, but just on a different system... not on mine.

[Edit] It seems that my friend and I had some communicational problems. What I wrote here is perfectly valid, but the title of this topic is wrong. The vertical progress bar, fills up from bottom to top after all. :) Sorry... But, the problem is, still there. I get an empty progressbar when the $vol is 100 and you can hear the volume is up to maximum.

Edited by birdofprey
Link to comment
Share on other sites

Are you sure it's 0 when you think it is? Just for debugging purposes, create a label below the control, and place the value of $vol into it whenever you set the progress.

It could be that the other machine in question is messed up. Just for reference, what is the OS that you are using, and that the other system is using?

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

Are you sure it's 0 when you think it is? Just for debugging purposes, create a label below the control, and place the value of $vol into it whenever you set the progress.

It could be that the other machine in question is messed up. Just for reference, what is the OS that you are using, and that the other system is using?

It's working perfectly on my computer. I use consolewrite for debugging purposes, and I have a tooltip in action for that interactive progressbar as well. Not to talk about the fact that same number is controlling the strength of the sound that gets manipulated in realtime. That other pc might be just messed up... with a vista pack. Mine is a "XPSP2" to say so :)

Here's my "secret code", just to be sure:

Case Else
            $cursor = GUIGetCursorInfo($mainwindow)
            IF Isarray ($cursor) and $cursor[2] = 1 then
                Switch $cursor[4]
                    Case $soundvolpb
                        $realpos = $soundvolpbheight - $cursor[1] + $soundvolpbstart
;correcting sound linearity for my tastes, this is only a 30 pixel tall bar, and I needed more control for smaller values. Not to talk about the WeberâFechner law...
;~                          ConsoleWrite ( "realpos: " & $realpos & @lf )
                        local $realprc = ($realpos/$soundvolpbheight)*10
;~                          ConsoleWrite ( "realprc: " & $realprc & @lf )
                            Select
                                case $realprc > 0.3
                                    local $correctedvol = 10*(sqrt(Exp($realprc-5.4)))
                                    $vol = int($correctedvol) + 1 
                                        ConsoleWrite ( "vol: " & $vol & @lf )
                                case $realprc <= 0.3
                                    $vol = 0
                            EndSelect
                        GuiCtrlSetdata($soundvolpb, $vol)
                        WmSetVolume($Media, $vol)
                        local $tooltip = Int($realprc*10) & " % vol: " & $vol & " %"
                        Tooltip ($tooltip)
;this is a horizontal progress bar... I can seek through the song with it. It works well on both systems.
                    Case $songprogresspb
                        If WMGetState($Media) = "Playing" or WMGetState($Media) = "Paused" Then 
                            $pbparams = ControlGetPos ('', '',  $songprogresspb)
                            $seekprocent = $cursor[0] / ($pbparams[2] /100)
                            ConsoleWrite ( WMGetState($Media) & @lf )
                            GuiCtrlSetdata($songprogresspb, $seekprocent )
                            WMSetPosition($Media, int ( $seekprocent*$medial/100 ) )
        ;~                      ConsoleWrite ( Int($seekprocent*$medial/100) & " " & $seekprocent & @lf )
                        EndIf
                EndSwitch
            Else
                Tooltip ("")
            EndIf
        EndSelect
Edited by birdofprey
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...