2
* Copyright (C) 2015 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef AALMEDIAPLAYLISTCONTROL_H
18
#define AALMEDIAPLAYLISTCONTROL_H
20
#include <qmediaplaylistcontrol_p.h>
22
#include <core/media/player.h>
23
#include <core/media/track_list.h>
25
#include <core/connection.h>
31
class QMediaPlaylistProvider;
32
class AalMediaPlaylistProvider;
34
class AalMediaPlaylistControl : public QMediaPlaylistControl
38
AalMediaPlaylistControl(QObject *parent=0);
39
~AalMediaPlaylistControl();
41
QMediaPlaylistProvider* playlistProvider() const;
42
bool setPlaylistProvider(QMediaPlaylistProvider *playlist);
44
int currentIndex() const;
45
void setCurrentIndex(int position);
46
int nextIndex(int steps) const;
47
int previousIndex(int steps) const;
52
QMediaPlaylist::PlaybackMode playbackMode() const;
53
void setPlaybackMode(QMediaPlaylist::PlaybackMode mode);
55
void setPlayerSession(const std::shared_ptr<core::ubuntu::media::Player>& playerSession);
58
void playlistProviderChanged();
59
void currentIndexChanged(int position);
60
void currentMediaChanged(const QMediaContent&);
61
void playbackModeChanged(QMediaPlaylist::PlaybackMode mode);
64
void onTrackChanged(const core::ubuntu::media::Track::Id& id);
67
void connect_signals();
68
void disconnect_signals();
69
inline AalMediaPlaylistProvider* aalMediaPlaylistProvider();
71
std::shared_ptr<core::ubuntu::media::Player> m_hubPlayerSession;
72
std::shared_ptr<core::ubuntu::media::TrackList> m_hubTrackList;
73
QMediaPlaylistProvider *m_playlistProvider;
77
core::Connection m_trackChangedConnection;