-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project cleanup, HTTP stream reader update
- Loading branch information
Showing
4 changed files
with
206 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2012 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 <QAction> | ||
#include <QApplication> | ||
#include <qmmp/soundcore.h> | ||
#include <qmmpui/uihelper.h> | ||
#include <qmmpui/playlistmanager.h> | ||
#include <qmmpui/playlistitem.h> | ||
#include <qmmpui/mediaplayer.h> | ||
#include <qmmp/inputsource.h> | ||
#include <qmmp/inputsourcefactory.h> | ||
#include <QMessageBox> | ||
#include "streambrowser.h" | ||
|
||
StreamBrowser::StreamBrowser(QObject *parent) : QObject(parent) | ||
{ | ||
m_action = new QAction(tr("Youtube"), this); | ||
m_action->setIcon(QIcon::fromTheme("applications-internet")); | ||
m_action->setShortcut(tr("Ctrl+Y")); | ||
UiHelper::instance()->addAction(m_action, UiHelper::TOOLS_MENU); | ||
connect (m_action, SIGNAL(triggered ()), SLOT(showStreamWindow())); | ||
} | ||
|
||
StreamBrowser::~StreamBrowser() | ||
{} | ||
|
||
void StreamBrowser::showStreamWindow() | ||
{ | ||
QMessageBox::about (NULL, tr("About Youtube Plugin"), | ||
tr("Qmmp Youtube Plugin")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2012 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 STREAMBROWSER_H | ||
#define STREAMBROWSER_H | ||
|
||
#include <QPointer> | ||
#include <qmmpui/general.h> | ||
#include <qmmp/qmmp.h> | ||
|
||
class QAction; | ||
class StreamWindow; | ||
|
||
/** | ||
@author Ilya Kotov <forkotov02@hotmail.ru> | ||
*/ | ||
|
||
class StreamBrowser : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
StreamBrowser(QObject *parent = 0); | ||
|
||
~StreamBrowser(); | ||
|
||
private slots: | ||
void showStreamWindow(); | ||
|
||
private: | ||
QAction *m_action; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2012 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 <QMessageBox> | ||
#include "streambrowser.h" | ||
#include "streambrowserfactory.h" | ||
|
||
const GeneralProperties StreamBrowserFactory::properties() const | ||
{ | ||
GeneralProperties properties; | ||
properties.name = tr("Youtube Plugin"); | ||
properties.shortName = "youtube"; | ||
properties.hasAbout = true; | ||
properties.hasSettings = false; | ||
properties.visibilityControl = false; | ||
return properties; | ||
} | ||
|
||
QObject *StreamBrowserFactory::create(QObject *parent) | ||
{ | ||
return new StreamBrowser(parent); | ||
} | ||
|
||
QDialog *StreamBrowserFactory::createConfigDialog(QWidget *parent) | ||
{ | ||
Q_UNUSED(parent); | ||
return 0; | ||
} | ||
|
||
void StreamBrowserFactory::showAbout(QWidget *parent) | ||
{ | ||
QMessageBox::about (parent, tr("About Stream Browser Plugin"), | ||
tr("Qmmp Stream Browser Plugin")+"\n"+ | ||
tr("This plugin allows one to add stream from IceCast stream directory")+"\n"+ | ||
tr("Written by: Ilya Kotov <forkotov02@hotmail.ru>")); | ||
} | ||
|
||
QTranslator *StreamBrowserFactory::createTranslator(QObject *parent) | ||
{ | ||
QTranslator *translator = new QTranslator(parent); | ||
QString locale = Qmmp::systemLanguageID(); | ||
translator->load(QString(":/streambrowser_plugin_") + locale); | ||
return translator; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2012 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 STREAMBROWSERFACTORY_H | ||
#define STREAMBROWSERFACTORY_H | ||
|
||
/** | ||
@author Ilya Kotov <forkotov02@hotmail.ru> | ||
*/ | ||
#include <QObject> | ||
#include <QTranslator> | ||
#include <QDialog> | ||
|
||
#include <qmmpui/general.h> | ||
#include <qmmpui/generalfactory.h> | ||
|
||
class StreamBrowserFactory : public QObject, public GeneralFactory | ||
{ | ||
Q_OBJECT | ||
Q_PLUGIN_METADATA(IID "org.qmmp.qmmpui.GeneralFactoryInterface.1.0") | ||
Q_INTERFACES(GeneralFactory) | ||
public: | ||
const GeneralProperties properties() const; | ||
QObject *create(QObject *parent); | ||
QDialog *createConfigDialog(QWidget *parent); | ||
void showAbout(QWidget *parent); | ||
QTranslator *createTranslator(QObject *parent); | ||
}; | ||
|
||
#endif |