2010-04-28, 06:45
Kabooga Wrote:In response to topfs2 question.
The recursive ability to add ALL music (or video) files contained in a selected directory (and subdirectories) was very useful.
Regards,
Kabooga
Bram77 Wrote:Maybe Playlist.Add(directory=Y, media=audio/video) could do the trick.Sounds like a good plan.
If I remember correctly this is how it's done in the http api.
Playlist.Add(directory=X, content=Y, recursive=true)
Bram77 Wrote:A method like this would be very helpful and reduce overhead. Just as methods to retrieve the state of some elements in XBMC would be, like...You mean Files.GetShares ?
I've created a Status namespace in the JS lib for these kind of methods. At this point it contains the available now playing data, playingTime/percentage and the current volume
isShuffleEnabled
isRepeatEnabled
getRepeatMode
isPartyModeEnabled
isWinding (not shure how to name this in english, return if fastforward or rewind is currently active)
isMuted
isPaused
isAudioPlaying (not really necessary, but useful)
isVideoPlaying (not really necessary, but useful)
isMediaPlaying (shorthand for "isAudioPlaying || isVideoPlaying" )
isPictureShowing (not really necessary, but useful)
...or whatever naming convention you prefer
I haven't been able to retrieve the shares available. Could you point me in the right direction?
Bram77 Wrote:The audio playlist items only contain labels, file paths and thumbnail paths. Would it be possible to add artist, album, year, time etc... if available?Yeah thats abit of a bug now, you should be able to get them API-wise through the same mechanism as with with the library. fields: ["artist", "album", "year"]
Or do you have an alternate method in mind?
Bram77 Wrote:edit: To give you an idea about how I think the status data could be updated more efficiently you could take a look at the Status namespace I'm creating for the JS lib. It will probably be devided into / extended with Status.NowPlaying, Status.Controls i.e.. The 'update()' method is executed every second (as often as possible), which results in 5 request to the JSON RPC api at this point.
When HTML5 is the standard, I could create a separate thread for the browser to use as a working thread so these requests won't influence the browsers performance. But at this point the requests do slow down the browser significantly. When and if more methods are implemented to retrieve the current element statuses the amount of requests will increase... Creating a method to get all the data in one request would really help with building a solid and reliable client.
Keep in mind that JS has very limit OOP possibilities and this is just a mockup. I had to make some methods publicly available to do the things I wanted to do.
http://code.google.com/p/xbmcweb/source/.../status.js
something like Player.GetInfo with the appropriate fields perhaps?
noem Wrote:What about interface integration commands ie: the httpapi SendKey function is that also going to be added ?Yeah I will add that at some point, however not at this stage EventServer is better to use for now.
Keep up the grate job you are doing there Im currently developing app based on your framework. and sorry for all the bugging
Kind regards
noem
The reason for this is that core is abit messy regarding input so to create a good clean API I think core needs to be cleaned up.