Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2008-2017 by Ilya Kotov * 00003 * forkotov02@hotmail.ru * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00019 ***************************************************************************/ 00020 #ifndef MEDIAPLAYER_H 00021 #define MEDIAPLAYER_H 00022 00023 #include <QObject> 00024 #include <qmmp/soundcore.h> 00025 #include "playlistmanager.h" 00026 00027 00028 class QmmpUiSettings; 00029 class QTimer; 00030 00031 00035 class MediaPlayer : public QObject 00036 { 00037 Q_OBJECT 00038 public: 00043 MediaPlayer(QObject *parent = 0); 00047 ~MediaPlayer(); 00051 static MediaPlayer* instance(); 00055 PlayListManager *playListManager(); 00056 00057 signals: 00062 void playbackFinished(); 00063 00064 public slots: 00068 void play(qint64 offset = -1); 00072 void stop(); 00076 void next(); 00080 void previous(); 00081 00082 private slots: 00083 void playNext(); 00084 void updateNextUrl(); 00085 void processState(Qmmp::State state); 00086 void updateMetaData(); 00087 00088 private: 00089 QmmpUiSettings *m_settings; 00090 PlayListManager *m_pl_manager; 00091 SoundCore *m_core; 00092 static MediaPlayer* m_instance; 00093 int m_skips; 00094 QString m_nextUrl; 00095 QTimer *m_finishTimer; 00096 }; 00097 00098 #endif