#!/usr/bin/env python
# coding=utf-8

# Copyright (c) Mikhail Mamrouski.
# See LICENSE for details.

"""
This module provides a `MediaPlayer` class
wich contains instances of all implementations of MPRIS2 interfaces.

Usage::

    mp = MediaPlayer('org.mpris.MediaPlayer2.rhythmbox')
    print mp.root.Identity
    if mp.root.CanRaise:
        mp.root.Raise()

    if mp.player.CanPause and mp.player.CanPlay:
        mp.player.PlayPause()
    if mp.player.CanGoNext:
        mp.player.Next()

    print mp.track_list.Tracks
    print mp.playlists.GetPlaylists

    if mp.root.CanQuit:
        mp.root.Quit()
"""

from .Root import Root
from .Player import Player
from .PlayLists import PlayLists
from .TrackList import TrackList


class MediaPlayer(object):

    """Class uses as helper class."""

    def __init__(self, dbus_name, bus=None, private=False):
        super(MediaPlayer, self).__init__()
        self.root = Root(dbus_name, bus, private)
        self.player = Player(dbus_name, bus, private)
        self.playlists = PlayLists(dbus_name, bus, private)
        self.track_list = TrackList(dbus_name, bus, private)

@@ -102,14 +102,9 @@
 %22%22%22%0A
-This m
+M
 odul
@@ -281,17 +281,17 @@
    print
- 
+(
 mp.root.
@@ -298,16 +298,17 @@
 Identity
+)
 %0A    if 
@@ -492,17 +492,17 @@
    print
- 
+(
 mp.track
@@ -513,16 +513,17 @@
 t.Tracks
+)
 %0A    pri
@@ -524,17 +524,17 @@
    print
- 
+(
 mp.playl
@@ -542,19 +542,16 @@
 sts.
-Get
 Playlist
 s%0A%0A 
@@ -546,17 +546,22 @@
 Playlist
-s
+Count)
 %0A%0A    if
@@ -723,16 +723,45 @@
 ckList%0A%0A
+__all__ = ('MediaPlayer', )%0A%0A
 %0Aclass M
@@ -798,27 +798,39 @@
 ass 
-uses as helper clas
+implements all MPRIS2 interface
 s.%22%22
@@ -998,171 +998,402 @@
     
-self.player = Player(dbus_name, bus, private)%0A        self.playlists = PlayLists(dbus_name, bus, private)%0A        self.track_list = TrackList(dbus_name, bus, private)
+%22%22%22Instance of :class:%60pympris.Root%60 class%22%22%22%0A%0A        self.player = Player(dbus_name, bus, private)%0A        %22%22%22Instance of :class:%60pympris.Player%60 class%22%22%22%0A%0A        self.playlists = PlayLists(dbus_name, bus, private)%0A        %22%22%22Instance of :class:%60pympris.PlayLists%60 class%22%22%22%0A%0A        self.track_list = TrackList(dbus_name, bus, private)%0A        %22%22%22Instance of :class:%60pympris.TrackList%60 class%22%22%22
 %0A

Update docs for the MediaPlayer module.