Kodi Community Forum
WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps (/showthread.php?tid=8760)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38


- NeoMorph - 2007-10-07

spiff Wrote:use the builtin command playercontrol

Err... No reference to record in the playercontrol specs...

Quote:XBMC.PlayerControl(command)
Allows control of music and videos. The command may be one of Play, Stop, Forward, Rewind, Next, Previous, BigSkipForward, BigSkipBackward, SmallSkipForward, SmallSkipBackward, Random, Repeat, RepeatOne, RepeatAll, RepeatOff, Partymode(music) or Partymode(video). Play will either pause, resume, or stop ffwding or rewinding. Random toggles random playback, Repeat cycles through the repeat modes, Partymode(music/video) toggles the appropriate partymode, defaults to music if no parameter is given.

That's where I looked in the first place Spiff as I have got all the other commands linked to my Girder program now. Is there a new ability that hasn't been written up on the wiki?


- spiff - 2007-10-07

from the musicosd.xml (skin file)

<onclick>XBMC.PlayerControl(Record)</onclick>
<visible>Player.CanRecord</visible>
</control>

so definitely just a missed in wiki thing.


- NeoMorph - 2007-10-09

spiff Wrote:from the musicosd.xml (skin file)

<onclick>XBMC.PlayerControl(Record)</onclick>
<visible>Player.CanRecord</visible>
</control>

so definitely just a missed in wiki thing.

Cheers spiff - on the ball as usual... It's recording fine now... One question... is there a way via HTTPAPI to confirm that it's actually recording? I would have assumed that PlayStatus would have changed to "RecordingStream" or something like it.

Onto an old question I submitted about cover art, I managed to use the "Filename:" to figure out where on the net the songs are coming from... I then trimmed off "smb:" and chopped the songname off and replaced it with "folder.jpg" and I have instant cover art. OK it's not the cover art that is in the XBMC database but as I use the folder.jpg method anyway it works for me. I've also added better definition cover art using CoverHD.png and CoverBackHD.png for use with TFT and Plasma screens. Works nice so far.Wink

I just want to say that XBMC is kicking butt now I have sorted out the interface. I still have a ways to go yet but the things I really wanted are working on my testbed (having radio station plus artist and songname displayed on touchscreen panels plus one button record ability). Would you believe even JRMC cant do that. No


- Nuka1195 - 2007-10-17

nad, i need to pass commas as part of the sql string for QueryVideoDatabase()

How would I do this with python?

Quote:
sql = """
SELECT path.strPath, files.strFilename, movie.c00
FROM path, files, movie
WHERE files.idPath=path.idPath
AND files.idFile=movie.idFile
%s
LIMIT 2;
""" % actual_path



- Nuka1195 - 2007-10-17

It appears python's executehttpapi() calls do not get urldecoded, this seems important at least for the query database commands.

If this patch is ok, i'll commit it

Code:
Index: xbmc/lib/libGoAhead/XBMChttp.cpp
===================================================================
--- xbmc/lib/libGoAhead/XBMChttp.cpp (revision 10550)
+++ xbmc/lib/libGoAhead/XBMChttp.cpp (working copy)
@@ -2654,6 +2654,9 @@
     CLog::Log(LOGDEBUG, "HttpApi Start command: %s  paras: [not recorded]", command.c_str());
   command=command.ToLower();
   if (numParas>=0)
+  {
+    for (int i = 0; i < numParas; i++)
+      CUtil::UrlDecode(paras[i]);
     if (command == "clearplaylist")                   retVal = xbmcClearPlayList(numParas, paras);  
       else if (command == "addtoplaylist")            retVal = xbmcAddToPlayList(numParas, paras);  
       else if (command == "playfile")                 retVal = xbmcPlayerPlayFile(numParas, paras);
@@ -2743,6 +2746,7 @@

       else
         retVal = SetResponse(openTag+"Error:Unknown command");
+  }
   else if (numParas==-2)
    retVal = SetResponse(openTag+"Error:Too many parameters");
   else

Amended thae patch to UrlDecode all params.


