Quote:
Originally Posted by DrJones
My idea is for the time sound is playing to create a blink for the lamps.
I just have to figure out now, how i can implement this.
has anybody an idea how it is possible to implement a switch between the visible index from a static bitmap array controlled by time got from playing lenght of the sound and the times it has to blink.
|
Not sure if this is what your looking for, but I put a blinking light in my Stadimeter fix. This was activated on clicking the switch - the length you just set with
count value and the blink length duration =
DurationInSeconds.
This was the code - may be of use:
Its in my TorpedoSolution.py script
Code:
def StadimeterAct( sender ):
global FlashingIcon
if FlashingIcon != False:
return
else:
item = PageTorpedoSolution_RightPanel_StadActWhite
count = 5
if item.Visible <= 0:
return
if item.Visible and count <= 0:
item["blinking"] = None
item.Parent.AnimationStopped -= BlinkTimerAnimationStopped
return
if not item["blinking"]:
item["blinking"] = True
item.Parent.AnimationStopped += BlinkTimerAnimationStopped
item.Visible = not item.Visible
DurationInSeconds = 0.3
if not item.Visible:
DurationInSeconds = DurationInSeconds / 2.0
#set the animation on the Parent because animations don't run when an item is not visible
a = item.Parent.StartAnimation( MenuItemWrapper.AnimationTypes.Timer, 1.0, DurationInSeconds )
a["blinkitem"] = item
if item.Visible:
count = count - 1
a[ "blinkcount" ] = count
FlashingIcon = False
Also Panel looks great, nicely made