2006-08-23, 22:35
I am using the "XBMC Lyrics script by SveinT" and I love it. I mapped it to a button on my remote even. Slight problem: if you accidentally execute the script when no song is playing, it hangs.
What I want to do is add a simple logic fork which only executes the main part of the script if a song is playing, and simply end if one is not.
if I understand the script code correctly, the majority of the code is in defining the classes which are then used. the driver part of the script is very simple:
w = Overlay()
w.doModal()
del w
i'm assuming this instantiates the object w, runs a built in function, then destroys the object. all my proposed change would need to do is nest these three lines inside a logical if. i vaguely understand the syntax is like if conditional statement:
and then you indent everything you want to be executed in the event that the conditional statement is true.
so i would need to do like
if isPlayingAudio()
[indented code here]
right?
What I want to do is add a simple logic fork which only executes the main part of the script if a song is playing, and simply end if one is not.
if I understand the script code correctly, the majority of the code is in defining the classes which are then used. the driver part of the script is very simple:
w = Overlay()
w.doModal()
del w
i'm assuming this instantiates the object w, runs a built in function, then destroys the object. all my proposed change would need to do is nest these three lines inside a logical if. i vaguely understand the syntax is like if conditional statement:
and then you indent everything you want to be executed in the event that the conditional statement is true.
so i would need to do like
if isPlayingAudio()
[indented code here]
right?