To get it run when you switch to the music OSD you need to add
xml:
<onload condition="System.HasAddon(script.radio.streaming.helper)">RunScript(script.radio.streaming.helper)</onload>
to MusicVisualisation.xml
It needs to be inside the <window> tag at the top of the file. eg
xml:
<?xml version="1.0" encoding="utf-8"?>
<window>
<onload condition="System.HasAddon(script.radio.streaming.helper)">RunScript(script.radio.streaming.helper)</onload>
<onload condition="System.HasAddon(script.artistslideshow)">RunScript(script.artistslideshow)</onload>
<defaultcontrol></defaultcontrol>
<backgroundcolor>background</backgroundcolor>
<controls>
You'll need to point it to your music library in the addon settings, else it will keep asking for the location.
(2019-09-29, 09:17)sba923 Wrote: Next to that, further down the line I will need to be able to detect whether MusicOSD.xml (more specifically, PlayerControlCommons in IncludesPlayerControls.xml) is used for streaming radio / the properties you're adding do exist as opposed to other uses (e.g. my UPnP use case) so that the standard properties e.g. $INFO[MusicPlayer.Artist] are used instead of yours e.g. $INFO[Window(12006).Property(srh.Artist)]. Can you help me out with that? For instance, is there a "if exist" mechanism that can be used in skin XML code?
I'm not totally clear on what you're asking here but if it's what I think it is, you can use the <visible> tag to show or hide the extra properties depending on whether the currently playing file is a stream or a local track.
For example,
<visible>!Pvr.IsPlayingRadio + !Player.IsInternetStream</visible>
will only show that control for a locally playing track. If either of those conditions are true (so Kodi
is playing either a stream or a radio station from a pvr backend) then it won't be shown.
You can also use
!StringIsEmpty(Window(Visualisation).Property(srh.SomeProperty))
to determine whether or not that particular property contains a value and then show or hide the control accordingly.
xml:
<control type="image">
<depth>DepthOSD+</depth>
<left>15</left>
<bottom>5</bottom>
<width>405</width>
<height>405</height>
<aspectratio aligny="bottom" align="center">keep</aspectratio>
<texture background="true" fallback="DefaultAudio.png">$VAR[MusicPlayerCover]</texture>
<bordersize>20</bordersize>
<visible>Player.HasAudio + Window.IsVisible(MusicVisualisation.xml) + !Pvr.IsPlayingRadio + !Player.IsInternetStream</visible>
</control>
<control type="image">
<left>15</left>
<bottom>5</bottom>
<width>405</width>
<height>405</height>
<aspectratio aligny="bottom" align="center">keep</aspectratio>
<texture background="true" fallback="DefaultAudio.png">$INFO[Window(Visualisation).Property(srh.AlbumCover)]</texture>
<bordersize>20</bordersize>
<visible>Player.HasAudio + Window.IsVisible(MusicVisualisation.xml) + Player.IsInternetStream</visible>
</control>
The top control is displayed if we are not playing any radio from somewhere but we
are in the music visualisation screen and we are playing some audio. The second is displayed if we
are streaming from the internet. Both controls are in the same place in the window, we just decide which to show based on whether or not the audio playing is coming from the internet or not.
Hope that helps a bit.