Klasse 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.
Autor:
Stephan Fuhrmann
  • Konstruktordetails

    • ConsumerContext

      public ConsumerContext(int id, Radio radio, Params params)
      Constructor for a consumer context.
      Parameter:
      id - numerical unique id of this context.
      radio - the radio station to process in this context.
      params - the command line parameters.
  • Methodendetails

    • getTimeout

      public int getTimeout()
      Get the read/connect timeout in millis.
      Gibt zurück:
      the timeout in milliseconds.
    • getTargetDirectory

      public File getTargetDirectory()
      Get the directory to write files to.
      Gibt zurück:
      directory to write files to.
    • getMinFree

      public long getMinFree()
      Get minimum free bytes.
      Gibt zurück:
      minimum number of free bytes on disk.
    • getAbortAfterFileLength

      public Optional<Long> getAbortAfterFileLength()
      Get the amount of bytes after which to abort.
      Gibt zurück:
      optional maximum of bytes after which to abort writing to write to disk.
    • getAbortAfterDuration

      public Optional<Long> getAbortAfterDuration()
      Get the amount of bytes after which to abort.
      Gibt zurück:
      optional maximum of milliseconds to record.
    • isPlaying

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

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

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

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

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

      The client type to use.
      Gibt zurück:
      the HTTP client type requested in the command line.
    • getProxy

      public URI getProxy()
      The HTTP proxy to use or NULL.
      Gibt zurück:
      the HTTP proxy requested in the command line.