mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-22 22:20:01 +00:00
Fix MP3 player
This commit is contained in:
parent
b88cf7b939
commit
14dcd8f04c
|
@ -2082,142 +2082,136 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
|
||||||
bool
|
bool
|
||||||
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
|
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
|
||||||
{
|
{
|
||||||
|
int i = 0;
|
||||||
uint32 position = nPos;
|
uint32 position = nPos;
|
||||||
char filename[MAX_PATH];
|
char filename[MAX_PATH];
|
||||||
|
|
||||||
if ( m_bInitialised && nFile < TOTAL_STREAMED_SOUNDS )
|
if ( !m_bInitialised || nFile >= TOTAL_STREAMED_SOUNDS )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ( mp3Stream[nStream] )
|
||||||
{
|
{
|
||||||
if ( mp3Stream[nStream] )
|
AIL_pause_stream(mp3Stream[nStream], 1);
|
||||||
|
AIL_close_stream(mp3Stream[nStream]);
|
||||||
|
}
|
||||||
|
if ( nFile == STREAMED_SOUND_RADIO_MP3_PLAYER )
|
||||||
|
{
|
||||||
|
do
|
||||||
{
|
{
|
||||||
AIL_pause_stream(mp3Stream[nStream], 1);
|
// Just switched to MP3 player
|
||||||
AIL_close_stream(mp3Stream[nStream]);
|
if ( !_bIsMp3Active && i == 0 )
|
||||||
}
|
{
|
||||||
|
if ( nPos > nStreamLength[STREAMED_SOUND_RADIO_MP3_PLAYER] )
|
||||||
if ( nFile == STREAMED_SOUND_RADIO_MP3_PLAYER )
|
position = 0;
|
||||||
{
|
tMP3Entry *e = _pMP3List;
|
||||||
uint32 i = 0;
|
|
||||||
do {
|
|
||||||
if(i != 0 || _bIsMp3Active) {
|
|
||||||
if(++_CurMP3Index >= nNumMP3s) _CurMP3Index = 0;
|
|
||||||
|
|
||||||
_CurMP3Pos = 0;
|
|
||||||
|
|
||||||
tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
|
|
||||||
|
|
||||||
if(mp3) {
|
|
||||||
mp3 = _pMP3List;
|
|
||||||
if(mp3 == NULL) {
|
|
||||||
_bIsMp3Active = false;
|
|
||||||
nFile = 0;
|
|
||||||
strcpy(filename, m_MiscomPath);
|
|
||||||
strcat(filename, StreamedNameTable[nFile]);
|
|
||||||
|
|
||||||
mp3Stream[nStream] =
|
|
||||||
AIL_open_stream(DIG, filename, 0);
|
|
||||||
if(mp3Stream[nStream]) {
|
|
||||||
AIL_set_stream_loop_count(
|
|
||||||
mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
|
|
||||||
nStreamLoopedFlag[nStream] = true;
|
|
||||||
AIL_set_stream_ms_position(
|
|
||||||
mp3Stream[nStream], position);
|
|
||||||
AIL_pause_stream(mp3Stream[nStream],
|
|
||||||
0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mp3->pLinkPath != NULL)
|
|
||||||
mp3Stream[nStream] =
|
|
||||||
AIL_open_stream(DIG, mp3->pLinkPath, 0);
|
|
||||||
else {
|
|
||||||
strcpy(filename, _mp3DirectoryPath);
|
|
||||||
strcat(filename, mp3->aFilename);
|
|
||||||
|
|
||||||
mp3Stream[nStream] =
|
|
||||||
AIL_open_stream(DIG, filename, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Try to continue from previous song, if already started
|
||||||
|
if(!_GetMP3PosFromStreamPos(&position, &e) && !e) {
|
||||||
|
nFile = 0;
|
||||||
|
strcpy(filename, m_MiscomPath);
|
||||||
|
strcat(filename, StreamedNameTable[nFile]);
|
||||||
|
mp3Stream[nStream] =
|
||||||
|
AIL_open_stream(DIG, filename, 0);
|
||||||
if(mp3Stream[nStream]) {
|
if(mp3Stream[nStream]) {
|
||||||
AIL_set_stream_loop_count(mp3Stream[nStream], 1);
|
AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
|
||||||
AIL_set_stream_ms_position(mp3Stream[nStream], 0);
|
nStreamLoopedFlag[nStream] = true;
|
||||||
|
AIL_set_stream_ms_position(mp3Stream[nStream], position);
|
||||||
AIL_pause_stream(mp3Stream[nStream], 0);
|
AIL_pause_stream(mp3Stream[nStream], 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
_bIsMp3Active = false;
|
} else {
|
||||||
continue;
|
if ( e->pLinkPath != NULL )
|
||||||
|
mp3Stream[nStream] = AIL_open_stream(DIG, e->pLinkPath, 0);
|
||||||
|
else {
|
||||||
|
strcpy(filename, _mp3DirectoryPath);
|
||||||
|
strcat(filename, e->aFilename);
|
||||||
|
|
||||||
|
mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( mp3Stream[nStream] ) {
|
||||||
|
AIL_set_stream_loop_count(mp3Stream[nStream], 1);
|
||||||
|
AIL_set_stream_ms_position(mp3Stream[nStream], position);
|
||||||
|
AIL_pause_stream(mp3Stream[nStream], 0);
|
||||||
|
|
||||||
|
_bIsMp3Active = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// fall through, start playing from another song
|
||||||
}
|
}
|
||||||
if ( nPos > nStreamLength[STREAMED_SOUND_RADIO_MP3_PLAYER] )
|
} else {
|
||||||
position = 0;
|
if(++_CurMP3Index >= nNumMP3s) _CurMP3Index = 0;
|
||||||
|
|
||||||
tMP3Entry *e;
|
_CurMP3Pos = 0;
|
||||||
if ( !_GetMP3PosFromStreamPos(&position, &e) )
|
|
||||||
|
tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
|
||||||
|
if ( !mp3 )
|
||||||
{
|
{
|
||||||
if ( e == NULL )
|
mp3 = _pMP3List;
|
||||||
|
if ( !_pMP3List )
|
||||||
{
|
{
|
||||||
nFile = 0;
|
nFile = 0;
|
||||||
|
_bIsMp3Active = 0;
|
||||||
strcpy(filename, m_MiscomPath);
|
strcpy(filename, m_MiscomPath);
|
||||||
strcat(filename, StreamedNameTable[nFile]);
|
strcat(filename, StreamedNameTable[nFile]);
|
||||||
|
|
||||||
mp3Stream[nStream] =
|
mp3Stream[nStream] =
|
||||||
AIL_open_stream(DIG, filename, 0);
|
AIL_open_stream(DIG, filename, 0);
|
||||||
if(mp3Stream[nStream]) {
|
if(mp3Stream[nStream]) {
|
||||||
AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
|
AIL_set_stream_loop_count(
|
||||||
|
mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
|
||||||
nStreamLoopedFlag[nStream] = true;
|
nStreamLoopedFlag[nStream] = true;
|
||||||
AIL_set_stream_ms_position(mp3Stream[nStream], position);
|
AIL_set_stream_ms_position(
|
||||||
AIL_pause_stream(mp3Stream[nStream], 0);
|
mp3Stream[nStream], position);
|
||||||
|
AIL_pause_stream(mp3Stream[nStream],
|
||||||
|
0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(mp3->pLinkPath != NULL)
|
||||||
if ( e->pLinkPath != NULL )
|
mp3Stream[nStream] = AIL_open_stream(DIG, mp3->pLinkPath, 0);
|
||||||
mp3Stream[nStream] = AIL_open_stream(DIG, e->pLinkPath, 0);
|
else {
|
||||||
else
|
|
||||||
{
|
|
||||||
strcpy(filename, _mp3DirectoryPath);
|
strcpy(filename, _mp3DirectoryPath);
|
||||||
strcat(filename, e->aFilename);
|
strcat(filename, mp3->aFilename);
|
||||||
|
|
||||||
mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0);
|
mp3Stream[nStream] =
|
||||||
|
AIL_open_stream(DIG, filename, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mp3Stream[nStream] )
|
if(mp3Stream[nStream]) {
|
||||||
{
|
|
||||||
AIL_set_stream_loop_count(mp3Stream[nStream], 1);
|
AIL_set_stream_loop_count(mp3Stream[nStream], 1);
|
||||||
AIL_set_stream_ms_position(mp3Stream[nStream], position);
|
AIL_set_stream_ms_position(mp3Stream[nStream], 0);
|
||||||
AIL_pause_stream(mp3Stream[nStream], 0);
|
AIL_pause_stream(mp3Stream[nStream], 0);
|
||||||
|
#ifdef FIX_BUGS
|
||||||
_bIsMp3Active = true;
|
_bIsMp3Active = true;
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_bIsMp3Active = false;
|
}
|
||||||
|
_bIsMp3Active = 0;
|
||||||
} while(++i < nNumMP3s);
|
|
||||||
|
|
||||||
position = 0;
|
|
||||||
nFile = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
strcpy(filename, m_MiscomPath);
|
|
||||||
strcat(filename, StreamedNameTable[nFile]);
|
|
||||||
|
|
||||||
mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0);
|
|
||||||
if ( mp3Stream[nStream] )
|
|
||||||
{
|
|
||||||
AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
|
|
||||||
nStreamLoopedFlag[nStream] = true;
|
|
||||||
AIL_set_stream_ms_position(mp3Stream[nStream], position);
|
|
||||||
AIL_pause_stream(mp3Stream[nStream], 0);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
while ( ++i < nNumMP3s );
|
||||||
|
position = 0;
|
||||||
|
nFile = 0;
|
||||||
}
|
}
|
||||||
|
strcpy(filename, m_MiscomPath);
|
||||||
|
strcat(filename, StreamedNameTable[nFile]);
|
||||||
|
|
||||||
|
mp3Stream[nStream] = AIL_open_stream(DIG, filename, 0);
|
||||||
|
if ( mp3Stream[nStream] )
|
||||||
|
{
|
||||||
|
AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
|
||||||
|
nStreamLoopedFlag[nStream] = true;
|
||||||
|
AIL_set_stream_ms_position(mp3Stream[nStream], position);
|
||||||
|
AIL_pause_stream(mp3Stream[nStream], 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1734,93 +1734,94 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
|
||||||
bool
|
bool
|
||||||
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
|
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
|
||||||
{
|
{
|
||||||
|
int i = 0;
|
||||||
uint32 position = nPos;
|
uint32 position = nPos;
|
||||||
char filename[256];
|
char filename[MAX_PATH];
|
||||||
|
|
||||||
ASSERT( nStream < MAX_STREAMS );
|
if ( nFile >= TOTAL_STREAMED_SOUNDS )
|
||||||
|
return false;
|
||||||
|
|
||||||
if ( nFile < TOTAL_STREAMED_SOUNDS )
|
if ( aStream[nStream] )
|
||||||
{
|
{
|
||||||
if ( aStream[nStream] )
|
delete aStream[nStream];
|
||||||
|
aStream[nStream] = NULL;
|
||||||
|
}
|
||||||
|
if ( nFile == STREAMED_SOUND_RADIO_MP3_PLAYER )
|
||||||
|
{
|
||||||
|
do
|
||||||
{
|
{
|
||||||
delete aStream[nStream];
|
// Just switched to MP3 player
|
||||||
aStream[nStream] = NULL;
|
if ( !_bIsMp3Active && i == 0 )
|
||||||
}
|
{
|
||||||
|
if ( nPos > nStreamLength[STREAMED_SOUND_RADIO_MP3_PLAYER] )
|
||||||
|
position = 0;
|
||||||
|
tMP3Entry *e = _pMP3List;
|
||||||
|
|
||||||
if ( nFile == STREAMED_SOUND_RADIO_MP3_PLAYER )
|
// Try to continue from previous song, if already started
|
||||||
{
|
if(!_GetMP3PosFromStreamPos(&position, &e) && !e) {
|
||||||
uint32 i = 0;
|
nFile = 0;
|
||||||
do {
|
|
||||||
if(i != 0 || _bIsMp3Active) {
|
|
||||||
if(++_CurMP3Index >= nNumMP3s) _CurMP3Index = 0;
|
|
||||||
|
|
||||||
_CurMP3Pos = 0;
|
strcpy(filename, StreamedNameTable[nFile]);
|
||||||
|
CStream* stream = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
||||||
|
|
||||||
tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
|
aStream[nStream] = stream;
|
||||||
|
|
||||||
if(mp3) {
|
if (stream->Setup()) {
|
||||||
mp3 = _pMP3List;
|
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
|
||||||
if(mp3 == NULL) {
|
nStreamLoopedFlag[nStream] = true;
|
||||||
_bIsMp3Active = false;
|
if (position != 0)
|
||||||
nFile = 0;
|
stream->SetPosMS(position);
|
||||||
strcat(filename, StreamedNameTable[nFile]);
|
|
||||||
|
|
||||||
CStream* stream = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
stream->Start();
|
||||||
ASSERT(stream != NULL);
|
|
||||||
|
|
||||||
aStream[nStream] = stream;
|
return true;
|
||||||
|
} else {
|
||||||
if (stream->Setup()) {
|
delete stream;
|
||||||
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
|
aStream[nStream] = NULL;
|
||||||
nStreamLoopedFlag[nStream] = true;
|
|
||||||
if (position != 0)
|
|
||||||
stream->SetPosMS(position);
|
|
||||||
|
|
||||||
stream->Start();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
delete stream;
|
|
||||||
aStream[nStream] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
if (mp3->pLinkPath != NULL)
|
} else {
|
||||||
aStream[nStream] = new CStream(mp3->pLinkPath, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
|
||||||
|
if (e->pLinkPath != NULL)
|
||||||
|
aStream[nStream] = new CStream(e->pLinkPath, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
||||||
else {
|
else {
|
||||||
strcpy(filename, _mp3DirectoryPath);
|
strcpy(filename, _mp3DirectoryPath);
|
||||||
strcat(filename, mp3->aFilename);
|
strcat(filename, e->aFilename);
|
||||||
|
|
||||||
aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aStream[nStream]->Setup()) {
|
if (aStream[nStream]->Setup()) {
|
||||||
|
if (position != 0)
|
||||||
|
aStream[nStream]->SetPosMS(position);
|
||||||
|
|
||||||
aStream[nStream]->Start();
|
aStream[nStream]->Start();
|
||||||
|
|
||||||
|
_bIsMp3Active = true;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
delete aStream[nStream];
|
delete aStream[nStream];
|
||||||
aStream[nStream] = NULL;
|
aStream[nStream] = NULL;
|
||||||
}
|
}
|
||||||
|
// fall through, start playing from another song
|
||||||
_bIsMp3Active = false;
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if ( nPos > nStreamLength[STREAMED_SOUND_RADIO_MP3_PLAYER] )
|
} else {
|
||||||
position = 0;
|
if(++_CurMP3Index >= nNumMP3s) _CurMP3Index = 0;
|
||||||
|
|
||||||
tMP3Entry *e;
|
_CurMP3Pos = 0;
|
||||||
if ( !_GetMP3PosFromStreamPos(&position, &e) )
|
|
||||||
|
tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
|
||||||
|
if ( !mp3 )
|
||||||
{
|
{
|
||||||
if ( e == NULL )
|
mp3 = _pMP3List;
|
||||||
|
if ( !_pMP3List )
|
||||||
{
|
{
|
||||||
nFile = 0;
|
nFile = 0;
|
||||||
strcat(filename, StreamedNameTable[nFile]);
|
_bIsMp3Active = 0;
|
||||||
|
strcpy(filename, StreamedNameTable[nFile]);
|
||||||
|
|
||||||
CStream* stream = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
CStream* stream = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
||||||
ASSERT(stream != NULL);
|
|
||||||
|
|
||||||
aStream[nStream] = stream;
|
aStream[nStream] = stream;
|
||||||
|
|
||||||
|
@ -1837,63 +1838,55 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
|
||||||
delete stream;
|
delete stream;
|
||||||
aStream[nStream] = NULL;
|
aStream[nStream] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mp3->pLinkPath != NULL)
|
||||||
if (e->pLinkPath != NULL)
|
aStream[nStream] = new CStream(mp3->pLinkPath, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
||||||
aStream[nStream] = new CStream(e->pLinkPath, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
|
||||||
else {
|
else {
|
||||||
strcpy(filename, _mp3DirectoryPath);
|
strcpy(filename, _mp3DirectoryPath);
|
||||||
strcat(filename, e->aFilename);
|
strcat(filename, mp3->aFilename);
|
||||||
|
|
||||||
aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream]);
|
aStream[nStream] = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aStream[nStream]->Setup()) {
|
if (aStream[nStream]->Setup()) {
|
||||||
if (position != 0)
|
|
||||||
aStream[nStream]->SetPosMS(position);
|
|
||||||
|
|
||||||
aStream[nStream]->Start();
|
aStream[nStream]->Start();
|
||||||
|
#ifdef FIX_BUGS
|
||||||
_bIsMp3Active = true;
|
_bIsMp3Active = true;
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
delete aStream[nStream];
|
delete aStream[nStream];
|
||||||
aStream[nStream] = NULL;
|
aStream[nStream] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
_bIsMp3Active = false;
|
}
|
||||||
|
_bIsMp3Active = 0;
|
||||||
} while(++i < nNumMP3s);
|
|
||||||
|
|
||||||
position = 0;
|
|
||||||
nFile = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
strcpy(filename, StreamedNameTable[nFile]);
|
|
||||||
|
|
||||||
CStream *stream = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
|
||||||
ASSERT(stream != NULL);
|
|
||||||
|
|
||||||
aStream[nStream] = stream;
|
|
||||||
|
|
||||||
if ( stream->Setup() ) {
|
|
||||||
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
|
|
||||||
nStreamLoopedFlag[nStream] = true;
|
|
||||||
if (position != 0)
|
|
||||||
stream->SetPosMS(position);
|
|
||||||
|
|
||||||
stream->Start();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
delete stream;
|
|
||||||
aStream[nStream] = NULL;
|
|
||||||
}
|
}
|
||||||
|
while ( ++i < nNumMP3s );
|
||||||
|
position = 0;
|
||||||
|
nFile = 0;
|
||||||
}
|
}
|
||||||
|
strcpy(filename, StreamedNameTable[nFile]);
|
||||||
|
|
||||||
|
CStream *stream = new CStream(filename, ALStreamSources[nStream], ALStreamBuffers[nStream], IsThisTrackAt16KHz(nFile) ? 16000 : 32000);
|
||||||
|
|
||||||
|
aStream[nStream] = stream;
|
||||||
|
|
||||||
|
if ( stream->Setup() ) {
|
||||||
|
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
|
||||||
|
nStreamLoopedFlag[nStream] = true;
|
||||||
|
if (position != 0)
|
||||||
|
stream->SetPosMS(position);
|
||||||
|
|
||||||
|
stream->Start();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
delete stream;
|
||||||
|
aStream[nStream] = NULL;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue