Public Member Functions |
Public Attributes |
Protected Member Functions |
Protected Attributes |
Properties |
List of all members
Crosstales.Radio.RadioPlayer Class Reference
Player for a radio station. More...
Inheritance diagram for Crosstales.Radio.RadioPlayer:
Public Member Functions | |
| override void | Play () |
| Plays the radio-station. More... | |
| override void | Stop () |
| Stops the playback of the radio-station. More... | |
| override void | Restart (float invokeDelay=Constants.INVOKE_DELAY) |
| Restarts the playback of the radio-station. More... | |
| virtual string | ToShortString () |
| void | Load () |
| Loads the RadioPlayer. More... | |
| void | Save () |
| Saves the RadioPlayer. More... | |
| override void | Mute () |
| Mute the playback of the record. More... | |
| override void | UnMute () |
| Unmute the playback of the record. More... | |
| override string | ToString () |
| virtual void | PlayInEditor (int channels=2, int sampleRate=44100) |
| Plays the radio-station (Editor only). More... | |
Public Member Functions inherited from Crosstales.Radio.BasePlayer | |
| virtual void | PlayOrStop () |
| Plays or stops the radio-station. More... | |
| virtual void | MuteOrUnMute () |
| Mute or unmute the playback of the record. More... | |
Public Attributes | |
| override bool | isPlayback => playback |
| override bool | isAudioPlaying => playback && !isBuffering |
| override bool | isBuffering => !bufferAvailable |
| override RecordInfo | RecordInfo => recordInfo |
| override RecordInfo | NextRecordInfo => nextRecordInfo |
| override float | NextRecordDelay => nextRecordDelay |
| override long | CurrentBufferSize => ms != null ? ms.Length - ms.Position : 0 |
| override long | CurrentDownloadSpeed => ms != null && PlayTime > 0f ? (long)(ms.Length / PlayTime) : 0 |
| override int | Channels => station?.Channels ?? 0 |
| override int | SampleRate => station?.SampleRate ?? 0 |
| PlaybackStartEvent | OnPlaybackStarted |
| BufferingStartEvent | OnBufferingStarted |
| BufferingEndEvent | OnBufferingEnded |
| AudioStartEvent | OnAudioStarted |
| AudioEndEvent | OnAudioEnded |
| PlaybackEndEvent | OnPlaybackEnded |
| RecordChangeEvent | OnRecordChanged |
| ErrorEvent | OnError |
Protected Member Functions | |
| override void | onPlaybackStart (RadioStation _station) |
| override void | onPlaybackEnd (RadioStation _station) |
| override void | onBufferingStart (RadioStation _station) |
| override void | onBufferingEnd (RadioStation _station) |
| override void | onAudioStart (RadioStation _station) |
| override void | onAudioEnd (RadioStation _station) |
| override void | onErrorInfo (RadioStation _station, string info) |
| override void | onRecordChange (RadioStation _station, RecordInfo newRecord) |
| override void | onRecordPlayTimeUpdate (RadioStation _station, RecordInfo record, float playtime) |
| override void | onNextRecordChange (RadioStation _station, RecordInfo nextRecord, float _delay) |
| override void | onNextRecordDelayUpdate (RadioStation _station, RecordInfo nextRecord, float _delay) |
Protected Member Functions inherited from Crosstales.Radio.BasePlayer | |
| virtual void | onBufferingProgressUpdate (RadioStation station, float progress) |
| virtual void | onAudioPlayTimeUpdate (RadioStation station, float _playtime) |
Protected Attributes | |
| NAudio.Wave.Mp3FileReader | nAudioReader |
| bool | stopped = true |
| bool | bufferAvailable |
| bool | playback |
| NVorbis.VorbisReader | nVorbisReader |
| NLayer.MpegFile | nLayerReader |
| override PlaybackStartEvent | onPlaybackStarted => OnPlaybackStarted |
| override PlaybackEndEvent | onPlaybackEnded => OnPlaybackEnded |
| override RecordChangeEvent | onRecordChanged => OnRecordChanged |
| override BufferingStartEvent | onBufferingStarted => OnBufferingStarted |
| override BufferingEndEvent | onBufferingEnded => OnBufferingEnded |
| override AudioStartEvent | onAudioStarted => OnAudioStarted |
| override AudioEndEvent | onAudioEnded => OnAudioEnded |
| override ErrorEvent | onError => OnError |
Properties | |
| static RadioPlayer | Instance [get] |
| Returns the singleton instance of this class. More... | |
| override RadioStation | Station [get, set] |
| bool | PlayOnStart [get, set] |
| Play the RadioPlayer on start on/off. More... | |
| float | Delay [get, set] |
| Delay in seconds until the RadioPlayer starts playing. More... | |
| override bool | HandleFocus [get, set] |
| override int? | CacheStreamSize [get, set] |
| override bool | LegacyMode [get, set] |
| override bool | CaptureDataStream [get, set] |
| override bool | SkipPreBuffering [get, set] |
| override AudioSource | Source [get, protected set] |
| override AudioCodec | Codec [get, protected set] |
| override float | PlayTime [get, protected set] |
| override float | BufferProgress [get, protected set] |
| override float | RecordPlayTime [get, protected set] |
| override Crosstales.Common.Util.MemoryCacheStream | DataStream [get, protected set] |
| override float? | Volume [get, set] |
| override float? | Pitch [get, set] |
| override float? | StereoPan [get, set] |
| override bool | isMuted [get, set] |
Properties inherited from Crosstales.Radio.BasePlayer | |
| static int? | playCounter [get, set] |
| static int? | audioCounter [get, set] |
| abstract PlaybackStartEvent | onPlaybackStarted [get] |
| abstract PlaybackEndEvent | onPlaybackEnded [get] |
| abstract BufferingStartEvent | onBufferingStarted [get] |
| abstract BufferingEndEvent | onBufferingEnded [get] |
| abstract AudioStartEvent | onAudioStarted [get] |
| abstract AudioEndEvent | onAudioEnded [get] |
| abstract RecordChangeEvent | onRecordChanged [get] |
| abstract ErrorEvent | onError [get] |
| abstract RadioStation | Station [get, set] |
| abstract bool | HandleFocus [get, set] |
| abstract int | CacheStreamSize [get, set] |
| abstract bool | LegacyMode [get, set] |
| abstract bool | CaptureDataStream [get, set] |
| abstract bool | SkipPreBuffering [get, set] |
| abstract AudioSource | Source [get, protected set] |
| abstract AudioCodec | Codec [get, protected set] |
| abstract float | PlayTime [get, protected set] |
| abstract float | BufferProgress [get, protected set] |
| abstract bool | isBuffering [get] |
| abstract long | CurrentBufferSize [get] |
| abstract bool | isPlayback [get] |
| abstract bool | isAudioPlaying [get] |
| abstract float | RecordPlayTime [get, protected set] |
| abstract RecordInfo | RecordInfo [get] |
| abstract RecordInfo | NextRecordInfo [get] |
| abstract float | NextRecordDelay [get] |
| abstract long | CurrentDownloadSpeed [get] |
| abstract Crosstales.Common.Util.MemoryCacheStream | DataStream [get, protected set] |
| abstract int | Channels [get] |
| abstract int | SampleRate [get] |
| abstract float | Volume [get, set] |
| abstract float | Pitch [get, set] |
| abstract float | StereoPan [get, set] |
| abstract bool | isMuted [get, set] |
Properties inherited from Crosstales.Radio.IPlayer | |
| RadioStation | Station [get, set] |
| Current RadioStation of this player. More... | |
| bool | HandleFocus [get, set] |
| Starts and stops the RadioPlayer depending on the focus and running state. More... | |
| int | CacheStreamSize [get, set] |
| Size of the cache stream in bytes. More... | |
| bool | LegacyMode [get, set] |
| Enable or disable legacy mode. Legacy mode disables all record information, but is more stable. More... | |
| bool | CaptureDataStream [get, set] |
| Capture the encoded PCM-stream from this player. More... | |
| bool | SkipPreBuffering [get, set] |
| Enable or disable skipping of the pre-buffering. Skip pre-buffering allows for faster playback, but is less resilient. More... | |
| AudioSource | Source [get] |
| Returns the AudioSource of for this player. More... | |
| AudioCodec | Codec [get] |
| Returns the codec of for this player. More... | |
| float | PlayTime [get] |
| Returns the current playtime of this player. More... | |
| float | BufferProgress [get] |
| Returns the current buffer progress in percent. More... | |
| bool | isBuffering [get] |
| Is this player buffering? More... | |
| long | CurrentBufferSize [get] |
| Returns the size of the current buffer in bytes. More... | |
| bool | isPlayback [get] |
| Is this player in playback-mode? More... | |
| bool | isAudioPlaying [get] |
| Is this player playing audio? More... | |
| float | RecordPlayTime [get] |
| Returns the playtime of the current audio record. More... | |
| RecordInfo | RecordInfo [get] |
| Returns the information about the current audio record. More... | |
| RecordInfo | NextRecordInfo [get] |
| Returns the information about the next audio record. This information is updated a few seconds before a new record starts. More... | |
| float | NextRecordDelay [get] |
| Returns the current delay in seconds until the next audio record starts. More... | |
| long | CurrentDownloadSpeed [get] |
| Returns the current download speed in Bytes per second. More... | |
| Crosstales.Common.Util.MemoryCacheStream | DataStream [get] |
| Returns the encoded PCM-stream from this player. More... | |
| int | Channels [get] |
| Current audio channels of the current station. More... | |
| int | SampleRate [get] |
| Current audio sample rate of the current station. More... | |
| float | Volume [get, set] |
| Current volume of this player. More... | |
| float | Pitch [get, set] |
| Current pitch of this player. More... | |
| float | StereoPan [get, set] |
| Current stereo pan of this player. More... | |
| bool | isMuted [get, set] |
| Is this player muted? More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Crosstales.Radio.BasePlayer | |
| static bool | isAnyPlayback => playCounter > 0 |
| Checks if ANY RadioPlayer is in playback-mode on this system. More... | |
| static bool | isAnyAudioPlaying => audioCounter > 0 |
| Checks if ANY RadioPlayer playing audio on this system. More... | |
Events inherited from Crosstales.Radio.BasePlayer | |
| PlaybackStart | OnPlaybackStart |
| An event triggered whenever the playback starts. More... | |
| PlaybackEnd | OnPlaybackEnd |
| An event triggered whenever the playback ends. More... | |
| BufferingStart | OnBufferingStart |
| An event triggered whenever the buffering starts. More... | |
| BufferingEnd | OnBufferingEnd |
| An event triggered whenever the buffering ends. More... | |
| BufferingProgressUpdate | OnBufferingProgressUpdate |
| An event triggered whenever the buffering progress changes. More... | |
| AudioStart | OnAudioStart |
| An event triggered whenever the audio starts. More... | |
| AudioEnd | OnAudioEnd |
| An event triggered whenever the audio ends. More... | |
| AudioPlayTimeUpdate | OnAudioPlayTimeUpdate |
| An event triggered whenever the audio playtime changes. More... | |
| RecordChange | OnRecordChange |
| An event triggered whenever an audio record changes. More... | |
| RecordPlayTimeUpdate | OnRecordPlayTimeUpdate |
| An event triggered whenever the audio record playtime changes. More... | |
| NextRecordChange | OnNextRecordChange |
| An event triggered whenever the next record information is available. More... | |
| NextRecordDelayUpdate | OnNextRecordDelayUpdate |
| An event triggered whenever the next record delay time changes. More... | |
| ErrorInfo | OnErrorInfo |
| An event triggered whenever an error occurs. More... | |
Detailed Description
Player for a radio station.
Member Function Documentation
◆ Load()
| void Crosstales.Radio.RadioPlayer.Load | ( | ) |
Loads the RadioPlayer.
◆ Mute()
|
virtual |
Mute the playback of the record.
Implements Crosstales.Radio.BasePlayer.
◆ Play()
|
virtual |
Plays the radio-station.
Implements Crosstales.Radio.BasePlayer.
◆ PlayInEditor()
|
virtual |
Plays the radio-station (Editor only).
- Parameters
-
channels Number of audio channels (default: 2, optional) sampleRate Sample rate of the audio (default: 44100, optional)
◆ Restart()
|
virtual |
Restarts the playback of the radio-station.
- Parameters
-
invokeDelay Delay for the restart (default: 0.4, optional)
Implements Crosstales.Radio.BasePlayer.
◆ Save()
| void Crosstales.Radio.RadioPlayer.Save | ( | ) |
Saves the RadioPlayer.
◆ Stop()
|
virtual |
Stops the playback of the radio-station.
Implements Crosstales.Radio.BasePlayer.
◆ UnMute()
|
virtual |
Unmute the playback of the record.
Implements Crosstales.Radio.BasePlayer.
Property Documentation
◆ Delay
|
getset |
Delay in seconds until the RadioPlayer starts playing.
◆ Instance
|
staticget |
Returns the singleton instance of this class.
- Returns
- Singleton instance of this class.
◆ PlayOnStart
|
getset |
Play the RadioPlayer on start on/off.
The documentation for this class was generated from the following file:
- C:/Users/slaub/Unity/assets/Radio/RadioPro/Assets/Plugins/crosstales/Radio/Scripts/RadioPlayer.cs
Public Member Functions inherited from