3
* This program is free software: you can redistribute it and/or modify it
4
* under the terms of the GNU Lesser General Public License version 3,
5
* as published by the Free Software Foundation.
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU Lesser General Public License for more details.
12
* You should have received a copy of the GNU Lesser General Public License
13
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
* Authored by: Thomas Voß <thomas.voss@canonical.com>
18
#ifndef CORE_MEDIA_NULL_TRACK_LIST_H_
19
#define CORE_MEDIA_NULL_TRACK_LIST_H_
21
#include <core/media/track.h>
22
#include <core/media/track_list.h>
30
// A helper type to replace the playlist implementation below.
31
// Please note that this type is only a temporary manner. Ideally,
32
// the actual implementation should be injected as a dependency from the
34
struct NullTrackList : public media::TrackList
36
NullTrackList() = default;
43
media::Track::Id next()
45
return media::Track::Id{};
48
media::Track::UriType query_uri_for_track(const media::Track::Id&)
50
return media::Track::UriType{};
53
const core::Property<bool>& can_edit_tracks() const override
55
return props_and_sigs.can_edit_tracks;
58
const core::Property<Container>& tracks() const override
60
return props_and_sigs.tracks;
63
virtual media::Track::MetaData query_meta_data_for_track(const media::Track::Id&) override
65
return media::Track::MetaData{};
68
void add_track_with_uri_at(const media::Track::UriType&, const media::Track::Id&, bool) override
72
void remove_track(const media::Track::Id&) override
76
void go_to(const media::Track::Id&) override
80
const core::Signal<void>& on_track_list_replaced() const override
82
return props_and_sigs.on_track_list_replaced;
85
const core::Signal<media::Track::Id>& on_track_added() const override
87
return props_and_sigs.on_track_added;
90
const core::Signal<media::Track::Id>& on_track_removed() const override
92
return props_and_sigs.on_track_removed;
95
const core::Signal<media::Track::Id>& on_track_changed() const override
97
return props_and_sigs.on_track_changed;
102
core::Property<bool> can_edit_tracks;
103
core::Property<TrackList::Container> tracks;
104
core::Signal<void> on_track_list_replaced;
105
core::Signal<media::Track::Id> on_track_added;
106
core::Signal<media::Track::Id> on_track_removed;
107
core::Signal<media::Track::Id> on_track_changed;
114
#endif // CORE_MEDIA_NULL_TRACK_LIST_H_