Class ConsumerContext

java.lang.Object
de.sfuhrm.radiorecorder.ConsumerContext

public class ConsumerContext extends Object
Immutable context common to all consumers. Holds the data necessary to record or play one stream from one radio station.
Author:
Stephan Fuhrmann
  • Constructor Details

  • Method Details

    • getTimeout

      public int getTimeout()
      Get the read/connect timeout in millis.
      Returns:
      the timeout in milliseconds.
    • getTargetDirectory

      public File getTargetDirectory()
      Get the directory to write files to.
      Returns:
      directory to write files to.
    • getMinFree

      public long getMinFree()
      Get minimum free bytes.
      Returns:
      minimum number of free bytes on disk.
    • getAbortAfter

      public Optional<Long> getAbortAfter()
      Get the amount of bytes after which to abort.
      Returns:
      optional maximum of bytes after which to abort writing to write to disk.
    • isPlaying

      public boolean isPlaying()
      Whether to play or store.
      Returns:
      true if playing was requested on the command line, false otherwise.
    • isSongNames

      public boolean isSongNames()
      Whether to name the files after the metadata retrieved.
      Returns:
      true if metadata naming was requested on the command line, false otherwise.
    • isReconnect

      public boolean isReconnect()
      Reconnect forever.
      Returns:
      true if reconnecting was requested on the command line, false otherwise.
    • getCastReceiver

      public String getCastReceiver()
      The cast device to cast to.
      Returns:
      the name of the chrome cast receiver to play on.
    • getMixerInfo

      public Mixer.Info getMixerInfo()
      The mixer to play on.
      Returns:
      the mixer info to play on, or null if the default is ok.
    • getHttpClient

      The client type to use.
      Returns:
      the HTTP client type requested in the command line.
    • getProxy

      public URL getProxy()
      The HTTP proxy to use or NULL.
      Returns:
      the HTTP proxy requested in the command line.