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
#2
Hello @manfeed

I created these two xml files and added them to Transparency! and restarted Kodi. They work great!!

I imagine you have no control over this, but do you have any idea why it will play mp3 themes, but not flac themes?
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
(2018-04-15, 11:45)Karellen Wrote: Hello @manfeed

I created these two xml files and added them to Transparency! and restarted Kodi. They work great!!

I imagine you have no control over this, but do you have any idea why it will play mp3 themes, but not flac themes?

You have to change the onload condition if your theme files are flac:
Code:
<onload>PlayMedia($INFO[ListItem.Path,,theme.mp3])</onload>

Change to
Code:
<onload>PlayMedia($INFO[ListItem.Path,,theme.flac])</onload>

Unfortunately, there is no way to check whether a local file exits in the skinning engine, so you are stuck with choosing one particular file type.
I haven't tested, but you might be able to get away with stacking them together. Off the top of my head, I'm not sure if PlayMedia will stop playback even if the file doesn't exist.
e.g. You could try
Code:
<onload>PlayMedia($INFO[ListItem.Path,,theme.mp3])</onload>
<onload>PlayMedia($INFO[ListItem.Path,,theme.flac])</onload>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#4
@jurialmunkey 

FYI
 
Code:
RunScript(script.skin.helper.service,action=fileexists,file=[filenamepath],skinstring=[skinstring to store the result],windowprop=[windowprop to store the result])
Quote:This command will check the filesystem if a particular file exists and will write the results to either a skin string or window property. If the file exists, the result will be written as EXISTS in the property or skinstring, if it doesn't exist, the property/string will be empty.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#5
I have updated the first post with an improved new method that allows a smoother browsing and in addition the soundtrack won't stop nor restart in video information and other windows.
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#6
Great to see that there is now an alternative to TvTunes. Nevertheless it won't work for me in v18 with Estuary or EstuaryModV2.
HTPC: Windows 10 Pro 22H2, Zalman HD135, Intel i3-7100, GTX 1070, UHD ASUS BW-16D1HT
NAS: Xpenology 7.2 Update 1, Intel i5-6600
Reply
#7
I have checked in v18 and Estuary official and in works faultlessly for me...
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#8
Ok, tried again and now it works with Estuary but still not with EstuaryMod2. I will ask Guilouz.
HTPC: Windows 10 Pro 22H2, Zalman HD135, Intel i3-7100, GTX 1070, UHD ASUS BW-16D1HT
NAS: Xpenology 7.2 Update 1, Intel i5-6600
Reply
#9
Thanks for this! I've missed TvTunes alot.

It seems to work pretty well for me (Kodi 17.6, Aeon Nox 5: SiLVO SKIN, v6.0.13). I wasn't exactly sure where to put the files but I put them here:
Users\WiFi_\AppData\Roaming\Kodi\addons\skin.aeon.nox.silvo\16x9 and it works! Now to find a few dozen new theme files...

Thanks again!
Matrix 19.x (LE), Aeon Nox SiLVO, NUC8i5BEK (i5-8259U, Intel Iris Plus Graphics 655, 16 GB ram, 128 GB M.2 SSD)
Samsung F6300 46" LED LCD TV, SMSL Q5 Pro amplifier, Pioneer HPM-100 speakers
Synology DS215j NAS fileserver (WD Gold 10TB x 2)
Reply
#10
(2018-04-15, 13:56)sualfred Wrote: @jurialmunkey 

FYI
 
Code:
RunScript(script.skin.helper.service,action=fileexists,file=[filenamepath],skinstring=[skinstring to store the result],windowprop=[windowprop to store the result])

Yeah I know about that, but it kinda defeats the purpose of an addon free method. Plus it's not really feasible to use for checking multiple file extensions.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#11
(2018-04-15, 17:51)tehax Wrote: Ok, tried again and now it works with Estuary but still not with EstuaryMod2. I will ask Guilouz.

Check that the window id numbers don't conflict with an existing custom window in the mod.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#12
Thanks @jurialmunkey, the following didn't quite work. Flac files played fine, mp3 files played for about 1 second then stopped. I guess it finds the mp3 file, then immediately moves onto looking for a flac file. Anyway to get an "or" in there?

(2018-04-15, 13:37)jurialmunkey Wrote: <onload>PlayMedia($INFO[ListItem.Path,,theme.mp3])</onload>
<onload>PlayMedia($INFO[ListItem.Path,,theme.flac])</onload>

I haven't tried the updated @manfeed version in post 1 yet, but it looks as if it is still limited to mp3 only.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#13
@Karellen - I thought that might happen. Unfortunately, that means that you are stuck with choosing only one filename/filetype to play. The updated method has the same limitation.

The only other potential solution I can think of is to use a wildcard, but I highly doubt this will work:
Code:
<onload>PlayMedia($INFO[ListItem.Path,,theme.*])</onload>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#14
Thanks @jurialmunkey

No problems and thanks for the help. It is a minor matter to convert to a single file type, so I will do that instead.

If the above suggestion works, I will post back confirming it does.

---Edit---
Nope, it did not work. Nothing plays. Thanks anyway Smile
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#15
@Karellen for your special case only I can think of is to add another window, if would be this way (total 4 xml files)...

customStartSoundtrack.xml
xml:

<window type="dialog" id="1355">
    <allowoverlay>no</allowoverlay>
    <onload>Stop</onload>
    <onload>PlayMedia($ESCINFO[ListItem.Path,,theme.mp3])</onload>
    <onload>SetProperty(OST,$INFO[ListItem.Path],home)</onload>
    <visible>System.IdleTime(2) + [!String.IsEqual(ListItem.Path,Window(home).Property(OST)) | !Player.Playing]</visible>
    <visible>!ListItem.IsCollection</visible>
    <visible>Container.Content(movies) | [Container.Content(tvshows) + !Player.Playing] | [Container.Content(seasons) + !Player.Playing]</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <controls>
    </controls>
</window>

customStartSoundtrackFlac.xml
xml:

<window type="dialog" id="1356">
    <allowoverlay>no</allowoverlay>
    <onload>Stop</onload>
    <onload>PlayMedia($ESCINFO[ListItem.Path,,theme.flac])</onload>
    <onload>SetProperty(OST,$INFO[ListItem.Path],home)</onload>
    <visible>System.IdleTime(3) + [!String.IsEqual(ListItem.Path,Window(home).Property(OST)) | !Player.Playing]</visible>
    <visible>!ListItem.IsCollection</visible>
    <visible>Container.Content(movies) | [Container.Content(tvshows) + !Player.Playing] | [Container.Content(seasons) + !Player.Playing]</visible>
    <visible>!Window.IsActive(movieinformation)</visible>
    <visible>!String.Contains(Player.Filenameandpath,theme.mp3)</visible>
    <controls>
    </controls>
</window>

customStopSoundtrack.xml
xml:

<window type="dialog" id="1255">
    <allowoverlay>no</allowoverlay>
    <onload>Pause</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>

customRidSoundtrack.xml
xml:

<window type="dialog" id="1305">
    <allowoverlay>no</allowoverlay>
    <onload>Stop</onload>
    <visible>[String.Contains(Player.Filenameandpath,theme.mp3) | String.Contains(Player.Filenameandpath,theme.flac)] + [!Window.IsActive(videos) | String.IsEmpty(ListItem.Path)]</visible>
    <controls>
    </controls>
</window>
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply

Logout Mark Read Team Forum Stats Members Help
TvTunes alternative for playing soundtracks when browsing2