2
* Copyright © 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
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 Lesser 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/>.
16
* Authored by: Thomas Voß <thomas.voss@canonical.com>
18
#ifndef COM_UBUNTU_MUSIC_PLAYER_H_
19
#define COM_UBUNTU_MUSIC_PLAYER_H_
21
#include "com/ubuntu/music/connection.h"
22
#include "com/ubuntu/music/track_list.h"
38
typedef double PlaybackRate;
39
typedef double Volume;
55
Player(const Player&) = delete;
58
Player& operator=(const Player&) = delete;
59
bool operator==(const Player&) const = delete;
64
bool can_go_previous();
74
void seek_to(const std::chrono::microseconds& offset);
76
PlaybackStatus playback_status() const;
77
Connection on_playback_status_changed(const std::function<void(PlaybackStatus)>& handler);
79
LoopStatus loop_status() const;
80
void set_loop_status(LoopStatus new_status);
81
Connection on_loop_status_changed(const std::function<void(LoopStatus)>& handler);
83
PlaybackRate playback_rate() const;
84
void set_playback_rate(PlaybackRate rate);
85
Connection on_playback_rate_changed(const std::function<void(PlaybackRate)>& handler);
87
bool is_shuffle() const;
88
void set_shuffle(bool b);
89
Connection on_shuffle_changed(const std::function<void(bool)>& handler);
91
Track::MetaData meta_data_for_current_track() const;
92
Connection on_meta_data_for_current_track_changed(const std::function<void(const Track::MetaData&)>& handler);
94
Volume volume() const;
95
void set_volume(Volume new_volume);
96
Connection on_volume_changed(const std::function<void(Volume)>& handler);
98
PlaybackRate minimum_playback_rate() const;
99
PlaybackRate maximum_playback_rate() const;
102
friend class Service;
104
Player(const std::shared_ptr<Service>& parent);
107
std::unique_ptr<Private> d;
113
#endif // COM_UBUNTU_MUSIC_PLAYER_H_