From db21f3b3428d88b19d2f82ae933830153310a1f1 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 26 Dec 2009 22:41:24 +0000 Subject: enabled replaygain support (for mp3 file with ape tags only) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1453 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/mad/decodermadfactory.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/plugins/Input/mad/decodermadfactory.cpp') diff --git a/src/plugins/Input/mad/decodermadfactory.cpp b/src/plugins/Input/mad/decodermadfactory.cpp index fa89e5f5d..2ec86e011 100644 --- a/src/plugins/Input/mad/decodermadfactory.cpp +++ b/src/plugins/Input/mad/decodermadfactory.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -30,7 +30,6 @@ #include #include #include - #include "mpegmetadatamodel.h" #include "settingsdialog.h" #include "decoder_mad.h" @@ -94,9 +93,9 @@ const DecoderProperties DecoderMADFactory::properties() const return properties; } -Decoder *DecoderMADFactory::create(const QString&, QIODevice *input) +Decoder *DecoderMADFactory::create(const QString &url, QIODevice *input) { - return new DecoderMAD(input); + return new DecoderMAD(url, input); } QList DecoderMADFactory::createPlayList(const QString &fileName, bool useMetaData) @@ -117,21 +116,17 @@ QList DecoderMADFactory::createPlayList(const QString &fileName, boo tag_array[1] = settings.value("tag_2", SettingsDialog::Disabled).toInt(); tag_array[2] = settings.value("tag_3", SettingsDialog::Disabled).toInt(); - + QByteArray name; for (int i = 0; i < 3; ++i) { switch ((uint) tag_array[i]) { case SettingsDialog::ID3v1: - { codec = QTextCodec::codecForName(settings.value("ID3v1_encoding","ISO-8859-1") .toByteArray ()); tag = fileRef.ID3v1Tag(); break; - } case SettingsDialog::ID3v2: - { - QByteArray name; name = settings.value("ID3v2_encoding","UTF-8").toByteArray (); if (name.contains("UTF")) codec = QTextCodec::codecForName ("UTF-8"); @@ -139,18 +134,13 @@ QList DecoderMADFactory::createPlayList(const QString &fileName, boo codec = QTextCodec::codecForName(name); tag = fileRef.ID3v2Tag(); break; - } case SettingsDialog::APE: - { codec = QTextCodec::codecForName ("UTF-8"); tag = fileRef.APETag(); break; - } case SettingsDialog::Disabled: - { break; } - } if (tag && !tag->isEmpty()) break; } -- cgit v1.2.3-13-gbd6f