diff options
Diffstat (limited to 'src/plugins/General/lyrics/lyricsprovider.cpp')
| -rw-r--r-- | src/plugins/General/lyrics/lyricsprovider.cpp | 63 |
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; +} |
