|
|
#1 |
|
Junior Member
|
Volume Lock
Has anyone written a script that locks volume (not only a slider as slider.lock() does) for example when mouse is not upon Winamp window? I tried this, but it locks volume so safely that I couldn't change it at all:
shbutton.onLeaveArea() { shvol.lock(); oldvol = system.getVolume(); } system.onVolumeChanged(int newvol) { int x; int y; if (shbutton.isMouseOver(x, y)!=0) System.setVolume(newvol); else System.setVolume(oldvol); } I'm not really a programmer so I'm looking for someones help
|
|
|
|
|
|
#2 |
|
Senior Member
|
Try to use timer. Script should remember current volume level and if one is in lock mode it should set that level. I think that it is only one possible way to prevent the volume level from changes.
|
|
|
|
|
|
#3 |
|
Senior Member
|
Блин, ты же наверное по-руÑÑки понимаешь. Короче переменную Ñоздай, в неё вÑегда заноÑи текущую громкоÑть. Как только уровень надо заблокировать, запуÑкай таймер, который вÑегда будет Ñтавить громкоÑть на блокированный уровень. Рбольше никак, никаких функций кроме GetVolume и SetVolume в MAKI-интерфейÑе нет.
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Aug 2002
Location: South Carolina
Posts: 42
|
derka derka derka?
|
|
|
|
|
|
#5 |
|
Junior Member
|
2E-Trance
СпаÑибо, попробую... P.S. понимать то Ñ Ð¸ по ихнему понимаю. пишу конечно криво
|
|
|
|
|
|
#6 |
|
Junior Member
|
Thanks to E-Trance, his idea really works. this is what i wrote now:
#include "std.mi" Global Group shgroup; Global Button shbutton; Global Slider shvol; Global Int oldvol; Global Timer voltimer; System.onScriptLoaded() { shgroup = getScriptGroup(); shbutton = shgroup.findObject("normal"); shvol = shgroup.findObject("shvol"); oldvol = system.getVolume(); voltimer = new Timer; voltimer.setDelay(10); } voltimer.onTimer() { system.setVolume(oldvol); } shbutton.onEnterArea() { shvol.unlock(); voltimer.stop(); } system.onVolumeChanged(int newvol) { int x; int y; if (shbutton.isMouseOver(x,y)) oldvol = newvol; } shbutton.onLeaveArea() { voltimer.start(); } System.onScriptUnloading() {} Anyway I'm trying to find another way to do this..... |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|