2013-05-01, 23:31
Well, use GUI.ActivateWindow with "visualization" works for music. But if you guys know any way to do this for video and music with one single command, let me know please.
Clayton
Clayton
Quote:self.showOsdPlayer = function(){
//self.rpc("Input.ShowOSD", {}, self.logReplyData);
self.rpc("Player.GetActivePlayers", {}, function(data) {
if(data.result.length !== null && data.result.length !== 0){
self.currentPlayer = data.result[0].type;
if(self.currentPlayer == "audio"){
self.openWindow("visualisation");
} else if(self.currentPlayer == "video"){
//fullscreenvideo
self.openWindow("fullscreenvideo");
}
}
})
}
curl -H "Content-Type: application/json" -d "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"Files.GetDirectory\",\"params\":{\"directory\":\"/home/xbmc/Media/Music/\",\"media\":\"files\",\"properties\":[]}}" http://127.0.0.1:8080/jsonrpc
curl -H "Content-Type: application/json" -d "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"Files.GetDirectory\",\"params\":{\"directory\":\"/home/xbmc/Media/Music/\",\"media\":\"music\",\"properties\":[]}}" http://127.0.0.1:8080/jsonrpc
curl -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"Application.GetProperties\", \"params\" : { \"properties\" : [ \"volume\", \"muted\" ] }, \"id\" : 1 }" http://xbmc:80/jsonrpc | python -mjson.tool
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"muted": false,
"volume": 15.000000953674316
}
}
(2013-05-03, 17:43)Millencolin007 Wrote: I have seen that xbmc sometimes does return the volume as float instead of an int when calling Application.GetProperties. In the json introspect file it is defined as int. Has something been changed recently?
Code:curl -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"Application.GetProperties\", \"params\" : { \"properties\" : [ \"volume\", \"muted\" ] }, \"id\" : 1 }" http://xbmc:80/jsonrpc | python -mjson.tool
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"muted": false,
"volume": 15.000000953674316
}
}
Edit:
Tried on: XBMC for Raspbmc 13.0-ALPHA3 Git:20130429-a7a45c4
{"jsonrpc":"2.0","method":"VideoLibrary.GetTvShows","id":"1","params":{"properties":["genre","episode","playcount"],"sort":{"ignorearticle":true,"method":"sorttitle","order":"ascending"},"limits":{"start":0,"end":2}}}
{"id":"1","jsonrpc":"2.0","result":{"limits":{"end":2,"start":0,"total":705},"tvshows":[{"episode":15,"genre":["Comedy"],"label":"2 Broke Girls","playcount":0,"tvshowid":513}]}}
{"jsonrpc":"2.0","method":"VideoLibrary.GetTvShows","id":"1","params":{"properties":["genre","episode","playcount"],"sort":{"ignorearticle":true,"method":"sorttitle","order":"ascending"},"limits":{"start":3,"end":5}}}
{"id":"1","jsonrpc":"2.0","result":{"limits":{"end":5,"start":3,"total":705},"tvshows":[{"episode":4,"genre":["Comedy"],"label":"2 Broke Girls","playcount":0,"tvshowid":888}]}}