The name 'isValidStream' is a little misleading because it doesn't check if the stream is really valid. Additionally, 'isSupported' can be naturally overloaded.
// static members
////////////////////////////////////////////////////////////////////////////////
-bool APE::File::isValidStream(IOStream *stream)
+bool APE::File::isSupported(IOStream *stream)
{
// An APE file has an ID "MAC " somewhere. An ID3v2 tag may precede.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool ASF::File::isValidStream(IOStream *stream)
+bool ASF::File::isSupported(IOStream *stream)
{
// An ASF file has to start with the designated GUID.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
void read();
{
File *file = 0;
- if(MPEG::File::isValidStream(stream))
+ if(MPEG::File::isSupported(stream))
file = new MPEG::File(stream, ID3v2::FrameFactory::instance(), readAudioProperties, audioPropertiesStyle);
- else if(Ogg::Vorbis::File::isValidStream(stream))
+ else if(Ogg::Vorbis::File::isSupported(stream))
file = new Ogg::Vorbis::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(Ogg::FLAC::File::isValidStream(stream))
+ else if(Ogg::FLAC::File::isSupported(stream))
file = new Ogg::FLAC::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(FLAC::File::isValidStream(stream))
+ else if(FLAC::File::isSupported(stream))
file = new FLAC::File(stream, ID3v2::FrameFactory::instance(), readAudioProperties, audioPropertiesStyle);
- else if(MPC::File::isValidStream(stream))
+ else if(MPC::File::isSupported(stream))
file = new MPC::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(WavPack::File::isValidStream(stream))
+ else if(WavPack::File::isSupported(stream))
file = new WavPack::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(Ogg::Speex::File::isValidStream(stream))
+ else if(Ogg::Speex::File::isSupported(stream))
file = new Ogg::Speex::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(Ogg::Opus::File::isValidStream(stream))
+ else if(Ogg::Opus::File::isSupported(stream))
file = new Ogg::Opus::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(TrueAudio::File::isValidStream(stream))
+ else if(TrueAudio::File::isSupported(stream))
file = new TrueAudio::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(MP4::File::isValidStream(stream))
+ else if(MP4::File::isSupported(stream))
file = new MP4::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(ASF::File::isValidStream(stream))
+ else if(ASF::File::isSupported(stream))
file = new ASF::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(RIFF::AIFF::File::isValidStream(stream))
+ else if(RIFF::AIFF::File::isSupported(stream))
file = new RIFF::AIFF::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(RIFF::WAV::File::isValidStream(stream))
+ else if(RIFF::WAV::File::isSupported(stream))
file = new RIFF::WAV::File(stream, readAudioProperties, audioPropertiesStyle);
- else if(APE::File::isValidStream(stream))
+ else if(APE::File::isSupported(stream))
file = new APE::File(stream, readAudioProperties, audioPropertiesStyle);
- // isValidStream() only does a quick check, so double check the file here.
+ // isSupported() only does a quick check, so double check the file here.
if(file) {
if(file->isValid())
// static members
////////////////////////////////////////////////////////////////////////////////
-bool FLAC::File::isValidStream(IOStream *stream)
+bool FLAC::File::isSupported(IOStream *stream)
{
// A FLAC file has an ID "fLaC" somewhere. An ID3v2 tag may precede.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool MP4::File::isValidStream(IOStream *stream)
+bool MP4::File::isSupported(IOStream *stream)
{
// An MP4 file has to have an "ftyp" box first.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
void read(bool readProperties);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool MPC::File::isValidStream(IOStream *stream)
+bool MPC::File::isSupported(IOStream *stream)
{
// A newer MPC file has to start with "MPCK" or "MP+", but older files don't
// have keys to do a quick check.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
};
}
-bool MPEG::File::isValidStream(IOStream *stream)
+bool MPEG::File::isSupported(IOStream *stream)
{
if(!stream || !stream->isOpen())
return false;
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool Ogg::FLAC::File::isValidStream(IOStream *stream)
+bool Ogg::FLAC::File::isSupported(IOStream *stream)
{
// An Ogg FLAC file has IDs "OggS" and "fLaC" somewhere.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool Ogg::Opus::File::isValidStream(IOStream *stream)
+bool Ogg::Opus::File::isSupported(IOStream *stream)
{
// An Opus file has IDs "OggS" and "OpusHead" somewhere.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool Ogg::Speex::File::isValidStream(IOStream *stream)
+bool Ogg::Speex::File::isSupported(IOStream *stream)
{
// A Speex file has IDs "OggS" and "Speex " somewhere.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool Vorbis::File::isValidStream(IOStream *stream)
+bool Vorbis::File::isSupported(IOStream *stream)
{
// An Ogg Vorbis file has IDs "OggS" and "\x01vorbis" somewhere.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool RIFF::AIFF::File::isValidStream(IOStream *stream)
+bool RIFF::AIFF::File::isSupported(IOStream *stream)
{
// An AIFF file has to start with "FORM????AIFF" or "FORM????AIFC".
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool RIFF::WAV::File::isValidStream(IOStream *stream)
+bool RIFF::WAV::File::isSupported(IOStream *stream)
{
// A WAV file has to start with "RIFF????WAVE".
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool TrueAudio::File::isValidStream(IOStream *stream)
+bool TrueAudio::File::isSupported(IOStream *stream)
{
// A TrueAudio file has to start with "TTA". An ID3v2 tag may precede.
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);
// static members
////////////////////////////////////////////////////////////////////////////////
-bool WavPack::File::isValidStream(IOStream *stream)
+bool WavPack::File::isSupported(IOStream *stream)
{
// A WavPack file has to start with "wvpk".
* \note This method is designed to do a quick check. The result may
* not necessarily be correct.
*/
- static bool isValidStream(IOStream *stream);
+ static bool isSupported(IOStream *stream);
private:
File(const File &);