2009-05-21, 08:34
Hey guys,
I don't know if this is the right forum to post this question, but here I go :-)
I'm trying to develop a frontend for XBMC (on an XBOX) to control my music (with a Philips TSU9600), so that I don't need to have my TV turned on. I can get it to download the audio thumbnails using the HTTP-API, but it takes too much time to base64-decode it (see snippet below - grabbed from internet).
Is there a way I could just get the thumbnail using http, without it being encoded ? Is there a way I can tell the webserver to export the Userdata\Thumbnails folder to the 'world'. Or can I change the location where the thumbnails are stored to q:\web\... ?
I could ofcourse copy it to q:\web, but that wouldn't really be a nice solution.
<code>
// This code was written by Tyler Akins and has been placed in the
// public domain. It would be nice if you left this header intact.
// Base64 code from Tyler Akins -- http://rumkin.com
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function decode64(input) {
var output = new Array();
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
do {
enc1 = keyStr.indexOf(input.charAt(i++));
enc2 = keyStr.indexOf(input.charAt(i++));
enc3 = keyStr.indexOf(input.charAt(i++));
enc4 = keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output.push(String.fromCharCode(chr1));
if (enc3 != 64) {
output.push(String.fromCharCode(chr2));
}
if (enc4 != 64) {
output.push(String.fromCharCode(chr3));
}
} while (i < input.length);
return output.join("");
}
</code>
Thanks in advance !
I don't know if this is the right forum to post this question, but here I go :-)
I'm trying to develop a frontend for XBMC (on an XBOX) to control my music (with a Philips TSU9600), so that I don't need to have my TV turned on. I can get it to download the audio thumbnails using the HTTP-API, but it takes too much time to base64-decode it (see snippet below - grabbed from internet).
Is there a way I could just get the thumbnail using http, without it being encoded ? Is there a way I can tell the webserver to export the Userdata\Thumbnails folder to the 'world'. Or can I change the location where the thumbnails are stored to q:\web\... ?
I could ofcourse copy it to q:\web, but that wouldn't really be a nice solution.
<code>
// This code was written by Tyler Akins and has been placed in the
// public domain. It would be nice if you left this header intact.
// Base64 code from Tyler Akins -- http://rumkin.com
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function decode64(input) {
var output = new Array();
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
do {
enc1 = keyStr.indexOf(input.charAt(i++));
enc2 = keyStr.indexOf(input.charAt(i++));
enc3 = keyStr.indexOf(input.charAt(i++));
enc4 = keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output.push(String.fromCharCode(chr1));
if (enc3 != 64) {
output.push(String.fromCharCode(chr2));
}
if (enc4 != 64) {
output.push(String.fromCharCode(chr3));
}
} while (i < input.length);
return output.join("");
}
</code>
Thanks in advance !