Package de.sfuhrm.radiorecorder
Class ConsumerContext
java.lang.Object
de.sfuhrm.radiorecorder.ConsumerContext
Immutable context common to all consumers.
Holds the data necessary to record or play one stream from one
radio station.
- Author:
- Stephan Fuhrmann
-
Constructor Summary
ConstructorsConstructorDescriptionConsumerContext(int id, Radio radio, Params params) Constructor for a consumer context. -
Method Summary
Modifier and TypeMethodDescriptionGet the amount of bytes after which to abort.Get the amount of bytes after which to abort.The cast device to cast to.The client type to use.longGet minimum free bytes.The mixer to play on.The format of the files to generate.getProxy()The HTTP proxy to use or NULL.The format of the files to generate.Get the directory to write files to.intGet the read/connect timeout in millis.booleanWhether to play or store.booleanReconnect forever.booleanWhether to name the files after the metadata retrieved.
-
Constructor Details
-
ConsumerContext
Constructor for a consumer context.- Parameters:
id- numerical unique id of this context.radio- the radio station to process in this context.params- the command line parameters.
-
-
Method Details
-
getTimeout
public int getTimeout()Get the read/connect timeout in millis.- Returns:
- the timeout in milliseconds.
-
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.
-
getAbortAfterFileLength
Get the amount of bytes after which to abort.- Returns:
- optional maximum of bytes after which to abort writing to write to disk.
-
getAbortAfterDuration
Get the amount of bytes after which to abort.- Returns:
- optional maximum of milliseconds to record.
-
isPlaying
public boolean isPlaying()Whether to play or store.- Returns:
trueif playing was requested on the command line,falseotherwise.
-
isSongNames
public boolean isSongNames()Whether to name the files after the metadata retrieved.- Returns:
trueif metadata naming was requested on the command line,falseotherwise.
-
isReconnect
public boolean isReconnect()Reconnect forever.- Returns:
trueif reconnecting was requested on the command line,falseotherwise.
-
getCastReceiver
The cast device to cast to.- Returns:
- the name of the chrome cast receiver to play on.
-
getMixerInfo
The mixer to play on.- Returns:
- the mixer info to play on, or
nullif the default is ok.
-
getHttpClient
The client type to use.- Returns:
- the HTTP client type requested in the command line.
-
getProxy
The HTTP proxy to use or NULL.- Returns:
- the HTTP proxy requested in the command line.
-
getSongnameFormat
The format of the files to generate.- Returns:
- pattern on how to create file names.
- See Also:
-
getNoSongnameFormat
The format of the files to generate.- Returns:
- pattern on how to create file names.
- See Also:
-