AUDIO: Added probe method to ImpulseTracker

This commit is contained in:
Eugene Sandulenko 2023-03-25 01:51:59 +01:00
parent aa46d0418c
commit af18380ac3
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 21 additions and 3 deletions

View File

@ -225,6 +225,20 @@ RewindableAudioStream *makeImpulseTrackerStream(Common::SeekableReadStream *stre
return impulseTrackerMod;
}
bool probeImpulseTracker(Common::SeekableReadStream *st) {
int32 setPos = st->pos();
// xm file
char sigIt[4] = { 0 };
st->read(sigIt, 4);
st->seek(setPos);
if (!memcmp(sigIt, "IMPM", 4)) {
return true;
}
return false;
}
} // End of namespace Audio
#endif // #ifdef USE_MIKMOD

View File

@ -47,9 +47,13 @@ class RewindableAudioStream;
* @param disposeAfterUse whether to delete the stream after use
* @return a new AudioStream, or NULL, if an error occurred
*/
RewindableAudioStream *makeImpulseTrackerStream(
Common::SeekableReadStream *stream,
DisposeAfterUse::Flag disposeAfterUse);
RewindableAudioStream *makeImpulseTrackerStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse);
/**
* Check if the stream is one of the supported formats
*/
bool probeImpulseTracker(Common::SeekableReadStream *stream);
} // End of namespace Audio
#endif // #ifdef USE_MIKMOD