psp flash skin
#1
im starting work on a psp flash skin (2.71 firmware) (based on project mayhem iii)
not sure where to post this, but i am wondering how i can get a library view of the music albums as an xml file that i can them parse into flash. i figure its possible with an asp file, but havent yet seen any functions to interrogate the music library database.

format (non exact indicative only)

<artist name="artist name" path="path here">
<album path="path">this is an album</album>
<album path="path">this is an album</album>
<album path="path">this is an album</album>
</artist>

<artist name="artist name" path="path here">
<album path="path">this is an album</album>
<album path="path">this is an album</album>
<album path="path">this is an album</album>
</artist>

etc etc ....

any help appreciated! cheers
mark
Reply
#2
hi mark,

i've done a lot with the http api. most of it in javascript, but i also played with it in flash. i'm intrested to know more about the network capabilities of the psp flash player.


here is some code that may be useful for you.

Quote:function getfilelisting(filepath){
xbmcfilesystem = new loadvars();
xbmcfilesystem.onload=function(){
trace("xbmcfilesystem got: "+ unescape(this.tostring()));

//clean up bogus <html> code - not sute why does the api outputs these and in the latest builds these may have been fixed.
cleanup = unescape(this.tostring());
cleanup=cleanup.slice(8);
cleanup2 = cleanup.split("</html>");
cleanup2 =cleanup2.join();

//trace("clean code:"+cleanup2[0]);

myfilesys = cleanup2.split("<li>");

for(k=0;k<myfilesys.length;k++){
if(myfilesys[k] != ""){




thislisting = myfilesys[k].split(" ;");

trace("fullpath:"+thislisting[0]);
displayname = thislisting[0].split(filepath);

if (displayname[1] != "&onload=[type function]"){
trace("adding to data list:"+displayname[1]);

//this is some custom code that inserts each file/folder into a list on my interface, modify this to your needs
_root.filesystem.trackcell.duplicatemovieclip("trackcell"+k, 1000+k);
_root.filesystem["trackcell"+k]._x = 0;
_root.filesystem["trackcell"+k]._y = 0 + (k*100);
_root.filesystem["trackcell"+k].fullpath = thislisting[0];
_root.filesystem["trackcell"+k].trackname.text = displayname[1];
_root.filesystem["trackcell"+k].trackid.text = k;
}
}
}

};
xbmcfilesystem.parameter=filepath;
xbmcfilesystem.command="getdirectory";
xbmcfilesystem.sendandload("http://"+_global.xboxip+":"+_global.xboxport+"/xbmccmds/xbmchttp", xbmcfilesystem, "get");
trace("sending rpc call:"+xbmcfilesystem.tostring());
}

btw,
if you want to see the entire fla that i was using with this, send an email to liquidice629 at gmail.com and i will send over the flash source which might help you out.



Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#3
also, i forgot to mention... when you do a getfilelisting command if you use musicdb:// as the location you will be able to see the scanned music library (artists, albums, etc...)

i did run into some issues with special characters in the filenames, so watch out for that.. (!@#$%^&* seem to cause problems) with album art and playing by filename among other things.

in my latest code i've found that using asp and spyce to format the data into a useable format is easier than using the httpapi commands.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#4
hey thanks for that pointer! i have a flash one nicely underway ... its pretty sweet, though flash plays quite slow on a psp and doesnts have a native key repeat (just needed a workaround)

its currently at the state of loading in a getmedialocation&parameter=files;... and then parsing sucessfully the result into a similar skin to project mayhem 3.

can only use the arrow keys, mouse and click though, so ill be making some interesting useability tweaks

Image

i'll keep you posted, and ill pick your brains as i go (if cool)

mark
Reply
#5
i found that to solve the special character problem i used the ondata function as loadvars shits itself with the & especially in a load context.

Quote:loadvarstext =new loadvars();
loadvarstext.load(url);

loadvarstext.ondata = function(src:string)
{

loadtext_str = unescape(src);

// strip html
loadtext_str = loadtext_str.replace("<head>","");
loadtext_str = loadtext_str.replace("</head>","");
loadtext_str = loadtext_str.replace("<body>","");
loadtext_str = loadtext_str.replace("</body>","");
loadtext_str = loadtext_str.replace("<html>","");
loadtext_str = loadtext_str.replace("</html>","");
loadtext_str = loadtext_str.replace("<li>","");
loadtext_str = loadtext_str.replace("</li>","");
loadtext_str = loadtext_str.replace("<ul>","");
loadtext_str = loadtext_str.replace("</ul>","");
loadtext_str = loadtext_str.replace("&","&");

// split each line
raw_array = loadtext_str.split("\n")
}
Reply
#6
so... if this is swf it could effectively replace the web interface for a normal pc as well eh?

if anybody has the source files up i'd like to have a go at this. is interesting enough to make me reinstall mmflash
Image
Reply
#7
it uses the httpapi but could easily replace the html frontend.
when i get something more substantial to it ill post it up.
Reply
#8
you can check out my flash source code for talking with xbmc here:
http://liquidice629.googlepages.com/xbox...e_rev4.fla

hope it is useful to someone, i stopped working on it because of performance issues when there are more than a few hundred items in a folder.

it's saved as flash 2004 fla format.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
psp flash skin0