Home Download Screenshots Wiki Plugins Translations Developers Donate Forums/Help Contact Us |
StrokeIt
Volume.lua 0.1a for StrokeIt Enhanced - Increase/Decrease system volumePosted by Scott
Here is the first release of the first Lua script for the enhanced version of StrokeIt, volume.lua
From the source: -- Description: StrokeIt Lua script to change the system's wave out -- volume. This is designed to be called from an action which is triggered -- by two gestures. -- -- By example, the default configuration is for the mouse wheel. -- One action will be triggered by the gestures WHEEL_DOWN *AND* WHEEL_UP -- The script differentiates between the two and does the "right thing" Get it here: http://sdbarker.com/software/silua/volume.lua Notes: * This is only tested in Win2k3 Server * This requires the Alien lua libraries available at: http://alien.luaforge.net/
Hello Scott,
Nice to see you here :). works for me better with this one 37 require[[Alien/alien]] 80 local params = string.format([["%s" %d %d "%s" %d %d %d "%s" %s"]], volpercents, 500, 96, "Arial", 0, 255, 0, "2", "2") 81 plugin.call("utilities","Delay", "100") smoother draw :) 82 plugin.call("osd", "osd", params) works fine for me now Thank you very much -Leo
Looks great! Nice to see you back on the forums, Scott :)
For even more fun, I bet somebody clever could adapt this into a version that adjusts volume based on the size of the gesture, maybe assign it to "Up" so when you draw a vertical line that's 50% of the screen height, the volume would be set to 50%. You can get the height of the gesture with gesture.rect() and alien should be able to call GetSystemMetrics to get the screen height. I like how you've come up with a way to re-use the same script for multiple commands, but I think asking users to edit the script file is a little much; I'll look into creating a method of passing parameters to scripts. -- Jeff
It's great to be back!
I like the up / calculate the volume idea. And I need to fix the math for calculating the volume across both channels, since that's pretty broken right now. I agree, asking folks to edit the script is kind of a pain. But they won't have to if they configure it how I told them to. :) I'll try and think of something else that would be reasonable as well.
Strange, but somehow it fails to work for me. It shows the percentage in upper right corner it even changes when I wheel up or down but the volume does not change at all. Reason unknown. Any ideas?
By the way, is there an (alien or any other) function that returns the contents of the clipboard into a string? The only reference I found on different forums mentioned that he had to build a dll for this purpose but the link was broken and I would not spend my spare time writing one. Not that I happen to have any spare time at the moment :(
It is a Vista Business 64bit. That may be the problem, but I don't know why there are not any error messages since it seems it works normally. It calls all the functions and returns without crashing. The only thing it does not is to alter volume settings :D
Thanks for the link, Scott. So far it looks like I will end up in writing a dll after all :( Something that I wanted to avoid. Well, we cannot get everything we want, can we?
Yeah, Vista and up use a different method for altering the volume I think. I'll look in to it, but no promises.
It's more of a proof of concept and example for others than anything else. As for writing a DLL, it's good for you. :) gemisigo Wrote: ------------------------------------------------------- > It is a Vista Business 64bit. That may be the > problem, but I don't know why there are not any > error messages since it seems it works normally. > It calls all the functions and returns without > crashing. The only thing it does not is to alter > volume settings :D > > Thanks for the link, Scott. So far it looks like I > will end up in writing a dll after all :( > Something that I wanted to avoid. Well, we cannot > get everything we want, can we? |