|
|
@ -110,10 +110,9 @@ IAudioDecoder *IAudioDecoder::createAudioDecoder(const std::string &type, NLMISC
|
|
|
|
|
|
|
|
|
|
|
|
bool IAudioDecoder::getInfo(const std::string &filepath, std::string &artist, std::string &title, float &length)
|
|
|
|
bool IAudioDecoder::getInfo(const std::string &filepath, std::string &artist, std::string &title, float &length)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string lookup = CPath::lookup(filepath, false);
|
|
|
|
if (filepath.empty() || !CFile::fileExists(filepath))
|
|
|
|
if (lookup.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlwarning("Music file %s does not exist!", filepath.c_str());
|
|
|
|
nlwarning("Music file '%s' does not exist!", filepath.c_str());
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -121,7 +120,7 @@ bool IAudioDecoder::getInfo(const std::string &filepath, std::string &artist, st
|
|
|
|
CIFile ifile;
|
|
|
|
CIFile ifile;
|
|
|
|
ifile.setCacheFileOnOpen(false);
|
|
|
|
ifile.setCacheFileOnOpen(false);
|
|
|
|
ifile.allowBNPCacheFileOnOpen(false);
|
|
|
|
ifile.allowBNPCacheFileOnOpen(false);
|
|
|
|
if (ifile.open(lookup))
|
|
|
|
if (ifile.open(filepath))
|
|
|
|
return CAudioDecoderFfmpeg::getInfo(&ifile, artist, title, length);
|
|
|
|
return CAudioDecoderFfmpeg::getInfo(&ifile, artist, title, length);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
std::string type = CFile::getExtension(filepath);
|
|
|
|
std::string type = CFile::getExtension(filepath);
|
|
|
@ -132,7 +131,7 @@ bool IAudioDecoder::getInfo(const std::string &filepath, std::string &artist, st
|
|
|
|
CIFile ifile;
|
|
|
|
CIFile ifile;
|
|
|
|
ifile.setCacheFileOnOpen(false);
|
|
|
|
ifile.setCacheFileOnOpen(false);
|
|
|
|
ifile.allowBNPCacheFileOnOpen(false);
|
|
|
|
ifile.allowBNPCacheFileOnOpen(false);
|
|
|
|
if (ifile.open(lookup))
|
|
|
|
if (ifile.open(filepath))
|
|
|
|
return CAudioDecoderVorbis::getInfo(&ifile, artist, title, length);
|
|
|
|
return CAudioDecoderVorbis::getInfo(&ifile, artist, title, length);
|
|
|
|
|
|
|
|
|
|
|
|
nlwarning("Unable to open: '%s'", filepath.c_str());
|
|
|
|
nlwarning("Unable to open: '%s'", filepath.c_str());
|
|
|
@ -143,7 +142,7 @@ bool IAudioDecoder::getInfo(const std::string &filepath, std::string &artist, st
|
|
|
|
CIFile ifile;
|
|
|
|
CIFile ifile;
|
|
|
|
ifile.setCacheFileOnOpen(false);
|
|
|
|
ifile.setCacheFileOnOpen(false);
|
|
|
|
ifile.allowBNPCacheFileOnOpen(false);
|
|
|
|
ifile.allowBNPCacheFileOnOpen(false);
|
|
|
|
if (ifile.open(lookup))
|
|
|
|
if (ifile.open(filepath))
|
|
|
|
return CAudioDecoderMP3::getInfo(&ifile, artist, title, length);
|
|
|
|
return CAudioDecoderMP3::getInfo(&ifile, artist, title, length);
|
|
|
|
|
|
|
|
|
|
|
|
nlwarning("Unable to open: '%s'", filepath.c_str());
|
|
|
|
nlwarning("Unable to open: '%s'", filepath.c_str());
|
|
|
|