added "autorewind" feature to be able to re-use AmAudioFile

without explicit rewind()



git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1008 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 18 years ago
parent 7030673b90
commit 73bee3a4cd

@ -213,7 +213,7 @@ int AmAudioFile::fpopen_int(const string& filename, OpenMode mode, FILE* n_fp)
AmAudioFile::AmAudioFile()
: AmBufferedAudio(0, 0, 0), data_size(0),
fp(0), begin(0), loop(false),
fp(0), begin(0), loop(false), autorewind(false),
on_close_done(false),
close_on_exit(true)
{
@ -322,6 +322,11 @@ int AmAudioFile::read(unsigned int user_ts, unsigned int size)
rewind();
goto read_block;
}
if (autorewind.get() && data_size>0){
DBG("autorewinding audio file...\n");
rewind();
}
ret = -2; // eof
}

@ -106,6 +106,7 @@ protected:
public:
AmSharedVar<bool> loop;
AmSharedVar<bool> autorewind;
AmAudioFile();
~AmAudioFile();

Loading…
Cancel
Save