XBMC-JSON an open source .NET XBMC JSON-RPC Library
#16
Can I make a suggestion?

How about making every object that can be added to a playlist (i.e. Song, Movie, MusicVideo etc.) inherit a common interface/implement a common abstract class? I think at the least that Label is a common field among them all (maybe even a common ID field). That would allow you to do the following :

Code:
CommonPlayListItem pi;

            switch (currentDisplayMode)
            {
               case DisplayMode.AudioPlaying:
                  pi = mainConn.AudioPlaylist.GetCurrentItem();
                  break;

               case DisplayMode.PicturesPlaying:
                  pi = mainConn.PicturePlayer.GetCurrentItem();
                  break;

               case DisplayMode.VideoPlaying:
                  pi = mainConn.VideoPlaylist.GetCurrentItem();
                  break;
            }

            WriteToLCD(pi.Label);

Also... How about adding property changed notifiers? Then your library can also be used in MVVM Silverlight or WPF applications.

PM me so I can contribute.

EDIT: Don't think Mono supports INotifyPropertyChanged, so if you're aim is compatibility, ignore.
Reply
#17
Also... How about adding a XbmcEventListener class, that opens a TCP port to the XBMC server's port 9090 to listen for notifications generated by XBMC?
Reply
#18
grimstoner Wrote:Also... How about adding a XbmcEventListener class, that opens a TCP port to the XBMC server's port 9090 to listen for notifications generated by XBMC?

If you don't need the .NET Micro Framework support you can check out my C# library which provides events derived from notifications: https://sourceforge.net/projects/xbmcjsonsharp/
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#19
grimstoner Wrote:Can I make a suggestion?

How about making every object that can be added to a playlist (i.e. Song, Movie, MusicVideo etc.) inherit a common interface/implement a common abstract class? I think at the least that Label is a common field among them all (maybe even a common ID field).

Cheers for the suggestion, just added abstract XbmcMediaItem class which all other media items inherit from, it contains Id and Label.

Have also started adding Event Listener class. I'm purely working on the async fork as this type of thing just isn't well suited to synchronous I/O. Will commit async fork soon, if you'd like to use the changes in the current sync project you'll have to copy them over sorry.
XBMC Remote7 an XBMC library browser/remote for Windows Phone 7.
Xbmc-Json a .NET XBMC JSON API Library.
Xbmc-Remote-Control a .NET based XBMC library browser and remote for Windows, Linux and OS X.
Reply
#20
Have just committed the async lib @ http://code.google.com/p/xbmc-json/ under trunk/xbmc-json-async

It also has code in there for virtual remote and the event listener (Have only added 3 events so far but adding more is super simple).

There's also a little test client included in the project that shows the basics of using everything asynchronously.
XBMC Remote7 an XBMC library browser/remote for Windows Phone 7.
Xbmc-Json a .NET XBMC JSON API Library.
Xbmc-Remote-Control a .NET based XBMC library browser and remote for Windows, Linux and OS X.
Reply
#21
Hello

Am i blind or stupid or maybe both? but i just cant manage to find a download link for the whole solution. I am not really in the mood to download each separate file and then create a own solution.

I got a question regarding the ASYNC project, is it possible to make the XDataReceived generic?

So we don't need to cast our data.
Reply
#22
Tinototem Wrote:Hello

Am i blind or stupid or maybe both? but i just cant manage to find a download link for the whole solution. I am not really in the mood to download each separate file and then create a own solution.

I got a question regarding the ASYNC project, is it possible to make the XDataReceived generic?

So we don't need to cast our data.

There is no solution file for the sync and async projects combined - They're two completely independent projects with different code bases.

There is however a solution file for the async project and the sync project individually under their respective directories so I'm not sure what you mean about downloading individual files and creating a solution?

I've actually struggled to wrap my head around how best to handle the usercallbacks to they don't have to cast the response object, add me on Google talk ([email protected]) so we can talk about it Smile
XBMC Remote7 an XBMC library browser/remote for Windows Phone 7.
Xbmc-Json a .NET XBMC JSON API Library.
Xbmc-Remote-Control a .NET based XBMC library browser and remote for Windows, Linux and OS X.
Reply
#23
I can't seem to get the async fx to connect to my XBMC instance...

When using the sample application, the EventListener connects fine, I get event notifications and everything. But the json requests all fail, throwing System.Net.WebExceptions ((404) Not found).

I've turned on all the settings in XBMC (allow control of xbmc via upnp etc.), and I'm sure the username/password combo is correct. Turned off Windows Firewall as well. Anything else I can check?

Which brings me to a suggestion... Is there a way to determine whether the XConnection is connected? Maybe a ping/pong message as soon as you connect?
Reply
#24
eh... port 8080 was in use by summing else...
Reply
#25
grimstoner Wrote:Which brings me to a suggestion... Is there a way to determine whether the XConnection is connected? Maybe a ping/pong message as soon as you connect?

Glad you got it sorted, I think I'll add an event to XConnection so you can monitor the connection status Smile
XBMC Remote7 an XBMC library browser/remote for Windows Phone 7.
Xbmc-Json a .NET XBMC JSON API Library.
Xbmc-Remote-Control a .NET based XBMC library browser and remote for Windows, Linux and OS X.
Reply
#26
dstruktiv Wrote:There is no solution file for the sync and async projects combined - They're two completely independent projects with different code bases.

There is however a solution file for the async project and the sync project individually under their respective directories so I'm not sure what you mean about downloading individual files and creating a solution?

I've actually struggled to wrap my head around how best to handle the usercallbacks to they don't have to cast the response object, add me on Google talk ([email protected]) so we can talk about it Smile
I am not talking about a solution for async and sync project together, i am trying to download the async project but i only manage to find a download link for each individual file.

Do i need some kind of third part program to link with google code?

Edit: Got it working now.
Reply
#27
Tinototem Wrote:I am not talking about a solution for async and sync project together, i am trying to download the async project but i only manage to find a download link for each individual file.

Do i need some kind of third part program to link with google code?

Edit: Got it working now.

It's an SVN repository, I suggest using Tortoise SVN if you're on Windows Smile
XBMC Remote7 an XBMC library browser/remote for Windows Phone 7.
Xbmc-Json a .NET XBMC JSON API Library.
Xbmc-Remote-Control a .NET based XBMC library browser and remote for Windows, Linux and OS X.
Reply
#28
Did a bit of work... have a look, lemme know.
Reply
#29
grimstoner Wrote:Did a bit of work... have a look, lemme know.

Looks awesome good stuff Smile

I'm not positive but it looks like you may have missed a few files on your last commit - XSystem, XVideoPlayer etc.
XBMC Remote7 an XBMC library browser/remote for Windows Phone 7.
Xbmc-Json a .NET XBMC JSON API Library.
Xbmc-Remote-Control a .NET based XBMC library browser and remote for Windows, Linux and OS X.
Reply
#30
Added them now. Used to TFS, not Subversion...
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC-JSON an open source .NET XBMC JSON-RPC Library1