| ActiveTcl User Guide |

### NAME

Snack_AddSubCmd - add a new sub-command to a Snack object command

### SYNOPSIS

#include <snack.h>
Snack_AddSubCmd(snackCmd, cmdName, cmdProc, delCmdProc)

### ARGUMENTS

int snackCmd (in)
A flag specifying which command category the new sub-command belongs to. Valid values are SNACK_SOUND_CMD, SNACK_MIXER_CMD, or SNACK_AUDIO_CMD.

char *cmdName (in)
Name of the new sub-command.

Snack_CmdProc *cmdProc (in)
Implementation of the new sub-command. cmdProc will be called whenever cmdName is invoked as a sub-command.

Snack_DelCmdProc *delCmdProc (in)
Procedure to invoke before deleting the object command.

### DESCRIPTION

Snack_AddSubCmd defines a new sub-command for a Snack object command and associates with it procedure cmdProc, such that whenever cmdName is invoked as a sub-command (e.g., via a call to Tcl_EvalObj) the Tcl interpreter will call cmdProc to process the command. New sound sub-commands must call Snack_GetSound() to determine which sound they invoked on. delCmdProc is called during clean-up when unloading the extension.