XBMC Remote Control (Windows, Linux and OS X)
#16
atarijedi Wrote:Hello there dstruktiv, I am just learning .NET, I am working with VB.NET and I would like to use your API to build a remote control.

I went to the googlecode page for it, but I couldn't find anything to download, for either the library itself, or any documentation.

Any help would be appreciated, thanks!

I'm a bit late but started work on this again tonight... Smile

To use this in VB.NET you will want to do an SVN checkout of xbmc-json - I recommend installed Tortoise SVN, creating a new windows folder, then right clicking on it and choosing svn checkout. Point it to: http://xbmc-json.googlecode.com/svn/trunk/

Then you need to open up the XbmcJson project file in Visual Studio (You will get an error about WinMobile SDK not being installed but you can ignore it) - All you should need to do is click compile.

Then in the newfolder\bin\Release (Or debug) directory you want to grab XbmcJson.dll and Newtonsoft.Json.Compact.dll. Copy these two files to your remotes project directory and in your remote project add a reference to XbmcJson.dll (You do not need to add a reference to Newtonsoft.Json.Compact.dll but it does need to be in the same directory as XbmcJson.dll).

And lastly you need to add a using statement at the top of each source file that's using XbmcJson - I think in VB.NET it's called "Imports" so as an example:

Code:
Imports System;
Imports XbmcJson;

I can't really help any more than that as VB.NET hurts my head (Try C# it's actually easier...).

If you need to figure out how to make use of the methods within XbmcJson then look at: http://code.google.com/p/xbmc-remote-con...ainView.cs

You just instantiate a new instance of XbmcConnection - Pass it an IP, a port, a username and a password i.e:

Code:
XbmcConnection Xbmc = new XbmcConnection(Ip, Convert.ToInt32(Port), User, Password);

Then you can start making use of all it's methods i.e:

Code:
if (Xbmc.Status.IsConnected)
{
      Song NowPlaying = Xbmc.AudioPlaylist.GetCurrentItemAllFields();

      Console.WriteLine(NowPlaying.Title);
      Console.WriteLine(NowPlaying.Artist);
      Console.WriteLine(NowPlaying.Album);
      Console.WriteLine(Xbmc.AudioPlayer.GetTimeFormatted());
}

EDIT - Made a working VB.NET Example - This language is so fucking painful lol - This will work if you're running a Dharma beta (And have http server turned on and have a song playing).

Code:
Imports XbmcJson

Module XbmcRemoteExample

    Sub Main()
        Dim Xbmc As XbmcConnection = New XbmcConnection("192.168.1.106", 8080, "XBMC", "password")

        If (Xbmc.Status.IsConnected) Then

            If (Xbmc.Player.IsAudioPlayerActive()) Then
                Dim NowPlaying As Song = Xbmc.AudioPlaylist.GetCurrentItemAllFields()
                Console.WriteLine(NowPlaying.Title)
                Console.WriteLine(NowPlaying.Artist)
                Console.WriteLine(NowPlaying.Album)
                Console.WriteLine(Xbmc.AudioPlayer.GetTimeFormatted())
            Else
                Console.WriteLine("No song playing.")
            End If

        Else
            Console.WriteLine("Cannot connect to XBMC.")
        End If

        Console.ReadLine()

    End Sub

End Module

Image

Sorry the examples are in C#. There's no documentation but just check out my remote code and Visual Studio's Intellisense and you should find all the methods you're after.
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

Logout Mark Read Team Forum Stats Members Help
XBMC Remote Control (Windows, Linux and OS X)0