diff options
Diffstat (limited to 'src/plugins/PlaylistFormats/pls')
| -rw-r--r-- | src/plugins/PlaylistFormats/pls/CMakeLists.txt | 49 | ||||
| -rw-r--r-- | src/plugins/PlaylistFormats/pls/pls.pro | 35 | ||||
| -rw-r--r-- | src/plugins/PlaylistFormats/pls/plsplaylistformat.cpp | 103 | ||||
| -rw-r--r-- | src/plugins/PlaylistFormats/pls/plsplaylistformat.h | 48 |
4 files changed, 0 insertions, 235 deletions
diff --git a/src/plugins/PlaylistFormats/pls/CMakeLists.txt b/src/plugins/PlaylistFormats/pls/CMakeLists.txt deleted file mode 100644 index 29c49f73c..000000000 --- a/src/plugins/PlaylistFormats/pls/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -project(libplsplaylistformat) - -cmake_minimum_required(VERSION 2.4.7) - -if(COMMAND cmake_policy) -cmake_policy(SET CMP0003 NEW) -endif(COMMAND cmake_policy) - - -# qt plugin -ADD_DEFINITIONS( -Wall ) -ADD_DEFINITIONS(${QT_DEFINITIONS}) -ADD_DEFINITIONS(-DQT_PLUGIN) -ADD_DEFINITIONS(-DQT_NO_DEBUG) -ADD_DEFINITIONS(-DQT_SHARED) -ADD_DEFINITIONS(-DQT_THREAD) - -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -SET(QT_INCLUDES - ${QT_INCLUDES} - ${CMAKE_CURRENT_SOURCE_DIR}/../../../ -) - -# libqmmpui -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) -link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui) - -SET(libplsplaylistformat_SRCS - plsplaylistformat.cpp -) - -SET(libplsplaylistformat_MOC_HDRS - plsplaylistformat.h -) - -QT4_ADD_RESOURCES(libplsplaylistformat_RCC_SRCS ${libplsplaylistformat_RCCS}) - -QT4_WRAP_CPP(libplsplaylistformat_MOC_SRCS ${libplsplaylistformat_MOC_HDRS}) - - -# Don't forget to include output directory, otherwise -# the UI file won't be wrapped! -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -ADD_LIBRARY(plsplaylistformat MODULE ${libplsplaylistformat_SRCS} ${libplsplaylistformat_MOC_SRCS}) -add_dependencies(plsplaylistformat qmmpui) -target_link_libraries(plsplaylistformat ${QT_LIBRARIES} -lqmmpui) -install(TARGETS plsplaylistformat DESTINATION ${LIB_DIR}/qmmp/PlaylistFormats) diff --git a/src/plugins/PlaylistFormats/pls/pls.pro b/src/plugins/PlaylistFormats/pls/pls.pro deleted file mode 100644 index 006e0aa63..000000000 --- a/src/plugins/PlaylistFormats/pls/pls.pro +++ /dev/null @@ -1,35 +0,0 @@ -include(../../plugins.pri) - -CONFIG += release \ -warn_on \ -plugin \ - lib - -TARGET =$$PLUGINS_PREFIX/PlaylistFormats/plsplaylistformat - - -TEMPLATE = lib -QMAKE_LIBDIR += ../../../../lib - -INCLUDEPATH += ../../../../src - -SOURCES += plsplaylistformat.cpp - -HEADERS += plsplaylistformat.h - -unix { - isEmpty(LIB_DIR){ - LIB_DIR = /lib - } - target.path = $$LIB_DIR/qmmp/PlaylistFormats - INSTALLS += target - - QMAKE_CLEAN =$$PLUGINS_PREFIX/PlaylistFormats/plsplaylistformat.so - LIBS += -lqmmpui -} - -win32 { - LIBS += -lqmmpui0 - QMAKE_LIBDIR += ../../../../bin -} - diff --git a/src/plugins/PlaylistFormats/pls/plsplaylistformat.cpp b/src/plugins/PlaylistFormats/pls/plsplaylistformat.cpp deleted file mode 100644 index a251276d0..000000000 --- a/src/plugins/PlaylistFormats/pls/plsplaylistformat.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include <QFileInfo> -#include <QtPlugin> - -#include "plsplaylistformat.h" - -bool PLSPlaylistFormat::hasFormat(const QString & f) -{ - foreach(QString s,m_supported_formats) - if (f == s) - return true; - - return false; -} - -QStringList PLSPlaylistFormat::getExtensions() const -{ - return m_supported_formats; -} - -PLSPlaylistFormat::PLSPlaylistFormat() -{ - m_supported_formats << "pls"; -} - -QString PLSPlaylistFormat::name() const -{ - return "PLSPlaylistFormat"; -} - - -QStringList PLSPlaylistFormat::decode(const QString & contents) -{ - QStringList out; - QStringList splitted = contents.split("\n"); - if (!splitted.isEmpty()) - { - if (splitted.takeAt(0).toLower().contains("[playlist]")) - { - foreach(QString str, splitted) - { - if (str.startsWith("File")) - { - QString unverified = str.remove(0,str.indexOf(QChar('=')) + 1); - unverified = unverified.trimmed(); - if (unverified.startsWith("http://")) - { - out << unverified; - } - else /*if (QFileInfo(unverified).exists())*/ - out << QFileInfo(unverified).absoluteFilePath(); - /*else - qWarning("File %s does not exist", qPrintable(unverified));*/ - } - } - return out; - } - } - else - qWarning("Error parsing PLS format"); - - return QStringList(); -} - -QString PLSPlaylistFormat::encode(const QList<PlayListItem *> & contents) -{ - QStringList out; - out << QString("[playlist]"); - int counter = 1; - foreach(PlayListItem* f,contents) - { - QString begin = "File" + QString::number(counter) + "="; - out.append(begin + f->url()); - begin = "Title" + QString::number(counter) + "="; - out.append(begin + f->value(Qmmp::TITLE)); - begin = "Length" + QString::number(counter) + "="; - out.append(begin + QString::number(f->length())); - counter ++; - } - out << "NumberOfEntries=" + QString::number(contents.count()); - return out.join("\n"); -} - -Q_EXPORT_PLUGIN2(plsplaylistformat, PLSPlaylistFormat) diff --git a/src/plugins/PlaylistFormats/pls/plsplaylistformat.h b/src/plugins/PlaylistFormats/pls/plsplaylistformat.h deleted file mode 100644 index 4d770ee74..000000000 --- a/src/plugins/PlaylistFormats/pls/plsplaylistformat.h +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef PLSPLAYLISTFORMAT_H -#define PLSPLAYLISTFORMAT_H - -#include <QObject> -#include <QString> -#include <QStringList> -#include <qmmpui/playlistformat.h> -#include <qmmpui/playlistitem.h> - -/*! - * Class for PLS playlist format parsing - * @author Vladimir Kuznetsov <vovanec@gmail.com> - */ -class PLSPlaylistFormat : public QObject, public PlayListFormat -{ - Q_OBJECT - Q_INTERFACES(PlayListFormat) -public: - PLSPlaylistFormat(); - virtual QStringList getExtensions()const; - virtual bool hasFormat(const QString&); - virtual QStringList decode(const QString& contents); - virtual QString encode(const QList<PlayListItem*>& contents); - virtual QString name()const; -protected: - QStringList m_supported_formats; -}; - -#endif |
