Author Topic: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012  (Read 25981 times)

0 Members and 1 Guest are viewing this topic.

claymic

  • $upporter
  • Sr. Member
  • *****
  • Posts: 152
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #75 on: January 12, 2013, 02:17:49 PM »
Great job James,
I will play with this a little ;D
Very thanks
Clayton

claymic

  • $upporter
  • Sr. Member
  • *****
  • Posts: 152
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #76 on: January 12, 2013, 03:09:01 PM »
James
That its exactly what we need. Well done again, i play a little with the Events and get the result that i get with the script. Its nice and fun. We can now start to make our commands to get some nice tts return.
Thanks Again, but let me suggest another implement in your plugin.
Do you remember the VcGetInfo plugin ?
In your script we can insert this very easy like you make for ExecBuiltin, but we have to  this for the:
Code: [Select]
xbmc.getInfoLabel and xbmc.getCondVisibilityWhy ?
Lets say we are navigating over our movies and we want to get some information about it. Now we are only able to do this if we play the file or use the VcGetInfo plugin.
But you can make in your script something like this:
Code: [Select]
elif cmdtype == "getInfo":
          if xbmc.getCondVisibility( 'Container.Content(Movies)' ):  
             title=xbmc.getInfoLabel( "ListItem.Title" )
             sendToVox("event&&Movie&&%s"%title)
Same thing for music, tvshow, file, playlist, or whatever, the getCondVisibility will always let us to know what window its open in xbmc ;D
We get the title (we cant get the ID), so we can use a json with a filter to get the data of this movie in vox. I believe that Json will not be able to manage this alone, i dont know anyway to json get a information inside a container, i think its not possible, only using a script like i post above. I use the same function from the script that i sent early for send the event for Vox, but to test i need the vox send the "getinfo" for the script.
I am terrible to describe this things in english, let me know if you get the idea, if not i can make the script and send to you.
Let ´s put you to work a little more :biglaugh I am your friend :biglaugh
Clayton
« Last Edit: January 12, 2013, 03:15:42 PM by claymic »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #77 on: January 12, 2013, 04:36:00 PM »
in JSON we have access to most of this stuff.

Here is a sample command.  It is not complete but it shows some possibilities.

I guess the question is, how exactly do we want to use this, and what will be the most powerful but flexible combo for all users.  I don't know yet...  I have to think about it more.

the main problem with the script is that it requires us to use events, and it is not possible to edit the script for the normal user.  Anyway, we don't want all users to have different versions of the script or it will cause a lot of confusion.

Trying to do it all using the LCB and actions right now is possible, but maybe a bit painful to do.  So I will try to think of ways to make it easier.

How do you use this?  do you ask "what item am I currently on?" or do you want to detect any time you are on a new item and have it speak?

Is that possible to do? (detect when a new item is selected, or new window opens in XBMC)
I might not use this myself, but for a blind person maybe it could be very helpful...

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="453" name="getinfolabels test 1" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>XBMC.GetInfoBooleans&amp;&amp;"booleans": ["Container.Content(movies)"]</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;true</ifParams>
    <then>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <cmdString>XBMC.GetInfoLabels&amp;&amp;"labels": ["System.CurrentWindow","System.CurrentControl","Listitem.Label"]</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <cmdString>MOVIES: {LastResult}</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
</command>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #78 on: January 12, 2013, 04:52:49 PM »
I am terrible to describe this things in english, let me know if you get the idea, if not i can make the script and send to you.
Let ´s put you to work a little more :biglaugh I am your friend :biglaugh
Clayton

You explained it very well.  I understand completely.  I am very interested in these scripts.  It is cool that you can grab a handle to "MyPlayer()" and then listen for events by defining "def onPlayBackEnded(self):" for that class.  I love it. This is very good to know about!  I wonder if we could do the same thing with the GUI to listen for when the user has changed to a new window...

My main concern is that I want VC to be as independent as possible so that if someone has not installed the script, most things will still work.  For some things, like execbuiltin, we do not have a choice at all, so it must be in the script.  For other things, like the softmute command, we could probably do it with VC completely, but I think it makes more sense to put it in the script instead of doing many calls back and forth between VC and XBMC...  It is not always obvious which is the best way.

