libZPlay documentation (Win32)
IndexReferenceHome
PreviousUpNext
ZPlay::SlideVolume Method

Slide internal volume.

C++
bool SlideVolume(TTimeFormat TimeFormatStart, TStreamTime % TimeStart, int StartVolumeLeft, int StartVolumeRight, TTimeFormat TimeFormatEnd, TStreamTime % TimeEnd, int EndVolumeLeft, int EndVolumeRight);
Parameters 
Description 
TTimeFormat TimeFormatStart 
Time format of TimeStart parameter. With this parameter you need to specify which member of TStreamTime is valid. 
TStreamTime % TimeStart 
reference to TStreamTime structure specifying starting slide position. 
int StartVolumeLeft 
Start volume for left channel. Range is from 0 to 100. 
int StartVolumeRight 
Start volume for right channel. Range is from 0 to 100. 
TTimeFormat TimeFormatEnd 
Time format of TimeEnd parameter. With this parameter you need to specify which member of TStreamTime is valid. 
TStreamTime % TimeEnd 
Reference to TStreamTime structure specifying ending slide position. 
int EndVolumeLeft 
End volume for left channel. Range is from 0 to 100. 
int EndVolumeRight 
End volume for right channel. Range is from 0 to 100.
 
Return Values 
Description 
True 
All OK. 
False 
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 functions will cancel slide effect. 

 int left = 0;
int right = 0;
TStreamTime startpos = TStreamTime();
TStreamTime endpos = TStreamTime();

player->GetPlayerVolume(left, right);
player->GetPosition(startpos);
endpos.sec = System::Convert::ToUInt32(startpos.sec + 5);
player->SlideVolume(TTimeFormat::tfSecond, startpos, left, right, TTimeFormat::tfSecond, endpos, 100, 100); 
Copyright (c) 2010. Zoran Cindori - All rights reserved.

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

Email: zcindori@inet.hr