Page 4 of 5

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Thu Jan 02, 2014 10:41 am
by krish
That thread has since been updated by another user who has it working:
The OP has not updated it in over a year but it still works for me. I'm using the free version of VS 2013 for Windows Desktop.

This is what I did to get it to work:
1. Open the JsonRpcGen.sln file
2. Remove the XbmcRt2 and XBMCRPC.RT projects form the solution, they are for windows phone and won't work with this version of VS
3. Install JSON.NET from NuGet
4. Build Solution (F7). You will see many warnings but I got no errors.
5. In Program.cs of the JsonRpcGen project set the args on line 22 to what you need. This works for me:

Code: Select all

args=new string[]{"http://192.168.1.15:8080/jsonrpc","","", "XBMCRPC"};
6. Set JsonRpcGen as startup project and run it (F5). It will create a complete set of classes in your bin\Debug\XBMCRPC directory which are now referenced by the JsonTester project
7. Edit XBMCRPC\List\Item\All.cs replacing

Code: Select all

    public class All : XBMCRPC.List.Item.Base
with

Code: Select all

    public class All : XBMCRPC.List.Item.BaseFile
8. Edit XBMCRPC\AllConverter.cs replacing

Code: Select all

if (jObject[_multipleInheritanceKey] == null)
            {
                value = jObject.ToObject<XBMCRPC.List.Item.AllFile>();
            }
            else
            {
                value = jObject.ToObject<XBMCRPC.List.Item.AllMedia>();
            }
with

Code: Select all

            if (jObject[_multipleInheritanceKey] == null)
            {
                value = jObject.ToObject<XBMCRPC.List.Item.All>();
            }
            else
            {
                value = jObject.ToObject<XBMCRPC.List.Item.All>();
            }
9. In JsonTester\MainWindow.xaml.cs make a few changes:
In Line 41 enter your correct info for connecting to Xbmc.
Comment out lines 52-60
In Line 75 replace "as All" with "as XBMCRPC.List.Item.All"
10. Go to Xbmc and start a movie or Tv Show playing
11.Set JsonTester as startup project and run it (F5).
12. Press the Test button. After a moment you should see the poster of the playing movie appear in the window

I'm not saying that all these changes are perfectly correct (you still get lots of compiler warnings) but the project works for me. I've not tried everything but what I have tried seems to work fine.Big Grin

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Thu Jan 02, 2014 11:44 am
by bwoodworth
Great news! I'll try out these fixes

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Tue Mar 18, 2014 12:33 pm
by BudC
Hello,
I have a couple of basic questions. I pulled the most recent code from Git hub and modified the xbmc plugin to expose the "SUSPEND" method, as I want my xbmc computer to suspend/wake up based on my receiver being on or off-line. That's working great. Also I think there should to be another EVENT like Offline or something. If the player is "STOPPED" but then goes offline, it still shows as "STOPPED". I suppose there are ways around that, I could always just send a wakeup command first. So, to my questions.

When I recompile the code I start getting logging errors, which from what I have read there are changes going on with the logging, but I am really not sure what I am supposed to do. If I comment out the logging it works fine. The errors are on the logging declaration lines and is 'OSAE.General.OSAELog' does not contain a constructor that takes 1 arguments.

My second question is, I am not really hip to the whole github thing, I haven't had much experience with any opensource projects. So far I have just been a greedy corporate programmer. But I use XMBC heavily and I can see a lot of uses for this. I am more than happy to contribute. Not sure how this works though, do I just add whatever I want and push it back, and then someone approves it? Just not sure how the lifecycle of this stuff works.

Thanks

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Tue Mar 18, 2014 3:17 pm
by Automate
Yea, the logging changes affect everything. So if you want to use the latest source with the new logging you really need to replace everything from compiled source including the API DLL, the OSA server and other exe, the web server etc.

During the transition the old logging methods still work so an option would be to change all the log statements in the XBMC plugin to the old method.

You have to be careful about which version of the OSA API DLL you are referencing in your project. The error you are getting looks like the project is using an old API DLL which needed two parameters including a Boolean to control forced logging.

For Git you need to:
Create a Github account
Fork the main OSA repository to your Github repository
Make your changes to the code
Commit and push your changes to your Github repository
Do a pull request of your repository
Brian can then look at your pull request changes and merge then in if everything looks OK.

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Tue Mar 18, 2014 4:53 pm
by BudC
OK I am squared away on the Github portion of things, thanks for the info.

As for the DLL I'll run through what I am doing and you can let me know what I am doing run. I am building everything on a machine that is not running the compiled code. I pulled a fresh copy of the code which compiles the OSA.api.dll to the output dir. The xbmc solution pulls the dll from there. I build the main solution which creates a new OSA.api.dll. Then I load the xmbc plugin solution (with no changes made by me) and build and I get the error. I checked the constructor and it would appear that it is looking for no arguments, like this "private OSAE.General.OSAELog Log = new General.OSAELog(); ", the actual code is "private OSAE.General.OSAELog Log = new General.OSAELog("XBMC"); ". Any thoughts on where I am going wrong?

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Tue Mar 18, 2014 7:44 pm
by Automate
Your right. I missed that the error was with the constructor. I think Brian changed how it gets initialized and had not updated this plugin. So change it to "private OSAE.General.OSAELog Log = new General.OSAELog();"

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Wed Mar 19, 2014 3:00 pm
by BudC
That worked, I had actually tried what you suggested in the very beginning but didn't check the event viewer as to why things weren't loading. I was missing a dll "NetworkCommsDotNetComplete.dll" , so I copied that, and everything else over, and it's running now. However, the xbmc pluggin logging has fallen off the planet. Is there something I should do configure the new logging? It doesn't seem to be going anywhere, even in debug mode, I've even checked the db. Thanks for all of your help.

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Wed Mar 19, 2014 4:46 pm
by Automate
Did you create an "osae_log" table? You should find the SQL to create it in the in Installer repository. Did you also copy the log4net.dll?

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Sat Aug 16, 2014 11:43 pm
by Andre
Hi,

Does anyone know if this plugin works on XBMC V13 (Gotham).

I am getting the following in the XBMC log, at service restart, but no events seem to come through.

08/17/2014 09:18:17.101 AM - Running interface
08/17/2014 09:18:18.560 AM - Creating new XBMC System connection: BananaLoaf - 192.168.99.40


If I try and PlayPause or stop the movie that is playing , I get this in the log, but the movie carries on playing.

08/17/2014 09:39:10.606 AM - Found Command: VPLAYPAUSE | param1: | param2:
08/17/2014 09:39:23.308 AM - Found Command: VSTOP | param1: | param2:


I have the remote control settings all on, I am controlling from my Android devices perfectly via the official XBMC remote.

Andre

Re: [Official Thread] XBMC Plugin Support Thread

Posted: Mon Aug 18, 2014 7:33 am
by Vaughn
XBMC hard locked my ASUS laptops. I will give it a try on my new desktop and if it runs, I maybe jump in and help look at this plugin.

Vaughn