From b3463bee9baed4d4f9e226763281be2d6b84f9af Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 28 Aug 2017 17:12:18 +0000 Subject: added Effect::findFactory function git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7404 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmp/effect.cpp | 13 ++++++++++++- src/qmmp/effect.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/qmmp/effect.cpp b/src/qmmp/effect.cpp index 97b7104d3..008c5efac 100644 --- a/src/qmmp/effect.cpp +++ b/src/qmmp/effect.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007-2014 by Ilya Kotov * + * Copyright (C) 2007-2017 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -179,3 +179,14 @@ bool Effect::isEnabled(EffectFactory* factory) loadPlugins(); return m_enabledNames.contains(factory->properties().shortName); } + +EffectFactory *Effect::findFactory(const QString &shortName) +{ + loadPlugins(); + foreach (EffectFactory *f, factories()) + { + if(shortName == f->properties().shortName) + return f; + } + return 0; +} diff --git a/src/qmmp/effect.h b/src/qmmp/effect.h index 731f8b539..36f5e532c 100644 --- a/src/qmmp/effect.h +++ b/src/qmmp/effect.h @@ -105,6 +105,8 @@ public: */ static bool isEnabled(EffectFactory* factory); + static EffectFactory *findFactory(const QString &shortName); + private: EffectFactory *m_factory; quint32 m_freq; -- cgit v1.2.3-13-gbd6f