gereral1
Well-Known Member
Thread Starter
- Joined
- Mar 3, 2013
- Messages
- 968
- Likes
- 265
finished the automatic script writer to smartly write the paths to the players inside the xml script. The paths will be changed in the final to point to xdrconfig.exe hdrcal part of the program.
screenshot:
playercorefactory.xml created on the desktop automatically. This program will find your user account name and write the path inside the xml.
I was thinking of a save as function then storing the path in regristry and if you changed anything in xdrconfig it would automatically update the data inside this script file by adding and removing items. I'm not sure if all builds of kodi use this directory so right now I'm opted to save to desktop.
'gets the install path of xdr to set path to mpchcfn.exe mpcbefn.exe and the script
CurrentUser.CreateSubKey("Software\\XDR\\").SetValue("pathtoxdr", xdrdataDirectory)
CurrentUser.Close()
Dim mpchckeyname As String = "HKEY_CURRENT_USER\Software\XDR"
Dim mpchcvaluename As String = "pathtompchc"
Dim mpchcvaluename1 As String = "pathtompcbe"
Dim mpchcvalue As String = ""
Dim mpchcvalue1 As String = ""
Dim mpchcreturnvalue As Object
Dim st = Chr(34)
'get the value for mpchc to test if player path is set or not
mpchcreturnvalue = GetValue(mpchckeyname, mpchcvaluename, mpchcvalue)
'ask for path to kodi users directory
'message sucess of player path stored
'used to get input from user to set paths to players for mpchcfn.exe and mpcbefn.exe as well as the playercorefactory.xml
Dim appData1 As String = GetFolderPath(SpecialFolder.ApplicationData)
MessageBox.Show("XDR Config has gathered enough information and has written a playercorefactory.xml file to your desktop! If you have Kodi installed place this file in your " & appData1 & "\kodi\userdata folder! If you have an existing playercorefactory.xml file rename it playercorefactory.bak and replace with this file. Then load Kodi and right click on any UHD 4K video file and select play with external players option and choose your player. If you have never used external players then you most likely will not have an existing playercorefactory.xml file. If you have a short memory the path to your Kodi directory is stored in your playercorefactory.xml file", "XDR Config")
' Write Xml to desktop
Dim mydocpath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Using sr As New StreamWriter(mydocpath & Convert.ToString("\playercorefactory.xml"))
'write file xdr.cal to desktop
sr.WriteLine("<!-- This script was written by XDR Config the Kodi HDR Project -->")
sr.WriteLine("<!-- Please place this file in " & appData1 & "\kodi\userdata folder! -->")
sr.WriteLine("<playercorefactory>")
sr.WriteLine("<players>")
If mpchcreturnvalue = "" Then GoTo skipmpchc :
'writepath from registry mpchc path substitute current directory later after testing
sr.WriteLine("<player name=" & st & "Launch XDR MPC-HC 64 Bit" & st & " type=" & st & "ExternalPlayer" & st & " audio=" & st & "false" & st & " video=" & st & "true" & st & ">")
sr.WriteLine("<filename>" & mpchcreturnvalue & "</filename>")
sr.WriteLine("<args>" & st & "{1}" & st & " /fullscreen /close</args>")
sr.WriteLine("<hidexbmc>false</hidexbmc>")
sr.WriteLine("<hideconsole>false</hideconsole>")
sr.WriteLine("<warpcursor>none</warpcursor>")
sr.WriteLine("</player>")
skipmpchc:
mpchcreturnvalue = GetValue(mpchckeyname, mpchcvaluename1, mpchcvalue1)
If mpchcreturnvalue = "" Then GoTo skipmpcbe :
sr.WriteLine("<player name=" & st & "Launch XDR MPC-BE 64 Bit" & st & " type=" & st & "ExternalPlayer" & st & " audio=" & st & "false" & st & " video=" & st & "true" & st & ">")
sr.WriteLine("<filename>" & mpchcreturnvalue & "</filename>")
sr.WriteLine("<args>" & st & "{1}" & st & " /fullscreen /close</args>")
sr.WriteLine("<hidexbmc>false</hidexbmc>")
sr.WriteLine("<hideconsole>false</hideconsole>")
sr.WriteLine("<warpcursor>none</warpcursor>")
sr.WriteLine("</player>")
skipmpcbe:
sr.WriteLine("</players>")
sr.WriteLine("</playercorefactory>")
End Using
screenshot:
playercorefactory.xml created on the desktop automatically. This program will find your user account name and write the path inside the xml.
I was thinking of a save as function then storing the path in regristry and if you changed anything in xdrconfig it would automatically update the data inside this script file by adding and removing items. I'm not sure if all builds of kodi use this directory so right now I'm opted to save to desktop.