Enabling the APE support again. Adding check in the tag reading if file isNull instead.

This commit is contained in:
Daniel Önnerby 2008-04-07 19:30:17 +00:00
parent 40e021d3d8
commit fc3d22bfef

View File

@ -84,7 +84,7 @@ bool TagReaderTaglib::CanReadTag(const utfchar *extension){
if( ext==UTF("mp3") || if( ext==UTF("mp3") ||
ext==UTF("ogg") || ext==UTF("ogg") ||
ext==UTF("flac") || ext==UTF("flac") ||
//ext==UTF("ape") || ext==UTF("ape") ||
ext==UTF("mpc") ext==UTF("mpc")
) { ) {
return true; return true;
@ -129,32 +129,34 @@ bool TagReaderTaglib::GetOGGTag(musik::core::Track *track){
bool TagReaderTaglib::GetGenericTag(musik::core::Track *track){ bool TagReaderTaglib::GetGenericTag(musik::core::Track *track){
TagLib::FileRef oFile(track->GetValue("path")); TagLib::FileRef oFile(track->GetValue("path"));
TagLib::Tag *tag = oFile.tag(); if(!oFile.isNull()){
TagLib::AudioProperties *oAudioProperties = oFile.audioProperties(); TagLib::Tag *tag = oFile.tag();
if(tag){ TagLib::AudioProperties *oAudioProperties = oFile.audioProperties();
// TITLE if(tag){
if(!tag->title().isEmpty()){ // TITLE
this->SetTagValue("title",tag->title(),track); if(!tag->title().isEmpty()){
}else{ this->SetTagValue("title",tag->title(),track);
this->SetTagValue("title",track->GetValue("filename"),track); }else{
} this->SetTagValue("title",track->GetValue("filename"),track);
}
// ALBUM // ALBUM
this->SetTagValue("album",tag->album(),track); this->SetTagValue("album",tag->album(),track);
// ARTISTS // ARTISTS
this->SetSlashSeparatedValues("artist",tag->album(),track); this->SetSlashSeparatedValues("artist",tag->album(),track);
// GENRES // GENRES
this->SetTagValue("genre",tag->genre(),track); this->SetTagValue("genre",tag->genre(),track);
// COMMENT // COMMENT
this->SetTagValue("comment",tag->comment(),track); this->SetTagValue("comment",tag->comment(),track);
// TRACK // TRACK
this->SetTagValue("track",tag->track(),track); this->SetTagValue("track",tag->track(),track);
// TRACK // TRACK
this->SetTagValue("year",tag->year(),track); this->SetTagValue("year",tag->year(),track);
this->SetAudioProperties(oAudioProperties,track); this->SetAudioProperties(oAudioProperties,track);
return true; return true;
}
} }
return false; return false;