Music Hub ..
A session-wide music playback service
Loading...
Searching...
No Matches
track_list_p.h
Go to the documentation of this file.
1/*
2 * Copyright © 2021-2022 UBports Foundation.
3 *
4 * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3,
8 * as published by the Free Software Foundation.
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 Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef LOMIRI_MEDIAHUB_TRACK_LIST_P_H
20#define LOMIRI_MEDIAHUB_TRACK_LIST_P_H
21
22#include "track_list.h"
23
24class DBusTrackList;
25
26class QDBusConnection;
27class QDBusPendingCall;
28
29namespace lomiri {
30namespace MediaHub {
31
33 Q_DECLARE_PUBLIC(TrackList)
34
35public:
37
38 void createProxy(const QDBusConnection &conn, const QString &objectPath);
39
40 bool ensureProxy() const;
41 // TODO: change to return QDBusObjectPath
42 QString remotePos(int index) const;
43
44 void initialize(const QVariantMap &properties);
45
46 void addTrackWithUriAt(const QUrl &uri, int position, bool makeCurrent);
47 void addTracksWithUriAt(const QVector<QUrl> &uris, int position);
48 void moveTrack(int index, int to);
49 void removeTrack(int index);
50 void goTo(int index);
51 void reset();
52
53 void onTrackAdded(const QString &id);
54 void onTracksAdded(const QStringList &ids);
55 void onTrackMoved(const QString &id, const QString &to);
56 void onTrackRemoved(const QString &id);
57 void onTrackListReset();
58 void onTrackChanged(const QString &id);
59
60private:
61 QVector<Track> m_tracks;
62 QVector<QString> m_trackIds;
63 bool m_canEditTracks;
64 int m_currentTrack;
65
66 // TODO: remove once service is spec-compliant
67 int m_indexForNextAddition;
68 QVector<QUrl> m_urisForNextAddition;
69
70
71 QScopedPointer<DBusTrackList> m_proxy;
72 TrackList *q_ptr;
73};
74
75} // namespace MediaHub
76} // namespace lomiri
77
78#endif // LOMIRI_MEDIAHUB_TRACK_LIST_P_H
void onTrackChanged(const QString &id)
void moveTrack(int index, int to)
void addTrackWithUriAt(const QUrl &uri, int position, bool makeCurrent)
void onTrackRemoved(const QString &id)
void createProxy(const QDBusConnection &conn, const QString &objectPath)
void onTracksAdded(const QStringList &ids)
void initialize(const QVariantMap &properties)
void addTracksWithUriAt(const QVector< QUrl > &uris, int position)
QString remotePos(int index) const
void onTrackAdded(const QString &id)
void onTrackMoved(const QString &id, const QString &to)