| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Fri Apr 20, 2007 2:09 pm Post subject: trackbar & volume |
|
|
Using vdsmedia.dll
MEDIA VOLUME, <control name>,<level>
Set the volume to the desired level. (Zero specifies full volume and –10,000 specifies no volume).
I want to use a horizontial trackbar for this any ideas on how to calutlate this since the trackbar is 0 - 100 (full)
Nathan |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Fri Apr 20, 2007 3:11 pm Post subject: |
|
|
What about something like this?
| Code: | %%trackbar = @dlgtext(trackbar1)
if @equal(%%trackbar,100)
%%level = 0
elsif @greater(%%trackbar,90)
%%level = -1000
elsif @greater(%%trackbar,80)
%%level = -2000
elsif @greater(%%trackbar,70)
%%level = -3000
elsif @greater(%%trackbar,60)
%%level = -4000
elsif @greater(%%trackbar,50)
%%level = -5000
elsif @greater(%%trackbar,40)
%%level = -6000
elsif @greater(%%trackbar,30)
%%level = -7000
elsif @greater(%%trackbar,20)
%%level = -8000
elsif @greater(%%trackbar,10)
%%level = -9000
else
%%level = -10000
end
MEDIA VOLUME, <control name>,%%level |
_________________ cheers
Dave |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Fri Apr 20, 2007 4:55 pm Post subject: |
|
|
Hi Rubes & Dave
Ttry this code:
| Code: | %%trackbar = @dlgtext(trackbar1)
%%level = @sum(-@diff(100,%%tracker)00,0) |
Good luck
____________
uVeDeSe
____________ |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Sun Apr 22, 2007 1:48 am Post subject: |
|
|
Very clever, uVeDeSe... even though there is a typo (trackbar / tracker)  _________________ cheers
Dave |
|
| Back to top |
|
 |
|