aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/mad/decodermadfactory.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2014-07-11 05:59:55 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2014-07-11 05:59:55 +0000
commit4beb7f075d0cc4001d40406823b415602aeef2f5 (patch)
treee6f0fc557873d139c4bceb873d110681f3fbcc8c /src/plugins/Input/mad/decodermadfactory.cpp
parent887f15da100abe6fed9ff8cd83f8678fbf20b8de (diff)
downloadqmmp-4beb7f075d0cc4001d40406823b415602aeef2f5.tar.gz
qmmp-4beb7f075d0cc4001d40406823b415602aeef2f5.tar.bz2
qmmp-4beb7f075d0cc4001d40406823b415602aeef2f5.zip
improved rusxmms autodetection
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4351 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mad/decodermadfactory.cpp')
-rw-r--r--src/plugins/Input/mad/decodermadfactory.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/plugins/Input/mad/decodermadfactory.cpp b/src/plugins/Input/mad/decodermadfactory.cpp
index 2c8ca8f86..e45bc5d6c 100644
--- a/src/plugins/Input/mad/decodermadfactory.cpp
+++ b/src/plugins/Input/mad/decodermadfactory.cpp
@@ -38,6 +38,20 @@
// DecoderMADFactory
+DecoderMADFactory::DecoderMADFactory()
+{
+ //detecting rusxmms patch
+ m_using_rusxmms = false;
+ char str[] = { char(0xF2), char(0xE5), char(0xF1), char(0xF2), '\0'};
+ QTextCodec *codec = QTextCodec::codecForName ("windows-1251");
+ TagLib::String tstr(str);
+ if(codec->toUnicode(str) == QString::fromUtf8(tstr.toCString(true)))
+ {
+ qDebug("DecoderMADFactory: found taglib with rusxmms patch");
+ m_using_rusxmms = true;
+ }
+}
+
bool DecoderMADFactory::supports(const QString &source) const
{
QString ext = source.right(4).toLower();
@@ -153,10 +167,8 @@ QList<FileInfo *> DecoderMADFactory::createPlayList(const QString &fileName, boo
}
settings.endGroup();
-#ifdef Q_OS_WIN //rusxmms autodetection
- if(QFile::exists(qApp->applicationDirPath() + "/librcc.dll"))
- codec = QTextCodec::codecForName ("UTF-8");
-#endif
+ if(m_using_rusxmms)
+ codec = QTextCodec::codecForName ("UTF-8");
if (!codec)
codec = QTextCodec::codecForName ("UTF-8");
@@ -211,13 +223,13 @@ QList<FileInfo *> DecoderMADFactory::createPlayList(const QString &fileName, boo
MetaDataModel* DecoderMADFactory::createMetaDataModel(const QString &path, QObject *parent)
{
- return new MPEGMetaDataModel(path, parent);
+ return new MPEGMetaDataModel(m_using_rusxmms, path, parent);
}
void DecoderMADFactory::showSettings(QWidget *parent)
{
- SettingsDialog *s = new SettingsDialog(parent);
- s -> show();
+ SettingsDialog *s = new SettingsDialog(m_using_rusxmms, parent);
+ s->show();
}
void DecoderMADFactory::showAbout(QWidget *parent)