Play specified segment of song, in loop if needed.
virtual __stdcall int PlayLoop(TTimeFormat fFormatStartTime, TStreamTime * pStartTime, TTimeFormat fFormatEndTime, TStreamTime * pEndTime, unsigned int nNumOfCycles, unsigned int fContinuePlaying) = 0;
Parameters |
Description |
TTimeFormat fFormatStartTime |
Time format of pStartTime parameter. With this parameter you need to specify which member of TStreamTime is valid. |
TStreamTime * pStartTime |
Pointer to TStreamTime structure specifying loop starting position. |
TTimeFormat fFormatEndTime |
Time format of pEndTime parameter. With this parameter you need to specify which member of TStreamTime is valid. |
TStreamTime * pEndTime |
Pointer to TStreamTime structure specifying loop ending position. |
unsigned int nNumOfCycles |
Number of loop cycles. This value can't be 0. If this value is 1, function will play portion from pStartTime to pEndTime once. If this value is 2, function will play portion from pStartTime to pEndTime twice ... |
unsigned int fContinuePlaying |
If this value is 0, playing will stop when loop is done with cycles. If this value is 1, playing will continue when loop is done with cycles. |
Return Values |
Description |
1 |
All OK. |
0 |
Error. To get error message read here. |
Previous playing will be stopped, function will seek to pStartTime and start playing.
Note: Accuracy of seek position depends on interface settings. See accurate seek.
Warning: This function will fail on dynamic stream.
Play loop from current position, loop length is 5 seconds, play 3 cycles, continue playing.
TStreamTime pCurrentTime; instance->GetPosition(&pCurrentTime); // starting position is current position TStreamTime pEndTime; pEndTime.ms = pCurrentTime.ms + 5000; // ending position is 5000 ms forward instance->PlayLoop(tfMillisecond, &pCurrentTime, tfMillisecond, &pEndTime ,3, 1);
TStreamTime pCurrentTime; zplay_GetPosition(instance, &pCurrentTime); // starting position is current position TStreamTime pEndTime; pEndTime.ms = pCurrentTime.ms + 5000; // ending position is 5000 ms forward zplay_PlayLoop(instance, tfMillisecond, &pCurrentTime, tfMillisecond, &pEndTime ,3, 1);
Copyright (c) 2010. Zoran Cindori - All rights reserved.
Web: http://libzplay.sourceforge.net/ Email: zcindori@inet.hr |