| 1 | /* smplayer, GUI front-end for mplayer.
|
|---|
| 2 | Copyright (C) 2006-2015 Ricardo Villalba <[email protected]>
|
|---|
| 3 |
|
|---|
| 4 | This program is free software; you can redistribute it and/or modify
|
|---|
| 5 | it under the terms of the GNU General Public License as published by
|
|---|
| 6 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 7 | (at your option) any later version.
|
|---|
| 8 |
|
|---|
| 9 | This program is distributed in the hope that it will be useful,
|
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 12 | GNU General Public License for more details.
|
|---|
| 13 |
|
|---|
| 14 | You should have received a copy of the GNU General Public License
|
|---|
| 15 | along with this program; if not, write to the Free Software
|
|---|
| 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | /***********************************************************************
|
|---|
| 20 | * Copyright 2012 Eike Hein <[email protected]>
|
|---|
| 21 | * Copyright 2012 Bernd Buschinski <[email protected]>
|
|---|
| 22 | *
|
|---|
| 23 | * This program is free software; you can redistribute it and/or
|
|---|
| 24 | * modify it under the terms of the GNU General Public License as
|
|---|
| 25 | * published by the Free Software Foundation; either version 2 of
|
|---|
| 26 | * the License or (at your option) version 3 or any later version
|
|---|
| 27 | * accepted by the membership of KDE e.V. (or its successor approved
|
|---|
| 28 | * by the membership of KDE e.V.), which shall act as a proxy
|
|---|
| 29 | * defined in Section 14 of version 3 of the license.
|
|---|
| 30 | *
|
|---|
| 31 | * This program is distributed in the hope that it will be useful,
|
|---|
| 32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 34 | * GNU General Public License for more details.
|
|---|
| 35 | *
|
|---|
| 36 | * You should have received a copy of the GNU General Public License
|
|---|
| 37 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 38 | ***********************************************************************/
|
|---|
| 39 |
|
|---|
| 40 | #include "mediaplayer2.h"
|
|---|
| 41 | #include "mpris2.h"
|
|---|
| 42 | #include "basegui.h"
|
|---|
| 43 | #include <QApplication>
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 | MediaPlayer2::MediaPlayer2(BaseGui* gui, QObject* parent)
|
|---|
| 47 | : QDBusAbstractAdaptor(parent),
|
|---|
| 48 | m_gui(gui)
|
|---|
| 49 | {
|
|---|
| 50 | // connect(m_gui, SIGNAL(fullScreen(bool)), this, SLOT(emitFullscreenChange(bool)));
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | MediaPlayer2::~MediaPlayer2()
|
|---|
| 54 | {
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
| 57 | bool MediaPlayer2::CanQuit() const
|
|---|
| 58 | {
|
|---|
| 59 | return true;
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 | void MediaPlayer2::Quit() const
|
|---|
| 63 | {
|
|---|
| 64 | m_gui->runActions("close");
|
|---|
| 65 | }
|
|---|
| 66 |
|
|---|
| 67 | bool MediaPlayer2::CanRaise() const
|
|---|
| 68 | {
|
|---|
| 69 | return true;
|
|---|
| 70 | }
|
|---|
| 71 |
|
|---|
| 72 | void MediaPlayer2::Raise() const
|
|---|
| 73 | {
|
|---|
| 74 | m_gui->raise();
|
|---|
| 75 | }
|
|---|
| 76 |
|
|---|
| 77 | bool MediaPlayer2::Fullscreen() const
|
|---|
| 78 | {
|
|---|
| 79 | return m_gui->isFullScreen();
|
|---|
| 80 | }
|
|---|
| 81 |
|
|---|
| 82 | void MediaPlayer2::setFullscreen(bool fullscreen) const
|
|---|
| 83 | {
|
|---|
| 84 | m_gui->toggleFullscreen(fullscreen);
|
|---|
| 85 | }
|
|---|
| 86 |
|
|---|
| 87 | void MediaPlayer2::emitFullscreenChange(bool fullscreen) const
|
|---|
| 88 | {
|
|---|
| 89 | QVariantMap properties;
|
|---|
| 90 | properties["Fullscreen"] = fullscreen;
|
|---|
| 91 | Mpris2::signalPropertiesChange(this, properties);
|
|---|
| 92 | }
|
|---|
| 93 |
|
|---|
| 94 | bool MediaPlayer2::CanSetFullscreen() const
|
|---|
| 95 | {
|
|---|
| 96 | return true;
|
|---|
| 97 | }
|
|---|
| 98 |
|
|---|
| 99 | bool MediaPlayer2::HasTrackList() const
|
|---|
| 100 | {
|
|---|
| 101 | return false;
|
|---|
| 102 | }
|
|---|
| 103 |
|
|---|
| 104 | QString MediaPlayer2::Identity() const
|
|---|
| 105 | {
|
|---|
| 106 | return QString("SMPlayer");
|
|---|
| 107 | }
|
|---|
| 108 |
|
|---|
| 109 | QString MediaPlayer2::DesktopEntry() const
|
|---|
| 110 | {
|
|---|
| 111 | return QString("smplayer");
|
|---|
| 112 | }
|
|---|
| 113 |
|
|---|
| 114 | QStringList MediaPlayer2::SupportedUriSchemes() const
|
|---|
| 115 | {
|
|---|
| 116 | //TODO: Implement me
|
|---|
| 117 | return QStringList();
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 | QStringList MediaPlayer2::SupportedMimeTypes() const
|
|---|
| 121 | {
|
|---|
| 122 | //TODO: Implement me
|
|---|
| 123 | return QStringList();
|
|---|
| 124 | }
|
|---|
| 125 |
|
|---|
| 126 | #include "moc_mediaplayer2.cpp"
|
|---|