claymic

  • $upporter
  • Sr. Member
  • *****
  • Posts: 152
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #79 on: January 12, 2013, 05:16:45 PM »
Ok James, i am not blind too, but i have to say that get the plot of the movie without have to play it its my best command in Vox. I use the wall view, to read the plot i have to open the info page, the plot its very dificcult to read if i am using the tv, if am using the projector its fine. I use vox to read the plot to me. If i dont use getinfolabels, vox will only be able to read the plot if i play the file, its not a good process i think.
Maybe you cant see the advantage of this, but i use a lot. I just say Read to Me and its Done, Vox read the plot and the ratio. Another thing, if we get the movie path we can get the trailer too, so i use this to read the plot and i can play the trailer if i want. For me its very useful.
There is another reason to use this, the plot can be big and the space for the plot in the skin its always small, the priority its for the fanart or thumb. Put the skin to scroll the plot its annoying! Automatic or not.
I never see the GetInfoBooleans, its a very nice command and i will read a little more about it right now, the wiki page of the Json its some thing at least weird.
Very thanks for your help.

claymic

  • $upporter
  • Sr. Member
  • *****
  • Posts: 152
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #80 on: January 12, 2013, 05:23:39 PM »
Oh, the Json have now the getinfolabels, that is a very good thing to have. I missed that, i will have to make some changes in my app too and make some commands for vox. Now i am happy!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #81 on: January 12, 2013, 05:54:36 PM »
yes there is a lot of information to access here:

http://wiki.xbmc.org/index.php?title=InfoLabels

and

http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions

I agree, this information can be very useful to make our commands more intelligent and open up the possibilities.  What I meant, was that I would not want my computer to speak every time I selected a new item!  That would be too noisy... but if I were blind I might need it.

Anyway, it doesn't only matter how I would use it, I always try to think of all the ways any user might want to use it, and then try to find a balance that is not too much trouble.  but OK, how I would use it always takes priority ;)

claymic

  • $upporter
  • Sr. Member
  • *****
  • Posts: 152
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #82 on: January 12, 2013, 07:15:16 PM »
Oh, my bad James, i understand wrong :bonk
To make my day the only thing left its create a playlist for unwatched episodes. I dont understand why the guys from xbmc dont add this to Json like we can do with albums, songs, flies,etc, using the ID. We can play or insert a album with the id, but we cant make this for tvshow or seasons. The only way its use a loop to insert each episode by time., at least i think so.
But at least now we can use the filters and get the fisrt episode unwatched and play it. When the episode ended the xbmc will set the episode for watched, so we can use the event EpisodeEnded(i dont remember exactly the name) to run the  command again or just call the command again, will always play the first episode unwatched.
Thanks
« Last Edit: January 12, 2013, 07:20:19 PM by claymic »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #83 on: January 12, 2013, 08:28:11 PM »
My smart playlist command for unwatched episodes works well.  I like being able to view the list before playing.  I uploaded it recently.
http://voxcommando.com/forum/index.php?topic=940.msg8119#msg8119

Tomorrow I will look at a solution for using filters.  Probably, this would be something we could put in the script.

I also intend to add actions to the xsql plugin at some point, that will allow us to make custom queries.  From there we would still need to find a nice way to create a playlist.  For the people who are using MySQL, I guess it will be a problem...
« Last Edit: January 12, 2013, 10:20:12 PM by jitterjames »

eQUIV

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #84 on: January 15, 2013, 01:48:45 AM »
Hi, I'm new to VoxCommando.. just wanted to say I wish I had heard of it earlier. This is great program. Thanks for all your hard work on it.

Now my question, I am running XBMC Frodo RC3.. and I have installed some of the updated entries you posted in this thread. However some commands don't work.. I think specifically the JSON commands.

I'm unable to login to the XBMC HTTP webserver... it seems to reject my login. Are you aware of any known problems with the RC3 release in this respect?

Do I need the latest nightly for these new JSON commands to work?

Any help would be greatly appreciated.

