![]() |
Ryle Radio 1.0.0
An open-source "radio" system for Unity, allowing tracks, tuning, broadcasters, and more!
|
A track to play as part of a radio. These are the fundamental objects that define the content of the radio, such as clips, procedural audio, stations, and any custom content you create. More...
Public Member Functions | |
| void | Init () |
| Initializes this track. | |
| float | GetSample (int _sampleIndex) |
| Gets a sample from the track. | |
| virtual void | AddToPlayerEndCallback (ref Action< RadioTrackPlayer > _callback) |
| Activates an event to run whenever this track ends. This is mainly used for stations to switch track when the previous one ends. | |
Properties | |
| float | SampleRate [get, set] |
| The sample rate of this track. | |
| virtual int | SampleCount [get, set] |
| The number of samples in this track. | |
A track to play as part of a radio. These are the fundamental objects that define the content of the radio, such as clips, procedural audio, stations, and any custom content you create.
NOTE FOR CUSTOM TRACK CREATORS!!
!!! IMPORTANT NOTE - if you're creating a custom RadioTrack, you need to both inherit from this class AND have a const string named DISPLAY_NAME. Because the version of c# unity uses does not support static virtual data, we have no way of enforcing that you do this- but you will get errors otherwise It's necessary for wrappers when they're listing each available track eventType in a dropdown- NaughtyAttributes' reflection system is used to pull the display id so that it's selectable in the inspector. the only downside is a lack of enforcement :(((
Definition at line 19 of file RadioTrack.cs.
|
virtual |
Activates an event to run whenever this track ends. This is mainly used for stations to switch track when the previous one ends.
| _callback | A function to run when this track ends |
Implements RyleRadio.Tracks.IRadioTrack.
Reimplemented in RyleRadio.Tracks.StationRadioTrack.
Definition at line 53 of file RadioTrack.cs.
|
abstract |
Gets a sample from the track.
| _sampleIndex | The index of the sample to retrieve |
Implements RyleRadio.Tracks.IRadioTrack.
|
abstract |
|
getset |
The number of samples in this track.
Implements RyleRadio.Tracks.IRadioTrack.
Definition at line 33 of file RadioTrack.cs.
Referenced by RyleRadio.Tracks.ClipRadioTrack.Init(), RyleRadio.Tracks.ProceduralRadioTrack.Init(), and RyleRadio.Tracks.StationRadioTrack.NextTrack().
|
getset |
The sample rate of this track.
Implements RyleRadio.Tracks.IRadioTrack.
Definition at line 27 of file RadioTrack.cs.
Referenced by RyleRadio.Tracks.ProceduralRadioTrack.GetSample(), RyleRadio.Tracks.ClipRadioTrack.Init(), RyleRadio.Tracks.ProceduralRadioTrack.Init(), and RyleRadio.Tracks.StationRadioTrack.NextTrack().