~ubuntu-branches/ubuntu/karmic/taglib-extras/karmic

« back to all changes in this revision

Viewing changes to taglib-extras/wav/wavfiletyperesolver.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2009-04-01 15:35:05 UTC
  • Revision ID: james.westby@ubuntu.com-20090401153505-vwi459v8y2c1xnbr
Tags: upstream-0.1.1
ImportĀ upstreamĀ versionĀ 0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    copyright            : (C) 2006 by Martin Aumueller
 
3
    email                : aumuell@reserv.at
 
4
 ***************************************************************************/
 
5
 
 
6
/***************************************************************************
 
7
 *   This library is free software; you can redistribute it and/or modify  *
 
8
 *   it  under the terms of the GNU Lesser General Public License version  *
 
9
 *   2.1 as published by the Free Software Foundation.                     *
 
10
 *                                                                         *
 
11
 *   This library is distributed in the hope that it will be useful, but   *
 
12
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 
14
 *   Lesser General Public License for more details.                       *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU Lesser General Public      *
 
17
 *   License along with this library; if not, write to the Free Software   *
 
18
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,            *
 
19
 *   MA  02110-1301  USA                                                   *
 
20
 ***************************************************************************/
 
21
 
 
22
#include "wavfiletyperesolver.h"
 
23
#include "wavfile.h"
 
24
 
 
25
#include <string.h>
 
26
#include <stdio.h>
 
27
 
 
28
TagLib::File *WavFileTypeResolver::createFile(TagLib::FileName fileName,
 
29
        bool readProperties,
 
30
        TagLib::AudioProperties::ReadStyle propertiesStyle) const
 
31
{
 
32
    if(CheckExtension(fileName, ".wav"))
 
33
    {
 
34
        TagLib::Wav::File *f = new TagLib::Wav::File(fileName, readProperties, propertiesStyle);
 
35
        if(f->isValid())
 
36
            return f;
 
37
        else
 
38
            delete f;
 
39
    }
 
40
 
 
41
    return 0;
 
42
}