>>3 non-newtonian
Unscientific and Ultimately Destructive
Name:
Anonymous2010-07-30 23:50
OpenConsole();
timeofday.i=0;
If ReadFile(0, "loadmusic.dat");
Night$ = ReadString(0);
Day$ = ReadString(0);
Else
PrintN("File not found: please create file `loadmusic.dat` with 2 lines-> night music file and day music file")
End 2;
EndIf;
If (Hour(Date()))>21 Or (Hour(Date()))<9
PrintN("Start Night music:"+Night$);
state=RunProgram(Night$, "", "", #PB_Program_Open)
mode=1
Else
PrintN("Start Day music:"+Day$);
state=RunProgram(Day$, "", "", #PB_Program_Open)
mode=0
EndIf
While 1=1
If ((Hour(Date()))>21 Or (Hour(Date()))<9)
timeofday=1
Else
timeofday=0
EndIf;
If timeofday=1 And mode=0
KillProgram(state);
state=RunProgram(Night$, "", "", #PB_Program_Open)
PrintN("Switch-> Night music:"+Night$);
mode=1;
EndIf
If timeofday=0 And mode=1
KillProgram(state);
PrintN("Switch->Day music:"+Day$);
state=RunProgram(Day$, "", "", #PB_Program_Open)
mode=0;
EndIf
Delay(60000)
Wend
Name:
Anonymous2010-07-31 0:20
>>4
Did you just call Einstein unscientific and ultimately destructive? IHBT
Mine would be a shell script instructing Amarok over D-Bus to load a new playlist at configured times. It's ``cross-platform'' in terms of OS and architecture, but still ties you down to specific software.
I don't have any need of such a thing so I'm not going to write it. Probing Amarok via D-Bus about how it wants to load a new playlist is by far more time consuming than writing the actual code.
>>8
you're making it too complex, because you have to consider whether or not that playlist will complete in a specified amount of time
1,8>>
you're dealing with queueing and scheduling, ie, sorting queues and deciding on relative lengths of 'days' and 'music' >>1
your solution follows, because bash is ``cross-platform'' (c.f. wikipedia)
... IHBT