This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub gifDecoderDidFinish(frames as Object, fps as Float) | |
m.animator.callFunc("start", frames, fps, m.posterGrid.getChild(m.focusedItem)) | |
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub focusItem(item as Integer) | |
(...) | |
' Stop previous poster animation | |
m.animator.callFunc("finish") | |
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub init() | |
m.animator = createObject("roSGNode", "FrameAnimator") | |
(...) | |
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub init() | |
m.animator = CreateObject("roSGNode", "Timer") | |
m.animator.ObserveField("fire", "displayNextFrame") | |
m.animator.repeat = true | |
m.frames = [] | |
m.frameIndex = -1 | |
m.poster = invalid | |
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<component name="FrameAnimator" extends="Node"> | |
<interface> | |
<function name="start"/> | |
<function name="finish"/> | |
</interface> | |
<script type="text/brightscript" uri="pkg:/components/FrameAnimator.brs"/> | |
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub focusItem(item as Integer) | |
(...) | |
' Start decoder | |
m.decoder.callFunc("decodeGIF", getGIFUrl(item)) | |
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub gifDecoderDidFinish(frames as Object, fps as Float) | |
?"frames "frames | |
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub init() | |
m.decoder = createObject("roSGNode", "GIFDecoder") | |
m.decoder.delegate = m.top | |
(...) | |
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<component name="AppScene" extends="Scene"> | |
<interface> | |
<!-- GIFDecoder callback --> | |
<function name="gifDecoderDidFinish"/> | |
</interface> | |
<script type="text/brightscript" uri="pkg:/components/AppScene.brs"/> | |
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub decodeGIF(gifPath as String) | |
m.top.functionName = "runDecoder" | |
m.gifPath = gifPath | |
m.gifName = CreateObject("roPath", m.gifPath).split().basename | |
m.top.control = "RUN" | |
end sub | |
sub runDecoder() | |
' Load the main GIF into memory. |
NewerOlder