claymic

  • $upporter
  • Sr. Member
  • *****
  • Posts: 152
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #85 on: January 15, 2013, 07:43:06 AM »
Do you enabled the plugins ?
I made a little video showing how to do
http://youtu.be/wzlWOspxyKc
Clayton

eQUIV

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #86 on: January 15, 2013, 08:07:36 AM »
Clay... Thanks or the video, however I already had those enabled.. Settings input, imported my XBMC library to XML. Although I don't have TCPMic enabled (at least I don't think I do), I'm not at home at the moment so I can't confirm. Is that plugin important/related?

I seem to get authentification errors for the JSON required commands. I am also unable to login to the HTTP web interface for XBMC. I've triple checked my port, username/pass settings. Curious if anyone else running RC3 has had this problem. Unable to login. I'm running Windows 8 x64. Port is open on router, Windows Firewall is off.. Running XBMC and VoxCommando as admin.. Can't seem to figure out the problem.

I'm stumped, any ideas?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #87 on: January 15, 2013, 08:18:24 AM »
Clay... Thanks or the video, however I already had those enabled.. Settings input, imported my XBMC library to XML. Although I don't have TCPMic enabled (at least I don't think I do), I'm not at home at the moment so I can't confirm. Is that plugin important/related?

I seem to get authentification errors for the JSON required commands. I am also unable to login to the HTTP web interface for XBMC. I've triple checked my port, username/pass settings. Curious if anyone else running RC3 has had this problem. Unable to login. I'm running Windows 8 x64. Port is open on router, Windows Firewall is off.. Running XBMC and VoxCommando as admin.. Can't seem to figure out the problem.

I'm stumped, any ideas?
Hi, I'm new to VoxCommando.. just wanted to say I wish I had heard of it earlier. This is great program. Thanks for all your hard work on it.

Now my question, I am running XBMC Frodo RC3.. and I have installed some of the updated entries you posted in this thread. However some commands don't work.. I think specifically the JSON commands.

I'm unable to login to the XBMC HTTP webserver... it seems to reject my login. Are you aware of any known problems with the RC3 release in this respect?

Do I need the latest nightly for these new JSON commands to work?

Any help would be greatly appreciated.

Hi eQUIV and welcome to the forum and to VoxCommando.

RC3 is fine. Just the regular version from here: http://xbmc.org/download/

You need the latest version of VoxCommando which is currently here: http://voxcommando.com/forum/index.php?topic=969.0

and then update the XJson plugin for VC with the latest version from this thread.

You don't need the TcpMic plugin unless you are using VoxWav for Android as a microphone.

Send us pictures of your XBMC settings pages and your XJson plugin settings.  If you want to be more thourough enable logging in VC and in XBMC and send us the logs after you try to send a command.

Warning: This topic is for experienced users who are experimenting with new and incomplete features so it will probably be a bit hard to a new user to follow everything.  Some of the commands that I post here will be incomplete because the intended audience is people who already know what they are doing.

I hope to release a more complete version of VC with all the latest plugins and settings for Frodo soon.
« Last Edit: January 15, 2013, 08:35:16 AM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #88 on: January 15, 2013, 08:22:05 AM »
I seem to get authentification errors for the JSON required commands. I am also unable to login to the HTTP web interface for XBMC. I've triple checked my port, username/pass settings. Curious if anyone else running RC3 has had this problem. Unable to login. I'm running Windows 8 x64. Port is open on router, Windows Firewall is off.. Running XBMC and VoxCommando as admin.. Can't seem to figure out the problem.

Are you talking about actually logging into XBMC using a web browser?  If so, what url are you using?  Which port are you using?  (send those images  :D)

You should not need to open an ports on your router unless you are accessing your computer from outside your lan.

eQUIV

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: XBMC JSON: for pre-Frodo nightlies after Oct. 9th 2012
« Reply #89 on: January 16, 2013, 12:49:17 AM »
James.. Thanks for your help. Upgrading to the latest version of VoxCommando seems to have fixed my authentication issues. Everything seems to be working now. Can't wait to play around and get some other features working.

Is it possible to setup commands to launch specific XBMC add-ons and smart playlists?