diff --git a/mopidy/core/playback.py b/mopidy/core/playback.py index 273eb68d..94b4af9c 100644 --- a/mopidy/core/playback.py +++ b/mopidy/core/playback.py @@ -38,9 +38,7 @@ class PlaybackController(object): #: Tracks are not removed from the playlist. consume = option_wrapper('_consume', False) - #: The currently playing or selected track. - #: - #: A two-tuple of (TLID integer, :class:`mopidy.models.Track`) or + #: The currently playing or selected :class:`mopidy.models.TlTrack`, or #: :class:`None`. current_tl_track = None @@ -139,7 +137,7 @@ class PlaybackController(object): """ The track that will be played at the end of the current track. - Read-only. A two-tuple of (TLID integer, :class:`mopidy.models.Track`). + Read-only. A :class:`mopidy.models.TlTrack`. Not necessarily the same track as :attr:`tl_track_at_next`. """ @@ -190,7 +188,7 @@ class PlaybackController(object): """ The track that will be played if calling :meth:`next()`. - Read-only. A two-tuple of (TLID integer, :class:`mopidy.models.Track`). + Read-only. A :class:`mopidy.models.TlTrack`. For normal playback this is the next track in the playlist. If repeat is enabled the next track can loop around the playlist. When random is @@ -238,7 +236,7 @@ class PlaybackController(object): """ The track that will be played if calling :meth:`previous()`. - A two-tuple of (TLID integer, :class:`mopidy.models.Track`). + A :class:`mopidy.models.TlTrack`. For normal playback this is the previous track in the playlist. If random and/or consume is enabled it should return the current track @@ -310,12 +308,10 @@ class PlaybackController(object): Change to the given track, keeping the current playback state. :param tl_track: track to change to - :type tl_track: two-tuple (TLID integer, :class:`mopidy.models.Track`) - or :class:`None` + :type tl_track: :class:`mopidy.models.TlTrack` or :class:`None` :param on_error_step: direction to step at play error, 1 for next track (default), -1 for previous track :type on_error_step: int, -1 or 1 - """ old_state = self.state self.stop() @@ -383,8 +379,7 @@ class PlaybackController(object): currently active track. :param tl_track: track to play - :type tl_track: two-tuple (TLID integer, :class:`mopidy.models.Track`) - or :class:`None` + :type tl_track: :class:`mopidy.models.TlTrack` or :class:`None` :param on_error_step: direction to step at play error, 1 for next track (default), -1 for previous track :type on_error_step: int, -1 or 1 diff --git a/mopidy/core/tracklist.py b/mopidy/core/tracklist.py index 4a628d81..b352e06e 100644 --- a/mopidy/core/tracklist.py +++ b/mopidy/core/tracklist.py @@ -23,7 +23,7 @@ class TracklistController(object): @property def tl_tracks(self): """ - List of two-tuples of (TLID integer, :class:`mopidy.models.Track`). + List of :class:`mopidy.models.TlTrack`. Read-only. """ @@ -72,8 +72,7 @@ class TracklistController(object): :type at_position: int or :class:`None` :param increase_version: if the tracklist version should be increased :type increase_version: :class:`True` or :class:`False` - :rtype: two-tuple of (TLID integer, :class:`mopidy.models.Track`) that - was added to the tracklist + :rtype: :class:`mopidy.models.TlTrack` that was added to the tracklist """ assert at_position <= len(self._tl_tracks), \ 'at_position can not be greater than tracklist length' @@ -132,7 +131,7 @@ class TracklistController(object): :param criteria: on or more criteria to match by :type criteria: dict - :rtype: two-tuple (TLID integer, :class:`mopidy.models.Track`) + :rtype: :class:`mopidy.models.TlTrack` """ matches = self._tl_tracks for (key, value) in criteria.iteritems(): @@ -152,13 +151,12 @@ class TracklistController(object): def index(self, tl_track): """ - Get index of the given (TLID integer, :class:`mopidy.models.Track`) - two-tuple in the tracklist. + Get index of the given :class:`mopidy.models.TlTrack` in the tracklist. Raises :exc:`ValueError` if not found. :param tl_track: track to find the index of - :type tl_track: two-tuple (TLID integer, :class:`mopidy.models.Track`) + :type tl_track: :class:`mopidy.models.TlTrack` :rtype: int """ return self._tl_tracks.index(tl_track) @@ -255,7 +253,7 @@ class TracklistController(object): :type start: int :param end: position after last track to include in slice :type end: int - :rtype: two-tuple of (TLID integer, :class:`mopidy.models.Track`) + :rtype: :class:`mopidy.models.TlTrack` """ return self._tl_tracks[start:end]