Music Hub  ..
A session-wide music playback service
player_stub.cpp
Go to the documentation of this file.
1 /*
2  * Copyright © 2013-2015 Canonical Ltd.
3  *
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.
7  *
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.
12  *
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/>.
15  *
16  * Authored by: Thomas Voß <thomas.voss@canonical.com>
17  * Jim Hodapp <jim.hodapp@canonical.com>
18  */
19 
20 #include <core/media/service.h>
21 #include <core/media/track_list.h>
23 
24 #include "codec.h"
25 #include "player_stub.h"
26 #include "player_traits.h"
27 #include "property_stub.h"
28 #include "the_session_bus.h"
29 #include "track_list_stub.h"
30 
31 #include "mpris/player.h"
32 
34 
35 #include <core/dbus/property.h>
36 #include <core/dbus/types/object_path.h>
37 
38 #include <limits>
39 #include <sstream>
40 
41 #define UNUSED __attribute__((unused))
42 
43 namespace dbus = core::dbus;
44 namespace media = core::ubuntu::media;
45 
47 {
48  Private(const std::shared_ptr<Service>& parent,
49  const std::shared_ptr<core::dbus::Service>& service,
50  const std::shared_ptr<core::dbus::Object>& object,
51  const std::string& uuid
52  ) : parent(parent),
53  service(service),
54  object(object),
55  key(object->invoke_method_synchronously<mpris::Player::Key, media::Player::PlayerKey>().value()),
56  uuid(uuid),
58  {
59  // Link the properties from the server side to the client side over the bus
60  object->get_property<mpris::Player::Properties::CanPlay>(),
61  object->get_property<mpris::Player::Properties::CanPause>(),
62  object->get_property<mpris::Player::Properties::CanSeek>(),
63  object->get_property<mpris::Player::Properties::CanControl>(),
64  object->get_property<mpris::Player::Properties::CanGoNext>(),
65  object->get_property<mpris::Player::Properties::CanGoPrevious>(),
66  object->get_property<mpris::Player::Properties::IsVideoSource>(),
67  object->get_property<mpris::Player::Properties::IsAudioSource>(),
68  object->get_property<mpris::Player::Properties::TypedPlaybackStatus>(),
69  object->get_property<mpris::Player::Properties::TypedBackend>(),
70  object->get_property<mpris::Player::Properties::TypedLoopStatus>(),
71  object->get_property<mpris::Player::Properties::PlaybackRate>(),
72  object->get_property<mpris::Player::Properties::Shuffle>(),
73  object->get_property<mpris::Player::Properties::Metadata>(),
74  object->get_property<mpris::Player::Properties::Volume>(),
75  object->get_property<mpris::Player::Properties::Position>(),
76  object->get_property<mpris::Player::Properties::Duration>(),
77  object->get_property<mpris::Player::Properties::AudioStreamRole>(),
78  object->get_property<mpris::Player::Properties::Orientation>(),
79  object->get_property<mpris::Player::Properties::Lifetime>(),
80  object->get_property<mpris::Player::Properties::MinimumRate>(),
81  object->get_property<mpris::Player::Properties::MaximumRate>()
82  },
83  signals
84  {
85  object->get_signal<mpris::Player::Signals::Seeked>(),
86  object->get_signal<mpris::Player::Signals::AboutToFinish>(),
87  object->get_signal<mpris::Player::Signals::EndOfStream>(),
88  object->get_signal<mpris::Player::Signals::PlaybackStatusChanged>(),
89  object->get_signal<mpris::Player::Signals::VideoDimensionChanged>(),
90  object->get_signal<mpris::Player::Signals::Buffering>(),
91  object->get_signal<mpris::Player::Signals::Error>()
92  }
93  {
95  properties.backend->get());
96  }
97 
99  {
100  }
101 
102  std::shared_ptr<Service> parent;
103  std::shared_ptr<TrackList> track_list;
104  dbus::Service::Ptr service;
105  dbus::Object::Ptr object;
107  std::string uuid;
109  struct
110  {
111  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::CanPlay>> can_play;
112  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::CanPause>> can_pause;
113  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::CanSeek>> can_seek;
114  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::CanControl>> can_control;
115  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::CanGoNext>> can_go_next;
116  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::CanGoPrevious>> can_go_previous;
117  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::IsVideoSource>> is_video_source;
118  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::IsAudioSource>> is_audio_source;
119 
120  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::TypedPlaybackStatus>> playback_status;
121  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::TypedBackend>> backend;
122  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::TypedLoopStatus>> loop_status;
123  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::PlaybackRate>> playback_rate;
124  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::Shuffle>> shuffle;
125  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::Metadata>> meta_data_for_current_track;
126  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::Volume>> volume;
127  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::Position>> position;
128  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::Duration>> duration;
129  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::AudioStreamRole>> audio_role;
130  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::Orientation>> orientation;
131  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::Lifetime>> lifetime;
132  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::MinimumRate>> minimum_playback_rate;
133  std::shared_ptr<core::dbus::Property<mpris::Player::Properties::MaximumRate>> maximum_playback_rate;
134  } properties;
135 
136  struct Signals
137  {
138  typedef core::dbus::Signal<mpris::Player::Signals::Seeked, mpris::Player::Signals::Seeked::ArgumentType> DBusSeekedToSignal;
139  typedef core::dbus::Signal<mpris::Player::Signals::AboutToFinish, mpris::Player::Signals::AboutToFinish::ArgumentType> DBusAboutToFinishSignal;
140  typedef core::dbus::Signal<mpris::Player::Signals::EndOfStream, mpris::Player::Signals::EndOfStream::ArgumentType> DBusEndOfStreamSignal;
141  typedef core::dbus::Signal<mpris::Player::Signals::PlaybackStatusChanged, mpris::Player::Signals::PlaybackStatusChanged::ArgumentType> DBusPlaybackStatusChangedSignal;
142  typedef core::dbus::Signal<mpris::Player::Signals::VideoDimensionChanged, mpris::Player::Signals::VideoDimensionChanged::ArgumentType> DBusVideoDimensionChangedSignal;
143  typedef core::dbus::Signal<mpris::Player::Signals::Error, mpris::Player::Signals::Error::ArgumentType> DBusErrorSignal;
144  typedef core::dbus::Signal<mpris::Player::Signals::Buffering, mpris::Player::Signals::Buffering::ArgumentType> DBusBufferingChangedSignal;
145 
146  Signals(const std::shared_ptr<DBusSeekedToSignal>& seeked,
147  const std::shared_ptr<DBusAboutToFinishSignal>& atf,
148  const std::shared_ptr<DBusEndOfStreamSignal>& eos,
149  const std::shared_ptr<DBusPlaybackStatusChangedSignal>& status,
150  const std::shared_ptr<DBusVideoDimensionChangedSignal>& d,
151  const std::shared_ptr<DBusBufferingChangedSignal>& bp,
152  const std::shared_ptr<DBusErrorSignal>& e)
153  : seeked_to(),
154  about_to_finish(),
155  end_of_stream(),
158  error(),
160  dbus
161  {
162  seeked,
163  atf,
164  eos,
165  status,
166  d,
167  e,
168  bp
169  }
170  {
171  dbus.seeked_to->connect([this](std::uint64_t value)
172  {
173  MH_DEBUG("SeekedTo signal arrived via the bus.");
174  seeked_to(value);
175  });
176 
177  dbus.about_to_finish->connect([this]()
178  {
179  MH_DEBUG("AboutToFinish signal arrived via the bus.");
180  about_to_finish();
181  });
182 
183  dbus.end_of_stream->connect([this]()
184  {
185  MH_DEBUG("EndOfStream signal arrived via the bus.");
186  end_of_stream();
187  });
188 
189  dbus.playback_status_changed->connect([this](const media::Player::PlaybackStatus& status)
190  {
191  MH_DEBUG("PlaybackStatusChanged signal arrived via the bus (status: %s)",
192  status);
193  playback_status_changed(status);
194  });
195 
196  dbus.video_dimension_changed->connect([this](const media::video::Dimensions dimensions)
197  {
198  MH_DEBUG("VideoDimensionChanged signal arrived via the bus.");
199  video_dimension_changed(dimensions);
200  });
201 
202  dbus.error->connect([this](const media::Player::Error& e)
203  {
204  MH_DEBUG("Error signal arrived via the bus (error: %s)", e);
205  error(e);
206  });
207 
208  dbus.buffering_changed->connect([this](int percent)
209  {
210  MH_DEBUG("BufferingChanged signal arrived via the bus (percent: %d", percent);
211  buffering_changed(percent);
212  });
213  }
214 
215  core::Signal<int64_t> seeked_to;
216  core::Signal<void> about_to_finish;
217  core::Signal<void> end_of_stream;
218  core::Signal<media::Player::PlaybackStatus> playback_status_changed;
219  core::Signal<media::video::Dimensions> video_dimension_changed;
220  core::Signal<media::Player::Error> error;
221  core::Signal<int> buffering_changed;
222 
223  struct DBus
224  {
225  std::shared_ptr<DBusSeekedToSignal> seeked_to;
226  std::shared_ptr<DBusAboutToFinishSignal> about_to_finish;
227  std::shared_ptr<DBusEndOfStreamSignal> end_of_stream;
228  std::shared_ptr<DBusPlaybackStatusChangedSignal> playback_status_changed;
229  std::shared_ptr<DBusVideoDimensionChangedSignal> video_dimension_changed;
230  std::shared_ptr<DBusErrorSignal> error;
231  std::shared_ptr<DBusBufferingChangedSignal> buffering_changed;
232  } dbus;
233  } signals;
234 };
235 
237  const std::shared_ptr<Service>& parent,
238  const std::shared_ptr<core::dbus::Service>& service,
239  const std::shared_ptr<core::dbus::Object>& object,
240  const std::string& uuid)
241  : d(new Private{parent, service, object, uuid})
242 {
243  MH_TRACE("");
244 }
245 
247 {
248  MH_TRACE("");
249 }
250 
251 std::string media::PlayerStub::uuid() const
252 {
253  return d->uuid;
254 }
255 
257 {
258  // No implementation
259 }
260 
262 {
263  // No implementation
264 }
265 
266 std::shared_ptr<media::TrackList> media::PlayerStub::track_list()
267 {
268  if (!d->track_list)
269  {
270  d->track_list = std::make_shared<media::TrackListStub>(
271  shared_from_this(),
272  d->service->object_for_path(
273  dbus::types::ObjectPath(
274  d->object->path().as_string() + "/TrackList")));
275  }
276 
277  return d->track_list;
278 }
279 
281 {
282  MH_DEBUG("key(): %s", d->key);
283  return d->key;
284 }
285 
287 {
288  const auto op = d->object->transact_method<mpris::Player::OpenUri, bool>(uri);
289  if (op.is_error())
290  {
292  throw media::Player::Errors::InsufficientAppArmorPermissions{op.error().print()};
293  else if (op.error().name() == mpris::Player::Error::UriNotFound::name)
294  throw media::Player::Errors::UriNotFound{op.error().print()};
295  else
296  throw std::runtime_error{op.error().print()};
297  }
298 
299  return op.value();
300 }
301 
302 
303 bool media::PlayerStub::open_uri(const Track::UriType& uri, const Player::HeadersType& headers)
304 {
305  const auto op = d->object->transact_method<mpris::Player::OpenUriExtended, bool>(uri, headers);
306  if (op.is_error())
307  {
309  throw media::Player::Errors::InsufficientAppArmorPermissions{op.error().print()};
310  else
311  throw std::runtime_error{op.error().print()};
312  }
313 
314  return op.value();
315 }
316 
317 media::video::Sink::Ptr media::PlayerStub::create_gl_texture_video_sink(std::uint32_t texture_id)
318 {
319  // Create first local stub so media-hub can rely on an existing socket
320  // for the mir/desktop case.
321  const auto sink = d->sink_factory(texture_id);
322 
323  auto op = d->object->transact_method<mpris::Player::CreateVideoSink, void>(texture_id);
324 
325  if (op.is_error())
326  {
327  if (op.error().name() ==
329  throw media::Player::Errors::OutOfProcessBufferStreamingNotSupported{};
330  else
331  throw std::runtime_error{op.error().print()};
332  }
333 
334  return sink;
335 }
336 
338 {
339  auto op = d->object->transact_method<mpris::Player::Next, void>();
340 
341  if (op.is_error())
342  throw std::runtime_error("Problem switching to next track on remote object");
343 }
344 
346 {
347  auto op = d->object->transact_method<mpris::Player::Previous, void>();
348 
349  if (op.is_error())
350  throw std::runtime_error("Problem switching to previous track on remote object");
351 }
352 
354 {
355  auto op = d->object->transact_method<mpris::Player::Play, void>();
356 
357  if (op.is_error())
358  throw std::runtime_error("Problem starting playback on remote object");
359 }
360 
362 {
363  auto op = d->object->transact_method<mpris::Player::Pause, void>();
364 
365  if (op.is_error())
366  throw std::runtime_error("Problem pausing playback on remote object");
367 }
368 
369 void media::PlayerStub::seek_to(const std::chrono::microseconds& offset)
370 {
371  auto op = d->object->transact_method<mpris::Player::Seek, void, uint64_t>(offset.count());
372 
373  if (op.is_error())
374  throw std::runtime_error("Problem seeking on remote object");
375 }
376 
378 {
379  auto op = d->object->transact_method<mpris::Player::Stop, void>();
380 
381  if (op.is_error())
382  throw std::runtime_error("Problem stopping playback on remote object");
383 }
384 
385 const core::Property<bool>& media::PlayerStub::can_play() const
386 {
387  return *d->properties.can_play;
388 }
389 
390 const core::Property<bool>& media::PlayerStub::can_pause() const
391 {
392  return *d->properties.can_pause;
393 }
394 
395 const core::Property<bool>& media::PlayerStub::can_seek() const
396 {
397  return *d->properties.can_seek;
398 }
399 
400 const core::Property<bool>& media::PlayerStub::can_go_previous() const
401 {
402  return *d->properties.can_go_previous;
403 }
404 
405 const core::Property<bool>& media::PlayerStub::can_go_next() const
406 {
407  return *d->properties.can_go_next;
408 }
409 
410 const core::Property<bool>& media::PlayerStub::is_video_source() const
411 {
412  return *d->properties.is_video_source;
413 }
414 
415 const core::Property<bool>& media::PlayerStub::is_audio_source() const
416 {
417  return *d->properties.is_audio_source;
418 }
419 
420 const core::Property<media::Player::PlaybackStatus>& media::PlayerStub::playback_status() const
421 {
422  return *d->properties.playback_status;
423 }
424 
425 const core::Property<media::AVBackend::Backend>& media::PlayerStub::backend() const
426 {
427  return *d->properties.backend;
428 }
429 
430 const core::Property<media::Player::LoopStatus>& media::PlayerStub::loop_status() const
431 {
432  return *d->properties.loop_status;
433 }
434 
435 const core::Property<media::Player::PlaybackRate>& media::PlayerStub::playback_rate() const
436 {
437  return *d->properties.playback_rate;
438 }
439 
440 const core::Property<bool>& media::PlayerStub::shuffle() const
441 {
442  return *d->properties.shuffle;
443 }
444 
445 const core::Property<media::Track::MetaData>& media::PlayerStub::meta_data_for_current_track() const
446 {
447  return *d->properties.meta_data_for_current_track;
448 }
449 
450 const core::Property<media::Player::Volume>& media::PlayerStub::volume() const
451 {
452  return *d->properties.volume;
453 }
454 
455 const core::Property<int64_t>& media::PlayerStub::position() const
456 {
457  return *d->properties.position;
458 }
459 
460 const core::Property<int64_t>& media::PlayerStub::duration() const
461 {
462  return *d->properties.duration;
463 }
464 
465 const core::Property<media::Player::AudioStreamRole>& media::PlayerStub::audio_stream_role() const
466 {
467  return *d->properties.audio_role;
468 }
469 
470 const core::Property<media::Player::Orientation>& media::PlayerStub::orientation() const
471 {
472  return *d->properties.orientation;
473 }
474 
475 const core::Property<media::Player::Lifetime>& media::PlayerStub::lifetime() const
476 {
477  return *d->properties.lifetime;
478 }
479 
480 const core::Property<media::Player::PlaybackRate>& media::PlayerStub::minimum_playback_rate() const
481 {
482  return *d->properties.minimum_playback_rate;
483 }
484 
485 const core::Property<media::Player::PlaybackRate>& media::PlayerStub::maximum_playback_rate() const
486 {
487  return *d->properties.maximum_playback_rate;
488 }
489 
490 core::Property<media::Player::LoopStatus>& media::PlayerStub::loop_status()
491 {
492  return *d->properties.loop_status;
493 }
494 
495 core::Property<media::Player::PlaybackRate>& media::PlayerStub::playback_rate()
496 {
497  return *d->properties.playback_rate;
498 }
499 
500 core::Property<bool>& media::PlayerStub::shuffle()
501 {
502  return *d->properties.shuffle;
503 }
504 
505 core::Property<media::Player::Volume>& media::PlayerStub::volume()
506 {
507  return *d->properties.volume;
508 }
509 
510 core::Property<media::Player::AudioStreamRole>& media::PlayerStub::audio_stream_role()
511 {
512  return *d->properties.audio_role;
513 }
514 
515 core::Property<media::Player::Lifetime>& media::PlayerStub::lifetime()
516 {
517  return *d->properties.lifetime;
518 }
519 
520 const core::Signal<int64_t>& media::PlayerStub::seeked_to() const
521 {
522  return d->signals.seeked_to;
523 }
524 
525 const core::Signal<void>& media::PlayerStub::about_to_finish() const
526 {
527  return d->signals.about_to_finish;
528 }
529 
530 const core::Signal<void>& media::PlayerStub::end_of_stream() const
531 {
532  return d->signals.end_of_stream;
533 }
534 
535 core::Signal<media::Player::PlaybackStatus>& media::PlayerStub::playback_status_changed()
536 {
537  return d->signals.playback_status_changed;
538 }
539 
540 const core::Signal<media::video::Dimensions>& media::PlayerStub::video_dimension_changed() const
541 {
542  return d->signals.video_dimension_changed;
543 }
544 
545 const core::Signal<media::Player::Error>& media::PlayerStub::error() const
546 {
547  return d->signals.error;
548 }
549 
550 const core::Signal<int>& media::PlayerStub::buffering_changed() const
551 {
552  return d->signals.buffering_changed;
553 }
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::CanPlay > > can_play
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::CanControl > > can_control
SinkFactory make_platform_default_sink_factory(const Player::PlayerKey &key, const AVBackend::Backend b)
std::shared_ptr< DBusEndOfStreamSignal > end_of_stream
virtual const core::Property< Lifetime > & lifetime() const
std::shared_ptr< DBusVideoDimensionChangedSignal > video_dimension_changed
virtual video::Sink::Ptr create_gl_texture_video_sink(std::uint32_t texture_id)
core::Signal< int > buffering_changed
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::IsAudioSource > > is_audio_source
std::tuple< Height, Width > Dimensions
Height and Width of a video.
Definition: dimensions.h:139
virtual const core::Property< bool > & shuffle() const
virtual const core::Property< bool > & can_seek() const
virtual const core::Property< PlaybackRate > & minimum_playback_rate() const
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::MinimumRate > > minimum_playback_rate
struct media::PlayerStub::Private::Signals signals
core::Signal< void > end_of_stream
virtual const core::Property< Orientation > & orientation() const
virtual const core::Signal< void > & about_to_finish() const
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::Lifetime > > lifetime
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::Metadata > > meta_data_for_current_track
dbus::Object::Ptr object
struct media::PlayerStub::Private::@21 properties
std::shared_ptr< DBusSeekedToSignal > seeked_to
core::dbus::Signal< mpris::Player::Signals::EndOfStream, mpris::Player::Signals::EndOfStream::ArgumentType > DBusEndOfStreamSignal
std::map< std::string, std::string > HeadersType
Definition: player.h:65
std::shared_ptr< Service > parent
core::dbus::Signal< mpris::Player::Signals::VideoDimensionChanged, mpris::Player::Signals::VideoDimensionChanged::ArgumentType > DBusVideoDimensionChangedSignal
core::Signal< void > about_to_finish
core::Signal< media::video::Dimensions > video_dimension_changed
virtual std::string uuid() const
#define MH_DEBUG(...)
Definition: logger.h:123
core::dbus::Signal< mpris::Player::Signals::Error, mpris::Player::Signals::Error::ArgumentType > DBusErrorSignal
virtual const core::Property< bool > & is_video_source() const
static constexpr const char * name
Definition: player.h:133
struct media::PlayerStub::Private::Signals::DBus dbus
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::Volume > > volume
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::Shuffle > > shuffle
std::shared_ptr< DBusErrorSignal > error
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::TypedLoopStatus > > loop_status
media::video::SinkFactory sink_factory
std::shared_ptr< DBusAboutToFinishSignal > about_to_finish
virtual const core::Property< PlaybackRate > & playback_rate() const
core::dbus::Signal< mpris::Player::Signals::Seeked, mpris::Player::Signals::Seeked::ArgumentType > DBusSeekedToSignal
core::dbus::Signal< mpris::Player::Signals::PlaybackStatusChanged, mpris::Player::Signals::PlaybackStatusChanged::ArgumentType > DBusPlaybackStatusChangedSignal
virtual const core::Property< Volume > & volume() const
core::dbus::Signal< mpris::Player::Signals::AboutToFinish, mpris::Player::Signals::AboutToFinish::ArgumentType > DBusAboutToFinishSignal
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::CanPause > > can_pause
virtual const core::Property< int64_t > & position() const
Signals(const std::shared_ptr< DBusSeekedToSignal > &seeked, const std::shared_ptr< DBusAboutToFinishSignal > &atf, const std::shared_ptr< DBusEndOfStreamSignal > &eos, const std::shared_ptr< DBusPlaybackStatusChangedSignal > &status, const std::shared_ptr< DBusVideoDimensionChangedSignal > &d, const std::shared_ptr< DBusBufferingChangedSignal > &bp, const std::shared_ptr< DBusErrorSignal > &e)
virtual const core::Property< AudioStreamRole > & audio_stream_role() const
virtual PlayerKey key() const
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::CanGoPrevious > > can_go_previous
virtual core::Signal< PlaybackStatus > & playback_status_changed()
virtual const core::Property< AVBackend::Backend > & backend() const
std::function< Sink::Ptr(std::uint32_t)> SinkFactory
core::dbus::Signal< mpris::Player::Signals::Buffering, mpris::Player::Signals::Buffering::ArgumentType > DBusBufferingChangedSignal
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::Duration > > duration
std::shared_ptr< TrackList > track_list
virtual const core::Property< Track::MetaData > & meta_data_for_current_track() const
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::CanSeek > > can_seek
virtual const core::Signal< int > & buffering_changed() const
std::shared_ptr< DBusBufferingChangedSignal > buffering_changed
virtual const core::Property< bool > & can_play() const
#define MH_TRACE(...)
Definition: logger.h:121
virtual const core::Property< bool > & can_go_next() const
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::AudioStreamRole > > audio_role
virtual const core::Signal< Error > & error() const
core::Signal< media::Player::Error > error
virtual const core::Signal< int64_t > & seeked_to() const
dbus::Service::Ptr service
virtual bool open_uri(const Track::UriType &uri)
std::string UriType
Definition: track.h:40
virtual const core::Property< LoopStatus > & loop_status() const
virtual const core::Property< PlaybackRate > & maximum_playback_rate() const
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::Position > > position
virtual const core::Property< bool > & can_go_previous() const
virtual const core::Signal< void > & end_of_stream() const
virtual const core::Signal< video::Dimensions > & video_dimension_changed() const
core::Signal< int64_t > seeked_to
virtual void seek_to(const std::chrono::microseconds &offset)
virtual const core::Property< int64_t > & duration() const
virtual const core::Property< bool > & is_audio_source() const
Private(const std::shared_ptr< Service > &parent, const std::shared_ptr< core::dbus::Service > &service, const std::shared_ptr< core::dbus::Object > &object, const std::string &uuid)
Definition: player_stub.cpp:48
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::Orientation > > orientation
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::TypedBackend > > backend
virtual std::shared_ptr< TrackList > track_list()
virtual const core::Property< bool > & can_pause() const
std::shared_ptr< DBusPlaybackStatusChangedSignal > playback_status_changed
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::TypedPlaybackStatus > > playback_status
virtual const core::Property< PlaybackStatus > & playback_status() const
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::PlaybackRate > > playback_rate
core::Signal< media::Player::PlaybackStatus > playback_status_changed
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::MaximumRate > > maximum_playback_rate
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::IsVideoSource > > is_video_source
std::shared_ptr< core::dbus::Property< mpris::Player::Properties::CanGoNext > > can_go_next
media::Player::PlayerKey key
PlayerStub(const std::shared_ptr< Service > &parent, const std::shared_ptr< core::dbus::Service > &service, const std::shared_ptr< core::dbus::Object > &object, const std::string &uuid=std::string{})