aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/lyrics/lyricsprovider.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2019-09-27 18:49:36 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2019-09-27 18:49:36 +0000
commit1cb8bdcf72b15239843a23e25245def9f70c52f4 (patch)
treed1e0bfd92329684d2c37269a94355f041e769fec /src/plugins/General/lyrics/lyricsprovider.cpp
parent3044944b998f7ef1f0bfa6862ccb8ed4d5c6e1d5 (diff)
downloadqmmp-1cb8bdcf72b15239843a23e25245def9f70c52f4.tar.gz
qmmp-1cb8bdcf72b15239843a23e25245def9f70c52f4.tar.bz2
qmmp-1cb8bdcf72b15239843a23e25245def9f70c52f4.zip
prepare for ultimate lyrics plugin implementation
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9079 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/lyrics/lyricsprovider.cpp')
-rw-r--r--src/plugins/General/lyrics/lyricsprovider.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/plugins/General/lyrics/lyricsprovider.cpp b/src/plugins/General/lyrics/lyricsprovider.cpp
new file mode 100644
index 000000000..b37f8ccff
--- /dev/null
+++ b/src/plugins/General/lyrics/lyricsprovider.cpp
@@ -0,0 +1,63 @@
+#include "lyricsprovider.h"
+
+LyricsProvider::LyricsProvider()
+{
+
+}
+
+void LyricsProvider::setName(const QString &name)
+{
+ m_name = name;
+}
+
+void LyricsProvider::setTitle(const QString &title)
+{
+ m_title = title;
+}
+
+void LyricsProvider::setCharset(const QString &charset)
+{
+ m_charser = charset;
+}
+
+void LyricsProvider::setUrl(const QString &url)
+{
+ m_url = url;
+}
+
+void LyricsProvider::addUrlFormat(const QString &replace, const QString &with)
+{
+ m_urlFormats << UrlFormat{ .replace = replace, .with = with };
+}
+
+void LyricsProvider::addRule(const QList<QPair<QString, QString> > &args, bool exclude)
+{
+ Rule rule;
+ for(const QPair<QString, QString> &i : qAsConst(args))
+ {
+ Item item;
+ if(!i.first.isEmpty() && !i.second.isEmpty())
+ {
+ item.begin = i.first;
+ item.end = i.second;
+ }
+ else if(i.first.contains("://")) //url
+ {
+ item.url = i.first;
+ }
+ else
+ {
+ item.tag = i.first;
+ }
+ rule << item;
+ }
+ if(exclude)
+ m_excludeRules << rule;
+ else
+ m_extractRules << rule;
+}
+
+void LyricsProvider::addInvalidIndicator(const QString &indicator)
+{
+ m_invalidIndicators << indicator;
+}