public class Soundscape extends AudioPlayer
Modifier and Type | Class and Description |
---|---|
(package private) class |
Soundscape.IdleEntry
Action taken before the state machine enters
AppState#IDLE -> removes every callbacks,
nullify AudioPlayer.player_ and sets the application wide audio state to AudioPlayer.AppState.IDLE . |
(package private) class |
Soundscape.PendingEntry
Action taken before the state machine enters
AppState#PENDING -> starts the silence_runnable_ . |
AudioPlayer.AppState, AudioPlayer.AppTrigger, AudioPlayer.AudioType, AudioPlayer.BufferEntry, AudioPlayer.CompleteEntry, AudioPlayer.PauseEntry, AudioPlayer.PlayEntry, AudioPlayer.PlayGuard, AudioPlayer.PrepareEntry
Modifier and Type | Field and Description |
---|---|
private short |
silence_duration_
The elpased duration of silence (in seconds).
|
private android.os.Handler |
silence_handler_
Thread tracked the elapsed amount of silence.
|
private java.lang.Runnable |
silence_runnable_
Silence thread action's interface.
|
buffer_handler_, buffer_runnable_, context_, fsm_, fsm_config_, player_, prepared_
Constructor and Description |
---|
Soundscape(android.content.Context context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
await()
AppTrigger#await trigger. |
void |
next()
Requests the next random track of the soundscape.
|
void |
play()
AppTrigger#play trigger. |
protected android.net.Uri |
select_track()
Given
Constants.AREA_TRACKS_AMOUNT , returns a random track. |
AudioPlayer.AppState |
state()
Returns the actual fsm's
AppState . |
clear_, destroy, fade_out, onBufferingUpdate, onCompletion, onPrepared, pause, share
@NonNull private final android.os.Handler silence_handler_
@NonNull private final java.lang.Runnable silence_runnable_
private short silence_duration_
public Soundscape(@NonNull android.content.Context context)
context
- Application Context
protected android.net.Uri select_track()
Constants.AREA_TRACKS_AMOUNT
, returns a random track.select_track
in class AudioPlayer
Uri
instance.public AudioPlayer.AppState state()
AppState
.state
in class AudioPlayer
AudioPlayer.AppState
variable.public void play()
AppTrigger#play
trigger.play
in class AudioPlayer
public void await()
AppTrigger#await
trigger.public void next()