ms_setvol( )
Cautions | Errors | Example | See Also
Name: int ms_setvol (devh, type, steps) Inputs:
Returns: Includes: Category: Mode: Platform: Description
The ms_setvol( ) function changes or resets the station volume.
devh the station handle type specifies whether to adjust or to reset current mode steps the number of steps to increase or decrease volume The type parameter dictates whether the volume will be adjusted from its current level or reset to the default value. The type parameter must be set to one of the following values:
- VOLADJ
- Adjusts station volume
- VOLRES
- Resets station volume back to the default
If the type parameter is VOLRES, the volume is returned to the default setting of -3 dB and the third parameter, steps, is ignored. For VOLADJ, steps increases or decreases from the current volume by multiples of 1 dB. A positive steps value increases the volume, and a negative steps value decreases the volume. The volume ranges from -9 dB to +3 dB, with a default value of -3 dB. Hence, the volume can be changed 6 dB higher or lower from the default value. However, depending on the current volume setting, the number of steps in either direction will be limited.
- Note: An error will NOT be returned if the saturation point is reached in either direction.
Cautions
Errors
If this function returns -1 to indicate failure, obtain the reason for the error by calling the SRL standard attribute function ATDV_LASTERR( ) or ATDV_ERRMSGP( ) to retrieve either the error code or a pointer to the error description, respectively.
Refer to the error type tables found in Chapter 5, "Error Codes". Error defines can be found in dtilib.h or msilib.h.
Example
#include <windows.h> /* For Windows applications only */ #include <errno.h> #include "srllib.h" #include "dtilib.h" #include "msilib.h" int chdev2; /* Station dev descriptor */ /* Open board 1, station 2 device */ if ((chdev2 = ms_open("msiB1C2",0) == -1) { printf("Cannot open MSI B1, C2. errno = %d", errno); exit(1); } /* * * Continue processing * */ /* Increase volume by 2 dB from current level */ if (ms_setvol(chdev2,VOLADJ,2)==-1) { printf("Error setting volume: %s", ATDV_ERRMSGP(chdev2)); exit(1); } /* * Continue Processing * */See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation