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 pause();
85 void next();
89 void previous();
90
91private slots:
92 void playNext();
93 void updateNextUrl();
94 void processState(Qmmp::State state);
95 void updateMetaData();
96 void onCurrentTrackRemoved();
97
98private:
99 void saveMetaData(const PlayListTrack *track);
100 void restoreMetaData(PlayListTrack *track);
101 void updatePlayListMetaData(PlayListTrack *track);
102
103 QmmpUiSettings *m_settings;
104 PlayListManager *m_pl_manager;
105 SoundCore *m_core;
106 static MediaPlayer* m_instance;
107 int m_skips = 0;
108 QString m_nextUrl;
109 TrackInfo m_savedInfo;
110 QTimer *m_finishTimer;
111};
112
113#endif
void previous()
void playFromPosition(qint64 offset)
void pause()
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 PlayListTrack class provides a track for use with the PlayListModel class.
Definition playlisttrack.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
The TrackInfo class stores metadata and other information about track.
Definition trackinfo.h:32