libZPlay documentation (Win32)
IndexReferenceHome
PreviousUpNext
libZPlayCpp::zplay_SlideVolume Function

Slide internal volume.

C++
__stdcall __declspec(dllimport) int zplay_SlideVolume(ZPLAY_HANDLE handle, int fFormatStart, TStreamTime * pTimeStart, unsigned int nStartVolumeLeft, unsigned int nStartVolumeRight, int fFormatEnd, TStreamTime * pTimeEnd, unsigned int nEndVolumeLeft, unsigned int nEndVolumeRight);
Parameters 
Description 
ZPLAY_HANDLE handle 
ZPLAY handle. Get this handle with zplay_CreateZPlay
int fFormatStart 
Time format of pTimeStart parameter. With this parameter you need to specify which member of TStreamTime is valid. 
TStreamTime * pTimeStart 
Pointer to TStreamTime structure specifying starting slide position. 
unsigned int nStartVolumeLeft 
Start volume for left channel. Range is from 0 to 100. 
unsigned int nStartVolumeRight 
Start volume for right channel. Range is from 0 to 100. 
int fFormatEnd 
Time format of pTimeEnd parameter. With this parameter you need to specify which member of TStreamTime is valid. 
TStreamTime * pTimeEnd 
Pointer to TStreamTime structure specifying ending slide position. 
unsigned int nEndVolumeLeft 
End volume for left channel. Range is from 0 to 100. 
unsigned int nEndVolumeRight 
End volume for right channel. Range is from 0 to 100.
 
Return Values 
Description 
All OK. 
Error. To get error message read here

This function will slide change player volume from starting volume to ending volume in specified interval. 

Note: Accuracy of pTimeStart and pTimeEnd is not up to sample. Accuracy is about 50 ms. So, you can't fade volume with sample precision. 

Note: SetPlayerVolume or zplay_SetPlayerVolume functions will cancel slide effect. 

Slide volume from 100 to 0 in interval of 5 seconds. 

ZPlay C++ Class interface  

TStreamTime start;
TStreamTime end;
instance->GetPosition(&start);
end.sec = start.sec + 5;
instance->SlideVolume(tfSecond, &start, 100,100, tfSecond, &end, 0,0);

 

C Style interface

TStreamTime start;
TStreamTime end;
instance->GetPosition(&start);
end.sec = start.sec + 5;
zplay_SlideVolume(instance, tfSecond, &start, 100,100, tfSecond, &end, 0,0);
Copyright (c) 2010. Zoran Cindori - All rights reserved.

Web: http://libzplay.sourceforge.net/

Email: zcindori@inet.hr