Release TvTunes alternative for playing soundtracks when browsing
#1
Hi, I have been long waiting for some alternative to play soundtracks when browsing movies and tvshows without TvTunes addon. I already had a theme.mp3 file in every movie/tvshow folder, so it was just a matter of playing them while browsing. I have devised a way without even using any addon, it consists on adding three little xml.files to your xml's skin folder, for instance:

customStartSoundtrack.xml
xml:

<window type="dialog" id="1355">
    <onload>Stop</onload>
    <onload condition="String.IsEmpty(Window(home).Property(PlayingOST)) + !String.Contains(ListItem.Path,http)">PlayMedia($ESCINFO[ListItem.Path,,theme.mp3])</onload>
    <onload>SetProperty(OST,$INFO[ListItem.Path],home)</onload>
    <onload>SetProperty(PlayingOST,True,home)</onload>
    <visible>System.IdleTime(2) + [!String.IsEqual(ListItem.Path,Window(home).Property(OST)) | !Player.Playing]</visible>
    <visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:) + !String.Contains(ListItem.Path,plugin) + !String.Contains(ListItem.Path,videodb:)</visible>
    <visible>Container.Content(movies) | [Container.Content(tvshows) + !Player.Playing] | [Container.Content(seasons) + !Player.Playing]</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <visible>Window.IsActive(videos)</visible>
    <controls>
    </controls>
</window>

...and...

customStopSoundtrack.xml
xml:

<window type="dialog" id="1255">
    <onload condition="Player.Playing">Pause</onload>
    <onload>ClearProperty(PlayingOST,Home)</onload>
    <visible>!String.IsEqual(ListItem.Path,Window(home).Property(OST))</visible>
    <visible>Container.Content(movies) | Container.Content(tvshows)</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <controls></controls>
</window>

...and...

customRidSoundtrack.xml
xml:

<window type="dialog" id="1305">
    <onload>Stop</onload>
    <onload>ClearProperty(PlayingOST,Home)</onload>
    <visible>String.Contains(Player.Filenameandpath,theme.mp3) + [!Window.IsActive(videos) | String.IsEmpty(ListItem.Path) | ListItem.IsCollection]</visible>
    <controls>
    </controls>
</window>

It should work in every skin and can be tested without much hassle...

If you happen to have in your skin an option to go fullscreen when music starts to play you should find and edit that xml, it could be named something like CustomMusicFullscreen.xml or something like that, then you have to change line from...
xml:
<onload condition="!Window.IsActive(visualisation)">FullScreen</onload>
...to...
xml:
<onload condition="!Window.IsActive(visualisation) + !Window.IsActive(videos)">FullScreen</onload>


Edit 1: (updated 24/05/18) From 30/03 nightlies onwards (https://github.com/xbmc/xbmc/pull/13699) you could get unwanted effects in screen; it's related to the file DialogBusy.xml and to solve the issue it's necessary to add an onload with a condition at the beginning of DialogBusy.xml, just after the <window> line...
xml:
<window>
<onload condition="String.Contains(Player.Filenameandpath,theme.mp3) | !String.IsEmpty(Window(home).Property(PlayingOST))">Dialog.Close(all,true)</onload>
...to prevent DialogBusy.xml from running when playing the theme.mp3 files


Edit 2: Change in third line of customStartSoundtrack.xml to prevent a bug that freezes Kodi when using an addon to select online artworks:
Old:
xml:
<onload condition="String.IsEmpty(Window(home).Property(PlayingOST))">PlayMedia($ESCINFO[ListItem.Path,,theme.mp3])</onload>
New:
xml:
<onload condition="String.IsEmpty(Window(home).Property(PlayingOST)) + !String.Contains(ListItem.Path,http)">PlayMedia($ESCINFO[ListItem.Path,,theme.mp3])</onload>

Edit 3: Change in customStartSoundtrack.xml to prevent error messages when browsing online video streams:
Old:
xml:
<visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:)</visible>
New:
xml:
<visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:) + !String.Contains(ListItem.Path,plugin)</visible>

Edit 4: See edit 1

Edit 5: Change in customStartSoundtrack.xml to prevent errors when option 'Show parent folder items' is selected:
Old:
xml:
<visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:) + !String.Contains(ListItem.Path,plugin)</visible>
New:
xml:
<visible>!ListItem.IsCollection + !String.Contains(ListItem.Path,thumb:) + !String.Contains(ListItem.Path,image:) + !String.Contains(ListItem.Path,plugin) + !String.Contains(ListItem.Path,videodb:)</visible>
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply


Messages In This Thread
TvTunes alternative for playing soundtracks when browsing - by manfeed - 2018-04-12, 21:41
Logout Mark Read Team Forum Stats Members Help
TvTunes alternative for playing soundtracks when browsing2