Qmmp
Loading...
Searching...
No Matches
mediaplayer.h
1/***************************************************************************
2 * Copyright (C) 2008-2025 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();
73 void playFromPosition(qint64 offset);
77 void stop();
81 void next();
85 void previous();
86
87private slots:
88 void playNext();
89 void updateNextUrl();
90 void processState(Qmmp::State state);
91 void updateMetaData();
92 void onCurrentTrackRemoved();
93
94private:
95 QmmpUiSettings *m_settings;
96 PlayListManager *m_pl_manager;
97 SoundCore *m_core;
98 static MediaPlayer* m_instance;
99 int m_skips = 0;
100 QString m_nextUrl;
101 QTimer *m_finishTimer;
102};
103
104#endif
void previous()
void playFromPosition(qint64 offset)
void playbackFinished()
static MediaPlayer * instance()
MediaPlayer(QObject *parent=nullptr)
PlayListManager * playListManager()
The PlayListManager class is used to handle multiple playlists.
Definition playlistmanager.h:37
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition qmmpuisettings.h:36
The SoundCore class provides a simple interface for audio playback.
Definition soundcore.h:45