wiki.sine.space | sinespace

Scripting/SSceneBackgroundMusic

From wiki.sine.space
Revision as of 19:51, 27 December 2020 by Voidtech (Talk | contribs) (Added simple examples to all members (8) of SSceneBackgroundMusic)

Jump to: navigation, search

Members

OnTrackChange

void OnTrackChange (Closure o)

Function will be called when track changes.

otc = function(trackInfo)
Space.Log(trackInfo.Title)
Space.Log(trackInfo.Artist)
  end
Space.Host.ExecutingObject.Radio.OnTrackChange(otc)


OnUpcomingTrackChange

void OnUpcomingTrackChange (Closure o)

Function will be called when there's an upcoming track change

otc = function(trackInfo)
Space.Log(trackInfo.Title)
Space.Log(trackInfo.Artist)
  end
Space.Host.ExecutingObject.Radio.OnUpcomingTrackChange(otc)


Play

void Play ()

Plays the radio stream

Space.Host.ExecutingObject.Radio.Play()


PlayMP3Stream

void PlayMP3Stream (string url)

Sets the given MP3 stream url as current stream

Space.Host.ExecutingObject.Radio.PlayMP3Stream("http://stream.example.org:1234/")


PlayVorbisStream

void PlayVorbisStream (string url)

Sets the given Vorbis stream url as current stream

Space.Host.ExecutingObject.Radio.PlayVorbisStream("http://stream.example.org:1234/")


Stop

void Stop ()

Stops playing the radio stream

Space.Host.ExecutingObject.Radio.Stop()



Properties

Enabled

bool Enabled { get; set; }

Is this component Enabled?

Space.Host.ExecutingObject.Radio.Enabled = true


URL

string URL { get; }

URL of the current stream

streamURL = Space.Host.ExecutingObject.Radio.URL