Interface Source

All Known Implementing Classes:
MacNowPlaying, MprisSource, PushSource, SystemSessions, WindowsSessions

public interface Source
Something that knows what is playing. A source owns its threads; none of its methods may block the caller.

Optional abilities are separate interfaces (Transport, QueueAccess, Devices, LibraryAccess) handed out by capability(Class).

  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> T
    capability(Class<T> type)
    The ability of the given type, or null when this source does not have it.
    default DisplayRules
    Rules that come with the data of this source.
    default boolean
    Whether the sessions of this source belong to other applications and must pass the app rules.
    id()
    A short stable name, unique among the sources of one Orpheus.
    void
    Starts reporting to sink.
    void
    Stops and releases every thread, handle and process.
  • Method Details

    • id

      String id()
      A short stable name, unique among the sources of one Orpheus.
    • start

      void start(SourceSink sink)
      Starts reporting to sink. Returns quickly; failures are reported as a status, not thrown.
    • stop

      void stop()
      Stops and releases every thread, handle and process. Safe to call twice and before start.
    • foreign

      default boolean foreign()
      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.
    • display

      default DisplayRules display()
      Rules that come with the data of this source.
    • capability

      default <T> T capability(Class<T> type)
      The ability of the given type, or null when this source does not have it.