00001 /*************************************************************************** 00002 copyright : (C) 2005 by Martin Aumueller 00003 email : aumuell@reserv.at 00004 ***************************************************************************/ 00005 00006 /*************************************************************************** 00007 * This library is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU Lesser General Public License version * 00009 * 2.1 as published by the Free Software Foundation. * 00010 * * 00011 * This library is distributed in the hope that it will be useful, but * 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00014 * Lesser General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU Lesser General Public * 00017 * License along with this library; if not, write to the Free Software * 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * 00019 * MA 02110-1301 USA * 00020 ***************************************************************************/ 00021 00022 // (c) 2005 Martin Aumueller <aumuell@reserv.at> 00023 // See COPYING file for licensing information 00024 00025 #include "taglib_wmafiletyperesolver.h" 00026 #include "wmafile.h" 00027 00028 TagLib::File *WMAFileTypeResolver::createFile(const char *fileName, 00029 bool readProperties, 00030 TagLib::AudioProperties::ReadStyle propertiesStyle) const 00031 { 00032 const char *ext = strrchr(fileName, '.'); 00033 if(ext && (!strcasecmp(ext, ".wma") || !strcasecmp(ext, ".asf"))) 00034 { 00035 TagLib::WMA::File *f = new TagLib::WMA::File(fileName, readProperties, propertiesStyle); 00036 if(f->isValid()) 00037 return f; 00038 else 00039 { 00040 delete f; 00041 } 00042 } 00043 00044 return 0; 00045 }