Exemple #1
0
            shutil.move(encode_filename(wvc_filename),
                        encode_filename(new_wvc_filename))
        return new_filename

    def _save(self, filename, metadata):
        with open(self.filename + "", "w") as cuesheet:
            _write = partial(writeline, cuesheet)
            _write('PERFORMER "%s"' %
                    (self.tracks[0].metadata.get("albumartist")))
            _write('TITLE "%s"' %
                    (self.tracks[0].metadata.get("album")))
            _write('FILE %s' % self.fileline)
            self.tracks.sort(key=lambda track: track.tracknumber)
            for track in self.tracks:
                _write("TRACK %02i AUDIO" % track.tracknumber, 2)
                for index, value in track.indexes.iteritems():
                    _write("INDEX %s %s" % (index, value), 4)
                for line in track.metadata_to_kv():
                    _write(line, 4)

    def _save_and_rename(self, old_filename, metadata):
        self._save(old_filename, metadata)
        return self._rename(self.filename, metadata)

def writeline(_file, line, indent=0):
        _line = b" " * indent + line + b"\n"
        _line = _line.encode("utf-8")
        _file.write(_line)

register_format(CueSheet)
Exemple #2
0
        if config.setting['write_id3v23']:
            tags.update_to_v23()
            tags.save(encode_filename(filename), v2=3, v1=v1)
        else:
            tags.update_to_v24()
            tags.save(encode_filename(filename), v2=4, v1=v1)

        #if self._IsMP3 and settings["remove_ape_from_mp3"]:
        #    try: mutagen.apev2.delete(encode_filename(filename))
        #    except: pass

    def supports_tag(self, name):
        return name in self.__rtranslate or name in self.__rtranslate_freetext\
            or name.startswith('performer:')\
            or name.startswith('lyrics:')\
            or name in self.__other_supported_tags


class DSFFile(ID3File_DSF):
    """DSF file."""
    EXTENSIONS = [".dsf"]
    NAME = "DSF Audio"
    _File = DSF
    
    def _info(self, metadata, file):
        super(DSFFile, self)._info(metadata, file)
        metadata['~format'] = 'DSF DSD Audio'
        
register_format(DSFFile)
Exemple #3
0

class MP3FileCompliant(MP3File):
    """Alternate MP3 format class which uses single-value TXXX frames."""

    build_TXXX = build_compliant_TXXX


class TrueAudioFileCompliant(TrueAudioFile):
    """Alternate TTA format class which uses single-value TXXX frames."""

    build_TXXX = build_compliant_TXXX


class DSFFileCompliant(DSFFile):
    """Alternate DSF format class which uses single-value TXXX frames."""

    build_TXXX = build_compliant_TXXX


class AiffFileCompliant(AiffFile):
    """Alternate AIFF format class which uses single-value TXXX frames."""

    build_TXXX = build_compliant_TXXX


register_format(MP3FileCompliant)
register_format(TrueAudioFileCompliant)
register_format(DSFFileCompliant)
register_format(AiffFileCompliant)
Exemple #4
0
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

PLUGIN_NAME = 'Video tools'
PLUGIN_AUTHOR = 'Philipp Wolfer'
PLUGIN_DESCRIPTION = 'Improves the video support in Picard by adding support for Matroska, WebM, AVI, QuickTime and MPEG files (renaming and fingerprinting only, no tagging) and providing $is_audio() and $is_video() scripting functions.'
PLUGIN_VERSION = "0.3"
PLUGIN_API_VERSIONS = ["1.3.0", "2.0"]
PLUGIN_LICENSE = "GPL-2.0-or-later"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from picard.formats import register_format
from picard.script import register_script_function
from picard.plugins.videotools.formats import MatroskaFile, MpegFile, QuickTimeFile, RiffFile
from picard.plugins.videotools.script import is_audio, is_video


# Now this is kind of a hack, but Picard won't process registered objects that
# are in a submodule of a plugin. I still want the code to be in separate files.
MatroskaFile.__module__ = MpegFile.__module__ = QuickTimeFile.__module__ = \
    RiffFile.__module__ = is_audio.__module__ = is_video.__module__ = \
    __name__

register_format(MatroskaFile)
register_format(MpegFile)
register_format(QuickTimeFile)
register_format(RiffFile)

register_script_function(is_audio)
register_script_function(is_video)
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

PLUGIN_NAME = 'Video tools'
PLUGIN_AUTHOR = 'Philipp Wolfer'
PLUGIN_DESCRIPTION = 'Improves the video support in Picard by adding support for Matroska, WebM, AVI, QuickTime and MPEG files (renaming and fingerprinting only, no tagging) and providing $is_audio() and $is_video() scripting functions.'
PLUGIN_VERSION = "0.1"
PLUGIN_API_VERSIONS = ["1.3.0"]
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"

from picard.formats import register_format
from picard.script import register_script_function
from picard.plugins.videotools.formats import MatroskaFile, MpegFile, QuickTimeFile, RiffFile
from picard.plugins.videotools.script import is_audio, is_video


# Now this is kind of a hack, but Picard won't process registered objects that
# are in a submodule of a plugin. I still want the code to be in separate files.
MatroskaFile.__module__ = MpegFile.__module__ = QuickTimeFile.__module__ = \
    RiffFile.__module__ = is_audio.__module__ = is_video.__module__ = \
    __name__

register_format(MatroskaFile)
register_format(MpegFile)
register_format(QuickTimeFile)
register_format(RiffFile)

register_script_function(is_audio)
register_script_function(is_video)