Package org.mpris

Class TrackListImpl

java.lang.Object
org.mpris.TrackListImpl
All Implemented Interfaces:
org.freedesktop.dbus.interfaces.DBusInterface, DBusProperties, TrackList

public class TrackListImpl extends Object implements DBusProperties, TrackList
  • Method Details

    • setTracks

      public void setTracks(List<org.freedesktop.dbus.DBusPath> tracks) throws org.freedesktop.dbus.exceptions.DBusException
      An array which contains the identifier of each track in the tracklist, in order. The org.freedesktop.DBus.Properties.PropertiesChanged signal is emited every time this property changes, but the signal message does not contain the new value. Client implementations should rather rely on the TrackAdded, TrackRemoved and TrackListReplaced signals to keep their representation of the tracklist up to date.
      Throws:
      org.freedesktop.dbus.exceptions.DBusException
      See Also:
    • setCanEditTracks

      public void setCanEditTracks(boolean canEditTracks) throws org.freedesktop.dbus.exceptions.DBusException
      If false, calling AddTrack or RemoveTrack will have no effect, and may raise a NotSupported error.
      Throws:
      org.freedesktop.dbus.exceptions.DBusException
      See Also:
    • emitTrackListReplaced

      public void emitTrackListReplaced(List<org.freedesktop.dbus.DBusPath> tracks, org.freedesktop.dbus.DBusPath currentTrack) throws org.freedesktop.dbus.exceptions.DBusException
      Indicates that the entire tracklist has been replaced.
      Throws:
      org.freedesktop.dbus.exceptions.DBusException
      See Also:
    • emitTrackAdded

      public void emitTrackAdded(Metadata metadata, org.freedesktop.dbus.DBusPath afterTrack) throws org.freedesktop.dbus.exceptions.DBusException
      Indicates that a track has been added to the track list.
      Throws:
      org.freedesktop.dbus.exceptions.DBusException
      See Also:
    • emitTrackRemoved

      public void emitTrackRemoved(org.freedesktop.dbus.DBusPath trackId) throws org.freedesktop.dbus.exceptions.DBusException
      Indicates that a track has been removed from the track list.
      Throws:
      org.freedesktop.dbus.exceptions.DBusException
      See Also:
    • emitTrackMetadataChanged

      public void emitTrackMetadataChanged(org.freedesktop.dbus.DBusPath trackId, Metadata metadata) throws org.freedesktop.dbus.exceptions.DBusException
      Indicates that the metadata of a track in the tracklist has changed.
      Throws:
      org.freedesktop.dbus.exceptions.DBusException
      See Also:
    • setConnection

      protected void setConnection(org.freedesktop.dbus.connections.impl.DBusConnection connection)
    • GetTracksMetadata

      public List<Map<String,org.freedesktop.dbus.types.Variant<?>>> GetTracksMetadata(List<org.freedesktop.dbus.DBusPath> TrackIds)
      Specified by:
      GetTracksMetadata in interface TrackList
    • AddTrack

      public void AddTrack(String Uri, org.freedesktop.dbus.DBusPath AfterTrack, boolean SetAsCurrent)
      Description copied from interface: TrackList
      Adds a URI in the TrackList. If the CanEditTracks property is false, this has no effect. Note: Clients should not assume that the track has been added at the time when this method returns. They should wait for a TrackAdded (or TrackListReplaced) signal.
      Specified by:
      AddTrack in interface TrackList
      Parameters:
      Uri - The uri of the item to add. Its uri scheme should be an element of the org.mpris.MediaPlayer2.SupportedUriSchemes property and the mime-type should match one of the elements of the org.mpris.MediaPlayer2.SupportedMimeTypes
      AfterTrack - The identifier of the track after which the new item should be inserted. The path /org/mpris/MediaPlayer2/TrackList/NoTrack indicates that the track should be inserted at the start of the track list.
      SetAsCurrent - Whether the newly inserted track should be considered as the current track. Setting this to true has the same effect as calling GoTo afterwards.
    • RemoveTrack

      public void RemoveTrack(org.freedesktop.dbus.DBusPath TrackId)
      Description copied from interface: TrackList
      Removes an item from the TrackList. If the track is not part of this tracklist, this has no effect. If the CanEditTracks property is false, this has no effect. Note: Clients should not assume that the track has been removed at the time when this method returns. They should wait for a TrackRemoved (or TrackListReplaced) signal.
      Specified by:
      RemoveTrack in interface TrackList
      Parameters:
      TrackId - Identifier of the track to be removed. /org/mpris/MediaPlayer2/TrackList/NoTrack is not a valid value for this argument.
    • GoTo

      public void GoTo(org.freedesktop.dbus.DBusPath TrackId)
      Description copied from interface: TrackList
      Skip to the specified TrackId. If the track is not part of this tracklist, this has no effect. If this object is not /org/mpris/MediaPlayer2, the current TrackList's tracks should be replaced with the contents of this TrackList, and the TrackListReplaced signal should be fired from /org/mpris/MediaPlayer2.
      Specified by:
      GoTo in interface TrackList
      Parameters:
      TrackId - Identifier of the track to skip to. /org/mpris/MediaPlayer2/TrackList/NoTrack is not a valid value for this argument.
    • getObjectPath

      public String getObjectPath()
      Specified by:
      getObjectPath in interface org.freedesktop.dbus.interfaces.DBusInterface
    • Get

      public org.freedesktop.dbus.types.Variant<?> Get(String interface_name, String property_name) throws org.freedesktop.dbus.exceptions.DBusException
      Specified by:
      Get in interface DBusProperties
      Throws:
      org.freedesktop.dbus.exceptions.DBusException
    • GetAll

      public Map<String,org.freedesktop.dbus.types.Variant<?>> GetAll(String interface_name) throws org.freedesktop.dbus.exceptions.DBusException
      Specified by:
      GetAll in interface DBusProperties
      Throws:
      org.freedesktop.dbus.exceptions.DBusException
    • Set

      public void Set(String interface_name, String property_name, org.freedesktop.dbus.types.Variant<?> value) throws org.freedesktop.dbus.exceptions.DBusException
      Specified by:
      Set in interface DBusProperties
      Throws:
      org.freedesktop.dbus.exceptions.DBusException