Posted by member 12025 on 2004-08-25 00:25:27 link
Use a timer and xLabel to get the current position. One label for the slider, one for the bar you slide. When moving it, you remove the X coord and borders and all of the label(s) it is hooked into, and get the X you want (subtract from %{mousex}, which can be reverse-engineered to a position in the song, to within rounding and truncation errors, since everything in LS likes to deal with integers at every step.
(Time*SliderWidth)/TotalTime = X coordinate of the center of the bar. On left-button-down, start a new timer that checks the x position and does the sliding (visually) and changing of position in the song. Say evern 25ms. On label-leave of the label the bar is hooked into, the 25ms timer stops, or on left-button-up.
This would basically allow for most of the functionality of LSSlider, but without being tied down to the dimensions of an image. My current dynamp buttons are magic pink labels with text in the middle, and then the label they are in has mouse click regions for the buttons. Any size at all. LSXCommand...any size at all. LSSlider...the size of the current bitmap image. But if I can only get it to +/-5 seconds, I may as well alt-tab and use the program's progress bar, since it would be much more accurate.
(Time*SliderWidth)/TotalTime = X coordinate of the center of the bar. On left-button-down, start a new timer that checks the x position and does the sliding (visually) and changing of position in the song. Say evern 25ms. On label-leave of the label the bar is hooked into, the 25ms timer stops, or on left-button-up.
This would basically allow for most of the functionality of LSSlider, but without being tied down to the dimensions of an image. My current dynamp buttons are magic pink labels with text in the middle, and then the label they are in has mouse click regions for the buttons. Any size at all. LSXCommand...any size at all. LSSlider...the size of the current bitmap image. But if I can only get it to +/-5 seconds, I may as well alt-tab and use the program's progress bar, since it would be much more accurate.