XBMC.PlayerControl(record) and HTTPapi - NeoMorph - 2007-10-19

I'm probably asking for something that isn't a simple change but is it possible to ask for XBMC.PlayerControl(recordstart) and XBMC.PlayerControl(recordstop) to be added so that I can have seperate buttons for starting and stopping recording. Either that or have httpapi respond back whether it has started or stopped recording (actually that would be ideal).

When I send the record command over httpapi I can't tell if it's started recording or not you see. I've had several instances where I thought I'd started recording but actually started and stopped recording you see. Eek


- NeoMorph - 2007-10-19

Oh yeah and does anyone know why the broadcast info got removed? I really would have loved to be able to use it to trigger songname retrieval in HTTPapi.


- nad - 2007-10-19

Nuka: just checking your suggested change.

NeoMorph: has broadcast been removed? Assuming it hasn't would a broadcast message indicating start and stop recording be what you are after?

Nad


- NeoMorph - 2007-10-20

nad Wrote:NeoMorph: has broadcast been removed? Assuming it hasn't would a broadcast message indicating start and stop recording be what you are after?

Nad

Yeah... and whenever the music changes tracks so my panel knows to grab the new song info. I was told that it doesn't function now... see here....

http://forum.xbmc.org/showthread.php?tid=28789

I tried all sorts to try and read the info but nothing was coming over with the listener program... it just sat there and twiddles its virtual thumbs. To get around it I have to keep querying the xbox every 5 seconds to keep the songname info current(ish). If I could get the broadcast info I could do away without having to spam the xbox.


- nad - 2007-10-20

NeoMorph: Just checked and broadcast is still working for me. Perhaps you have changed the default broadcast port setting?

Nuka: patch looks good to me.


- nad - 2007-10-20

NeoMorph: Just committed what I believe you are after - broadcast of record status when XBMC.PlayerControl(recordstart) is used. I have also added the HttpApi command GetRecordStatus.

Obviously you will need to get your setup working with broadcast before you see the changes. Make sure http://xbox/xbmcCmds/xbmcHttp?command=GetBroadcast returns the port number that you are using in the Listener program.


- NeoMorph - 2007-10-22

nad Wrote:NeoMorph: Just committed what I believe you are after - broadcast of record status when XBMC.PlayerControl(recordstart) is used. I have also added the HttpApi command GetRecordStatus.

Obviously you will need to get your setup working with broadcast before you see the changes. Make sure http://xbox/xbmcCmds/xbmcHttp?command=GetBroadcast returns the port number that you are using in the Listener program.

Nad still haven't got broadcast working... GetBroadcast is responding correctly though. Does the XBMC Listener program on SourceForge work for you?

Thanks for the GetRecordStatus... That's going to come in handy. When I checked the changelogs of the new build I was ecstatic when I saw you added that.


- NeoMorph - 2007-10-22

NeoMorph Wrote:Nad still haven't got broadcast working... GetBroadcast is responding correctly though. Does the XBMC Listener program on SourceForge work for you?

Thanks for the GetRecordStatus... That's going to come in handy. When I checked the changelogs of the new build I was ecstatic when I saw you added that.

Oops... Just noticed on the previous page that broadcast works for you... is that with the Listener program?

I'm going to get a crossover cable and try that in a minute... see if that works. Note that I'm going through a Router btw... It may be that that is the problem. I've tried all the software fixes I could think of.


- nad - 2007-10-22

NeoMorph: The listener program is one of mine, and yes it does work for me. Does GetBroadcast also return 1 as the broadcast level?


- NeoMorph - 2007-10-23

I can set it to 0 1 or 2 and change the broadcast port fine so the httpapi settings is working. Listener just doesn't seem to want to listen.

I tried a crossover cable and connected my laptop directly to the xbox today and on the laptop pinged the xbox to confirm they were connected ok.

Did a GetBroadcast and got back that it was set to port 8278 and was set to level 2. Started listener and then started playing songs and changing tracks... but absolutely nothing came up in Listener.

NetStat -a doesn't bring up that anything is listening on port 8278 btw - I would have thought that it would have if Listener was working correctly.