PDA

View Full Version : Add Volume Control to your AMS Menu



eljay
05-31-2001, 09:19 PM
Add Volume Control to your AMS Menu

Like forum member, dallasfreak, I am sure others have wondered if it is possible to control the sound volume from an AMS menu when playing a sound file.

Well, I did a little research on the Windows' SNDVOL32.EXE and here's what I discovered...

To display the little (slider) "volume control" in your menu just like the one that shows when you click the speaker icon in the system tray, add the following commands to a "Text or Image Object."

For Win9x OS:

(For newbies, select Properties for text or image object. Then, select "! Actions | Mouse Click | > Execute | Execute Program and enter the below commands)

File Name: %WinDir%\SndVol32.exe
Arguments: DOSCommand "[WindowsDir]\sndvol32.exe" " "/tray" "Normal"
Working Dir: %WinDir%

I tested the above commands on my Win98 OS using a simple text ("Volume") object and it worked like a charm. These commands will probably work with WinME as well since its file system and kernel is pretty much the same as Win98.

I did not test the commands with WinNT or 2000. However, below is the commandline (Arguments) for WinNT:

DOSCommand "C:\WINNT\system32\sndvol32.exe" " "/tray" "Normal"

Maybe our trusty moderators, Adam or Mark, or someone else can test this commandline and give us some feedback. http://www.indigorose.com/ubb/images/icons/smile.gif

The nice thing about the volume control is that it pops up right where the mouse-click occurs. Thus, it behaves like an integral part of your menu! http://www.indigorose.com/ubb/images/icons/cool.gif

Here are the parameter options:

(full size mixer)
\sndvol32.exe" " "Normal"

(small mixer)
\sndvol32.exe" " "/small" "Normal"

(little master volume)
\sndvol32.exe" " "/tray" "Normal"

[This message has been edited by eljay (edited 05-31-2001).]

[This message has been edited by eljay (edited 05-31-2001).]

dallasfreak
05-31-2001, 09:32 PM
U R GOD !!!!!!!!!!!!!!!1

the one thing i needed for a fuly working volume in my CD

Thnaks man

eljay
05-31-2001, 09:48 PM
U R welcome! Let me know how it works out.

BTW dallasfreak, I am about to begin a MP3 CD project. Any menu layout ideas you'd like to share?

[This message has been edited by eljay (edited 05-31-2001).]

dallasfreak
05-31-2001, 10:26 PM
menu works great in 95/98/me -- added boolean to run the windows\sndvol32 if not nt or 2k, made another execute to run if 2k and one more if nt. It should detect the os and run it appropiately, testing it in just a few on 2k (once roomie gets done playing spades) Changed your jsut a lil bit though being 2k and nt not always on drive c:.
It executes sndvol32 out of the %sysdir% now, and then the dos portion is [WINDOWSDIR]\SYSTEM32\SNDVOL32 -- ill work out bugs and edit this message if incorrect vairables.

Layout for mp3cd -- of course flashy as **** -- something with included mp3's, plus a custom location selection to play mp3s off of hard drive. A nice radio look would work. think i may have to make me one--my own lil player i can use in other menus -- **** man -- u got me ideas for next project -- i need to finish this one first

also where did u find the variables at? and can u have it do like 25% of volume and 50% of volume. I kinda want mine to be a custom looking slider that will match my menu, preferbly a sideways one -- if it had predefined seetings like 25% etc, i could use image objects to adjust

[This message has been edited by dallasfreak (edited 05-31-2001).]

dallasfreak
05-31-2001, 11:07 PM
doing it with the sysdir vairables does work in 2k just fine -- the variable all work fine. being that 2k is based on nt, it should work there too

David Delaney
06-01-2001, 08:13 AM
Could someone post the code for getting it to work on any OS - ie; it detects the OS and then uses the code necessary for the OS. Something like this should be on the IR homepage - a really brilliant idea. Thanks!

Mark
06-01-2001, 08:54 AM
Hi,
I have been testing this on a WIN 2000 and WIN NT (SP6) and the basic functionality appears to work properly.

There was a slight difference in the way the Volume control appeared, but the basic functionality was the same.

The only problem I noticed (I will have to look into this a bit more) is that on WIN NT it seemed to ignore any of the "/small" "/tray" arguments. So even if you included either, the volume control would still appear "normal".

For example when I used this command on WIN 2000 and NT:

"DOSCommand %SysDir%\system32\sndvol32.exe /tray Normal"

the "small" volume interface appeared, then on WIN NT the same command brought up the "normal" interface. Getting rid of the "/tray" argument made the volume control appear "normal" on both NT and 2000.

Thanks for all the information; this is a really powerful idea.

mark.

dallasfreak
06-01-2001, 10:03 AM
EXECUTE PROGRAM
FILE NAME: %WinDir%\SndVol32.exe
ARGUMENTS: DOSCommand "[WindowsDir]\sndvol32.exe" " "/tray" "Normal"
WORKING DIR: %WinDir%
BOOLEAN: %IsWin2000% = FALSE; %IsWinNT4% = FLASE

EXECUTE PROGRAM
FILE NAME: %SysDir%\SndVol32.exe
ARGUMENTS: DOSCommand "[WindowsDir]\system32\sndvol32.exe" " "/tray" "Normal"
WORKING DIR: %SysDir%
BOOLEAN: %IsWin2000% = TRUE

EXECUTE PROGRAM
FILE NAME: %SysDir%\SndVol32.exe
ARGUMENTS: DOSCommand "[WindowsDir]\system32\sndvol32.exe" " "/tray" "Normal"
WORKING DIR: %SysDir%
BOOLEAN: %IsWinNT% = TRUE

nt should be correct, i dont have a current NT box, so can not check. hopefully MARK will respond at let us know

[This message has been edited by dallasfreak (edited 06-01-2001).]

David Delaney
06-03-2001, 07:30 AM
Is this the code for all OS's?

dallasfreak
06-03-2001, 09:14 AM
YES IT IS

David Delaney
06-04-2001, 04:30 AM
Thanks for your help

Mark
06-04-2001, 10:55 AM
Hi dallasfreak,

I tried your "code" on my WIN 2000 and Win NT 4.0 machines, and I received the same functionality that I reported earlier.

One the WIN 2000 machine the "small" volume tab appeared, the one with only one Volume Meter and a mute checkbox.

Then when I tested this on the WIN NT 4.0 SP6 machine I got the "full" volume window. The one with the four volume meters, for "Volume Control", "CD", "Wave", and "Synthesizer" respectively.

I'm not sure if this is necessarily a "problem", just something that users of this method should be aware of.

mark.

bosko
06-07-2001, 02:40 PM
More on volume control:

I have a "voice-over" on the images in the AutoMenu. The voice is normaly off but if the user wants to hear they can click on a "Sound ON" Button. The way I have it set up, the volume control also appears so that the volume can be adjusted.

The voice is cut off when going to the next picture and the volume control is covered since I display in full screen mode. So if the user clicks on the new "Sound ON"button he gets a new volume control display.

This works but is not elegant since on exit from the menu, the user is left with a large number of instances of Vol control.

The question:

can I detect if the SNDVOL32.exe is laready running and bring it to the foreground

and/or

can I stop SNDVOL32.exe running on exit from a page?

tbybee
02-12-2002, 02:22 PM
It's interesting how this reasonably old topic has been brought to the forefront again...anyway. Does anyone know what arguments I could put on my menu for a mute button. I frequently use graphics of check boxes and unchecked boxes. This way the user can "check" a box and a graphic appears of the check mark inside the box and whatever action happens. I'd like to create a Mute Checkbox that would mute the sound immediately and uncheck it would "un-mute" it. Any answers?

Thanks,

Tony

Bryan
02-12-2002, 11:16 PM
I have installed the volume control language and it works just fine as an open page exectuion.

I have included the three suggested variables to allow the control to work under the NT, 2000, and 98 OS's.

My Question is: If using the language as a link from a single text command (Volume) how do you include all 3 variables for the different operaing systems,

When I use the open page condition the location of the control varies and it often hides text, So I want to have the viewer click on the Volume text which will place
the control at the desired location.

DanceParty
08-21-2002, 07:37 AM
I am still learning all this. Could you help me with what you are doing here. I want to add this to my project and test. I am a lingo programmer but never worked with these types of variables before. (Always hard coded paths) What code did you use and where? Thanks

unknown user
08-21-2002, 08:43 AM
This is by far the most valuable little AMS trick anyone has laid on me yet! You are indeed some sort of minor deity from the looks of it... Thanks much!

Derek
08-21-2002, 01:07 PM
lol ... um ... http://neodezign.tripod.com/volume.htm

skinny_2k
08-21-2002, 02:51 PM
yes indeed... that trick is WICKED sweet! thanks for the great tip!!! it will com in VERY handy

DanceParty
09-04-2002, 07:11 AM
What action would I do this in 4.0? I have tried a bunch but have failed.

Thanks

Lorne
09-04-2002, 08:20 AM
"File - Execute"

DanceParty
09-04-2002, 08:39 AM
Oh I am a dork, duh.

thanks!

ruben373
09-16-2002, 01:40 PM
Dallasfreak, thank You very much for the volume control code.

I was asking for something like that for very long time, and noone was able to help.

But I have one question. How do You insert Boolean conditions
in AMS ? What should I click to do that ?

EXECUTE PROGRAM
FILE NAME: %WinDir%\SndVol32.exe
ARGUMENTS: DOSCommand "[WindowsDir]\sndvol32.exe" " "/tray" "Normal"
WORKING DIR: %WinDir%
BOOLEAN: %IsWin2000% = FALSE; %IsWinNT4% = FLASE

I had no problem with first 3 lines, but I don't know how to
insert BOOLEAN.

I was not able to figure that out. Anybody, Please HELP me.

Lorne
09-16-2002, 01:42 PM
What version of AutoPlay are you using?

(Dallasfreak's instructions were for version 3.0.)

ruben373
09-16-2002, 02:22 PM
I am using AMS 4.01 Version.

Lorne
09-16-2002, 02:31 PM
Then you want to put the code for each operating system in an IF block -- i.e., put it between an IF and an END IF action.

Inside the IF action, you'll want to use an expression like this:

(%IsWin2000% = false) AND (%IsWinNT4% = false) AND %IsWinXP% = false)

Or, a more condensed form:

!%IsWin2000% AND !%IsWinNT4% AND !%IsWinXP%

Or heck even like this if you want:

!(%IsWin2000% or %IsWinNT4% or %IsWinXP%)

All three of these are true only if the user's not running Windows 2000, NT4, or XP. (So, for example, it's true if they're running Windows 98, or ME.)

TJ_Tigger
09-17-2002, 01:28 PM
I can't seem to test the %WinDir% on a Win98SE machine. I have tried a command prompt, run command how would I test this variable.

I have the following lines in my project for a volume

If ((%IsWinXP% OR %IsWinNT4% OR %IsWin2000%) = TRUE)
File.Execute ("WinDir%\system32\sndvol32.exe" , "/traynormal" , Continue)
ELSE
File.Execute ("WinDir%\sndvol32.exe" , "/traynormal" ,Continue)
END IF

Should that work?

Lorne
09-17-2002, 01:46 PM
That variable won't work from the command line, it's internal to AutoPlay.

Make sure you include the first %, btw. It's %WinDir%, not WinDir%.

Don't get this confused with environment variables...they aren't the same.

TJ_Tigger
09-17-2002, 02:04 PM
Okay, dokey. I will transfer the files to a 98 box and test it there.

Does anyone use CD-RW for testing their projects?