PDA

View Full Version : wheel mouse


mikekantor
20th November 2001, 06:11
On the current Winamp, it is possible to control the volume from the wheel that so many of us have on our mice.

How will this be implemented in WA3? Will it be a special mouse event just for that, or will every script need to include an event for when the volume changes in order to adjust whatever represents the volume graphically?

jakov.sosic
20th November 2001, 14:13
That's the same q. I want to know.
You can control graphics by System.onVolumeChanged event,
but still I would need a different approach....
That's one of the reasons I can't implement mute function into my skins the way I want to.

Lucas
20th November 2001, 15:19
I really could answer this question, but that would make me repeat again what I told jakov a million times already. Guys, go read the FAQ, there's a huge chunk of code there that will make your life SO MUCH easier. And if you use it wisely you won't even have to understand how it works, all you need is an include and some copy/paste of code.

-L

jakov.sosic
20th November 2001, 17:45
Well don't be mad Lucas....
OK, I'll go and read Faq...
:)

mikekantor
20th November 2001, 18:43
The first thing I did when I tried to create a display for volume is use that demoskin. For some reason it didn't work for me... plus I didn't get the point for that whole grayscale png... whatever.

I ended up writing my own, works great, doesn't use the grayscale thing, and even does some extra stuff that I needed.

I guess I'll just have to put System.onVolumeChanged into my script and hope for the best.

jakov.sosic
20th November 2001, 19:47
I programed my volume knob almost perfectly...
I even succedeed to disable jump from 0 to 100% and form 100 to 0, but not by map as Lucas suggested, but by program code...
Here is code lucas:

updateVolume(float v) {

int g = (v / 255) * 24;

if (ch<10){
if ((ch+127.5)>v){
VolumeLayer.gotoFrame(g);
System.setVolume(v); ch = v;
}
}
else if (ch>245){
if ((ch-127.5)<v){
VolumeLayer.gotoFrame(g);
System.setVolume(v); ch = v;
}
}
else {
VolumeLayer.gotoFrame(g);
System.setVolume(v);
ch = v;
}
}


CH is integer that has starting volume value when skin loads by initVolume function (ch=system.getVolume)...
Very simple, and I used idea from Probe's knob.....