def __init__(self, tags, tag_length=None, frame_count=0): """Constructs an ApeTag from a list of ApeTagItem objects. tag_length is an optional total length integer. frame_count is an optional number of PCM frames to be used by cuesheets.""" ApeTag.__init__(self, tags=tags, tag_length=tag_length) self.frame_count = frame_count
def converted(cls, metadata): if ((metadata is None) or (isinstance(metadata, WavePackAPEv2))): return metadata elif (isinstance(metadata, ApeTag)): return WavePackAPEv2(metadata.tags) else: return WavePackAPEv2(ApeTag.converted(metadata).tags)
def __unicode__(self): if ('Cuesheet' not in self.keys()): return ApeTag.__unicode__(self) else: import cue try: return u"%s%sCuesheet:\n%s" % \ (MetaData.__unicode__(self), os.linesep * 2, sheet_to_unicode( cue.parse( cue.tokens(unicode(self['Cuesheet']).encode( 'ascii', 'replace'))), self.frame_count)) except cue.CueException: return ApeTag.__unicode__(self)
def converted(cls, metadata): """Converts a MetaData object to a WavPackAPEv2 object.""" if ((metadata is None) or (isinstance(metadata, WavPackAPEv2))): return metadata elif (isinstance(metadata, ApeTag)): return WavPackAPEv2(metadata.tags) else: return WavPackAPEv2(ApeTag.converted(metadata).tags)
def __comment_pairs__(self): return filter(lambda pair: pair[0] != 'Cuesheet', ApeTag.__comment_pairs__(self))
def __init__(self, tags, tag_length=None, frame_count=0): ApeTag.__init__(self, tags=tags, tag_length=tag_length) self.frame_count = frame_count