Class MprisSource

java.lang.Object
lol.trq.orpheus.linux.MprisSource
All Implemented Interfaces:
Source, Transport

public final class MprisSource extends Object implements Source, Transport
Media players on the Linux session bus, through the MPRIS interface. One session per player.

Everything is event driven except the position, which MPRIS never announces: it is read when the track, state or rate changes and every five seconds while a player is playing. All work runs on one thread owned by this source. MPRIS gives no media kind, so a browser playing a video looks like any other player.

  • Method Details

    • create

      public static MprisSource create()
    • create

      public static MprisSource create(Map<String,String> environment)
      Uses the given variables instead of the process environment to find the bus.
    • id

      public String id()
      Description copied from interface: Source
      A short stable name, unique among the sources of one Orpheus.
      Specified by:
      id in interface Source
    • foreign

      public boolean foreign()
      Description copied from interface: Source
      Whether the sessions of this source belong to other applications and must pass the app rules. True for operating system sources, false for a program's own player.
      Specified by:
      foreign in interface Source
    • start

      public void start(SourceSink newSink)
      Description copied from interface: Source
      Starts reporting to sink. Returns quickly; failures are reported as a status, not thrown.
      Specified by:
      start in interface Source
    • stop

      public void stop()
      Description copied from interface: Source
      Stops and releases every thread, handle and process. Safe to call twice and before start.
      Specified by:
      stop in interface Source
    • send

      Description copied from interface: Transport
      Sends a command. Never throws and never blocks; the future always completes.
      Specified by:
      send in interface Transport