Human readable songtitle|mp3 filename|song duration in secconds
This allmost works, but the same line in the notecard get's repeated about 30 times, so ot feeds the same url 30 times in a row, with correct sleep time in between, and then it steps to the next line... I must confess that i have really hard time to understand the logics of how the dataserverthing works... I wich it would have been more like in php. :|
Does anyone knows where i think wrong or fail to think at all?
Code:
CODE
integer pointer=0;
string cardName="Songlist";
default
{
state_entry(){
}
touch_start(integer num)
{
llSay(0, "-=[ Starting Stereo V0.1a ]==-");
llGetNotecardLine(cardName, pointer);
}
dataserver(key id, string data)
{
if(pointer == 30){
pointer = 0;
llGetNotecardLine(cardName, pointer);
}
integer l = 30; // I tried to set this dynamically with llGetNumberOfNotecardLines("Songlist"), but that stepped the pointer on row forward. :(
integer s = 0;
while(s < l){
list songlist = llParseString2List(data,["|"],[""]);
llSay(0, "Playing " + llList2String(songlist,0));
llSetParcelMusicURL("http://mywebbserver.com/" + llList2String(songlist,1));
// llSay(0, "MP3 Name: " + llList2String(songlist, 1));
llSleep((integer)llList2String(songlist,2));
//llSay(0, "I should sleep for " + (string)llList2String(songlist,2) + "secconds.");
llGetNotecardLine(cardName, pointer);
s++;
pointer++;
}
}
}
Notecard "Songlist":
CODE
Alphaville - Big In Japan (03:53)|Alphaville_-_Big_In_Japan.mp3|233
Alphaville - Forever Young (03:50)|Alphaville_-_Forever_Young.mp3|230
New Baccara - Moonlight Shadow (04:03)|Baccara_-_Moonlight_Shadow.mp3|243
New Baccara - Touch Me (05:12)|Baccara_-_Touch Me.mp3|312
Boney M - Belfast (03:28)|Boney_M_-_Belfast.mp3|208
Boney M - Daddy Cool (03:29)|Boney_M_-_Daddy_Cool.mp3|209
Boney M - Rasputin (04:26)|Boney_M_-_Rasputin.mp3|266
Boney M - Rivers Of Babylon (04:17)|Boney_M_-_Rivers_Of_Babylon.mp3|257
Boney M - Sunny (03:16)|Boney_M_-_Sunny.mp3|196
Boogie Nights Disco Funk (02:38)|Boogie_Nights_Disco_Funk.mp3|158
Dschinghis Khan - Dschingis Kahn (03:05)|Dschinghis_Khan_-_Dschingis_Kahn.mp3|185
Dschingis Kahn - Komm doch heim (04:18)|Dschingis_Kahn_-_Komm_doch_heim.mp3|258
Dschingis Kahn - Moskau Moskau (06:01)|Dschingis_Kahn_-_Moskau,_Moskau.mp3|361
Electric Light Orchestra - Living Thing (03:31)|ELO_-_It's_A_Living_Thing.mp3|211
Eruption - One way ticket (03:35)|Eruption_-_One_way_ticket.mp3|215
Jane Birkin & Serge Gainsbourg - Jetaime (04:18)|Jetaime.mp3|258
John Paul Young - Love Is In The Air (03:23)|John_Paul_Young_-_Love_Is_In_The_Air.mp3|203
Karen Cheryl - Tchoo Tchoo (03:24)|Karen_Cheryl_-_Tchoo_Tchoo.mp3|204
Mono Fur Alle - Honecker Komm Zuruck (05:53)|Mono_Fur_Alle_-_Honecker_Komm_Zuruck.mp3|353
New Baccara - Caballero (03:59)|New_Baccara_-_Caballero.mp3|239
New Baccara - Fantasy Boy (05:32)|New_Baccara_-_Fantasy_Boy.mp3|332
Nina Hagen - Du hast den Farbfilm vergessen (03:04)|Nina_Hagen_-_Du_hast_den_Farbfilm_vergessen.mp3|184
Tommy Seebach - Apache (04:44)|Tommy_Seebach_-_Apache.mp3|284
Udo Lindenberg - Damals in der DDR (03:43)|Udo_Lindenberg_-_Damals_in_der_DDR.mp3|223
Veronica Unlimited - 06 - Daddy-O (03:46)|Veronica_Unlimited_-_06_-_Daddy-O.mp3|226
Veronica Unlimited - What Kind Of Dance Is This (03:36)|Veronica_Unlimited_-_What_Kind_Of_Dance_Is_This.mp3|216
Village People - Go west (03:31)|Village_People_-_Go_west.mp3|211
Village People - In The Navy (03:47)|Village_People_-_In_The_Navy.mp3|227
Village People - Macho Man (03:31)|Village_People_-_Macho_Man.mp3|211
Village People - You cant stop the music (03:39)|Village_People_-_You_cant_stop_the_music.mp3|219