2using System.Collections.Generic;
52 private System.Random random;
68 private bool hasPrintedError;
80 public override void Init()
82 random =
new System.Random();
88 hasPrintedError =
false;
106 _callback += p => p.UpdateSampleIncrement();
130 if (!hasPrintedError)
132 Debug.LogWarning($
"Cannot play a StationRadioTrack, as there are no stations!");
133 hasPrintedError =
true;
144 List<int> selectFrom =
new();
155 int trackIndex = selectFrom[random.Next(0, selectFrom.Count)];
A track to play as part of a radio. These are the fundamental objects that define the content of the ...
float SampleRate
The sample rate of this track.
virtual int SampleCount
The number of samples in this track.
A eventType of RadioTrack that contains other tracks. Has a custom editor in StationRadioTrackEditor ...
float thresholdBeforeRepeats
When randomSequence is true, this is the number of other tracks that need to be played before the sam...
StationRadioTrackWrapper CurrentTrackW
A reference to the track that's currently playing.
override float GetSample(int _sampleIndex)
Gets a sample from the currently playing track.
int[] remainingTracksBeforeRepeat
The number of plays that need to happen before each track can be played again. Follows the layout des...
override void Init()
Initializes this station and all contained tracks.
override void AddToPlayerEndCallback(ref Action< RadioTrackPlayer > _callback)
When a RadioTrackPlayer for this station finishes the track we've given it, we update it to use whate...
bool randomSequence
Whether or not this station plays in a random or semi-random order.
int currentTrackIndex
The index of the contained track that's currently playing.
List< StationRadioTrackWrapper > stationTrackWs
The tracks contained within this station.
const string DISPLAY_NAME
The display name of this track in the editor. Required by RadioTrack.
void NextTrack()
Selects the next track for this station to play.
A smaller, separate version of RadioTrackWrapper for use in a StationRadioTrack.
void Init()
Initialize the track stored in this wrapper.
Tracks to be used on a radio- includes base classes.