(Added and defined all members (8) of SSceneBackgroundMusic) |
(Added simple examples to all members (8) of SSceneBackgroundMusic) |
||
Line 1: | Line 1: | ||
=Members= | =Members= | ||
− | {{ScriptFunction|void|OnTrackChange|(Closure o)|Function will be called when track changes|5=<pre></pre>}} | + | {{ScriptFunction|void|OnTrackChange|(Closure o)|Function will be called when track changes. |5=<pre>otc = function(trackInfo) |
+ | Space.Log(trackInfo.Title) | ||
+ | Space.Log(trackInfo.Artist) | ||
+ | end | ||
+ | Space.Host.ExecutingObject.Radio.OnTrackChange(otc)</pre>}} | ||
− | {{ScriptFunction|void|OnUpcomingTrackChange|(Closure o)|Function will be called when there's an upcoming track change|5=<pre></pre>}} | + | {{ScriptFunction|void|OnUpcomingTrackChange|(Closure o)|Function will be called when there's an upcoming track change|5=<pre>otc = function(trackInfo) |
+ | Space.Log(trackInfo.Title) | ||
+ | Space.Log(trackInfo.Artist) | ||
+ | end | ||
+ | Space.Host.ExecutingObject.Radio.OnUpcomingTrackChange(otc)</pre>}} | ||
− | {{ScriptFunction|void|Play|()|Plays the radio stream|5=<pre></pre>}} | + | {{ScriptFunction|void|Play|()|Plays the radio stream|5=<pre>Space.Host.ExecutingObject.Radio.Play()</pre>}} |
− | {{ScriptFunction|void|PlayMP3Stream|(string url)|Sets the given MP3 stream url as current stream|5=<pre></pre>}} | + | {{ScriptFunction|void|PlayMP3Stream|(string url)|Sets the given MP3 stream url as current stream|5=<pre>Space.Host.ExecutingObject.Radio.PlayMP3Stream("http://stream.example.org:1234/")</pre>}} |
− | {{ScriptFunction|void|PlayVorbisStream|(string url)|Sets the given Vorbis stream url as current stream|5=<pre></pre>}} | + | {{ScriptFunction|void|PlayVorbisStream|(string url)|Sets the given Vorbis stream url as current stream|5=<pre>Space.Host.ExecutingObject.Radio.PlayVorbisStream("http://stream.example.org:1234/")</pre>}} |
− | {{ScriptFunction|void|Stop|()|Stops playing the radio stream|5=<pre></pre>}} | + | {{ScriptFunction|void|Stop|()|Stops playing the radio stream|5=<pre>Space.Host.ExecutingObject.Radio.Stop()</pre>}} |
Line 16: | Line 24: | ||
=Properties= | =Properties= | ||
− | {{ScriptFunction|bool|Enabled|{ get; set; }|Is this component Enabled?|5= <pre></pre>}} | + | {{ScriptFunction|bool|Enabled|{ get; set; }|Is this component Enabled?|5= <pre>Space.Host.ExecutingObject.Radio.Enabled = true</pre>}} |
− | {{ScriptFunction|string|URL|{ get; }|URL of the current stream|5= <pre></pre>}} | + | {{ScriptFunction|string|URL|{ get; }|URL of the current stream|5= <pre>streamURL = Space.Host.ExecutingObject.Radio.URL </pre>}} |
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)
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)
Plays the radio stream
Space.Host.ExecutingObject.Radio.Play()
Sets the given MP3 stream url as current stream
Space.Host.ExecutingObject.Radio.PlayMP3Stream("http://stream.example.org:1234/")
Sets the given Vorbis stream url as current stream
Space.Host.ExecutingObject.Radio.PlayVorbisStream("http://stream.example.org:1234/")
Stops playing the radio stream
Space.Host.ExecutingObject.Radio.Stop()
Is this component Enabled?
Space.Host.ExecutingObject.Radio.Enabled = true
URL of the current stream
streamURL = Space.Host.ExecutingObject.Radio.URL
|