Qmmp
Loading...
Searching...
No Matches
mediaplayer.h
1/***************************************************************************
2 * Copyright (C) 2008-2022 by Ilya Kotov *
3 * forkotov02@ya.ru *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
20#ifndef MEDIAPLAYER_H
21#define MEDIAPLAYER_H
22
23#include <QObject>
24#include <qmmp/soundcore.h>
25#include "playlistmanager.h"
26#include "qmmpui_export.h"
27
28class QmmpUiSettings;
29class QTimer;
30
31
35class QMMPUI_EXPORT MediaPlayer : public QObject
36{
37 Q_OBJECT
38public:
43 MediaPlayer(QObject *parent = nullptr);
56
57signals:
63
64public slots:
68 void play(qint64 offset = -1);
72 void stop();
76 void next();
80 void previous();
81
82private slots:
83 void playNext();
84 void updateNextUrl();
85 void processState(Qmmp::State state);
86 void updateMetaData();
87
88private:
89 QmmpUiSettings *m_settings;
90 PlayListManager *m_pl_manager;
91 SoundCore *m_core;
92 static MediaPlayer* m_instance;
93 int m_skips = 0;
94 QString m_nextUrl;
95 QTimer *m_finishTimer;
96};
97
98#endif
The MediaPlayer class provides a simple way to use SoundCore and PlayListModel together.
Definition mediaplayer.h:36
void previous()
void playbackFinished()
static MediaPlayer * instance()
MediaPlayer(QObject *parent=nullptr)
PlayListManager * playListManager()
void play(qint64 offset=-1)
The PlayListManager class is used to handle multiple playlists.
Definition playlistmanager.h:37
State
Definition qmmp.h:62
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition qmmpuisettings.h:37
The SoundCore class provides a simple interface for audio playback.
Definition soundcore.h:45