~ubuntu-branches/ubuntu/karmic/quodlibet/karmic

« back to all changes in this revision

Viewing changes to quodlibet/formats/wavpack.py

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2009-01-30 23:55:34 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20090130235534-l4e72ulw0vqfo17w
Tags: 2.0-1ubuntu1
* Merge from Debian experimental (LP: #276856), remaining Ubuntu changes:
  + debian/patches/40-use-music-profile.patch:
    - Use the "Music and Movies" pipeline per default.
* Refresh the above patch for new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2004-2005 Joe Wreschnig, Michael Urman
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License version 2 as
 
5
# published by the Free Software Foundation
 
6
#
 
7
# $Id: wavpack.py 4330 2008-09-14 03:19:26Z piman $
 
8
 
 
9
from quodlibet.formats._apev2 import APEv2File
 
10
 
 
11
extensions = [".wv"]
 
12
try:
 
13
    from mutagen.wavpack import WavPack
 
14
except ImportError:
 
15
    extensions = []
 
16
 
 
17
class WavpackFile(APEv2File):
 
18
    format = "WavPack"
 
19
    
 
20
    def __init__(self, filename):
 
21
        audio = WavPack(filename)
 
22
        super(WavpackFile, self).__init__(filename, audio)
 
23
        self["~#length"] = int(audio.info.length)
 
24
        self.sanitize(filename)
 
25
 
 
26
info = WavpackFile