Ryle Radio 1.0.0
An open-source "radio" system for Unity, allowing tracks, tuning, broadcasters, and more!
Loading...
Searching...
No Matches
RyleRadio.Tracks.RadioTrack Class Referenceabstract

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...

Inheritance diagram for RyleRadio.Tracks.RadioTrack:

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.

Detailed Description

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.

IRadioTrack

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.

Member Function Documentation

◆ AddToPlayerEndCallback()

virtual void RyleRadio.Tracks.RadioTrack.AddToPlayerEndCallback ( ref Action< RadioTrackPlayer > _callback)
virtual

Activates an event to run whenever this track ends. This is mainly used for stations to switch track when the previous one ends.

Parameters
_callbackA function to run when this track ends

Implements RyleRadio.Tracks.IRadioTrack.

Reimplemented in RyleRadio.Tracks.StationRadioTrack.

Definition at line 53 of file RadioTrack.cs.

◆ GetSample()

float RyleRadio.Tracks.RadioTrack.GetSample ( int _sampleIndex)
abstract

Gets a sample from the track.

Parameters
_sampleIndexThe index of the sample to retrieve
Returns
The height of the sample

IRadioTrack.GetSample(int)

Implements RyleRadio.Tracks.IRadioTrack.

◆ Init()

void RyleRadio.Tracks.RadioTrack.Init ( )
abstract

Initializes this track.

IRadioTrack.Init

Implements RyleRadio.Tracks.IRadioTrack.

Property Documentation

◆ SampleCount

virtual int RyleRadio.Tracks.RadioTrack.SampleCount
getset

◆ SampleRate


The documentation for this class was generated from the following file: