SoundVol plugin for Take Command / TCC / TCC/LE

Version 1.0.0.2     2023-10-16

Charles Dye

Purpose:

This plugin supplies a replacement _VOLUME variable which will work under Windows Vista and later. For bonus points, it also supplies a _MUTE variable to return the mute state, and a SOUNDVOL command to report or change the master volume and mute state.

(This is really just the sound volume features from my UIStuff plugin, diked out and rolled into a separate little plugin.)

Installation:

To use this plugin, copy SoundVol.dll to some known location on your hard drive. (If you are still using the 32-bit version of Take Command, take SoundVol-x86.dll instead of SoundVol.dll.) Load the .DLL file with a PLUGIN /L command, for example:

plugin /l c:\bin\tcmd\test\soundvol.dll

If you copy the .DLL file to a subdirectory named PlugIns within your Take Command program directory, it will be loaded automatically when TCC starts.

Plugin Features:

New command: SOUNDVOL

New variables: _MUTE, _VOLUME

Syntax Note:

The syntax definitions in the following text use these conventions for clarity:

BOLD CODEindicates text which must be typed exactly as shown.
CODEindicates optional text, which may be typed as shown or omitted.
Bold italicnames a required argument; a value must be supplied.
Regular italicnames an optional argument.
ellipsis…after an argument means that more than one may be given.

New Commands:

SOUNDVOL — Display or change the master sound volume.

Syntax:
SOUNDVOL /B /M /O /Q /U volume

/Bbeep after changing settings
/Mmute the sound
/Odisplay the current settings on-screen
/Qquietly
/Uunmute the sound
volumenew volume level, 0 — 100

Unless /Q is specified, the current volume will be displayed.

rem  Crank it all the way up:
soundvol /u 100



New Variables:

_MUTE — Returns the master sound mute state.

Syntax:
%_MUTE

The value returned is 1 if the sound is muted, or 0 otherwise. If the current volume level cannot be determined (e.g. there is no sound hardware installed), this variable will return -1.

rem  Check whether the audio is muted:
if %_mute == 1 echo The audio is muted.



_VOLUME — Returns the master sound volume level.

Syntax:
%_VOLUME

The value returned is in the range 0 through 100. If the current volume level cannot be determined, this variable will return -1.

rem  Display the current master volume level:
echo The master sound volume is at %_volume.



Startup Message:

This plugin displays an informational line when it initializes. The message will be suppressed in transient or pipe shells. You can disable it for all shells by defining an environment variable named NOLOADMSG, for example:

set /e /u noloadmsg=1

Changes:


Version:Date:Changes:
1.0.0.22023-10-16Tweaked ShowCmdHelp() to include VER_PATCH.
1.0.0.12023-10-12Updated the plugin’s web address.
1.0.02023-07-06First release. Updated OsdCmd.cpp; removed the need for FindMyWindow.cpp and made the .DLL files about 1½ K smaller.

Status and Licensing:

This plugin is © Copyright 2023, Charles Dye. Unaltered copies of the binary and documentation files may be freely distributed without restriction. I make no guarantee and give no warranty for its operation. If you find a problem, you can report it in the JP Software support forum.

Download:

You can download the current version of the plugin from http://charlesdye.net/dl/soundvol.zip.