Skip to content

Commit

Permalink
Added Loop support, closes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Nov 10, 2018
1 parent f7ba9e0 commit cca2492
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
13 changes: 7 additions & 6 deletions AnimPlayer.hws
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
** **
** Name: AnimPlayer **
** Author: Dimitris Panokostas **
** Version: 2.2 **
** Date: 2018-11-08 **
** Interpreter: Hollywood 6.1+ **
** Version: 2.3 **
** Date: 2018-11-10 **
** Interpreter: Hollywood 7.1+ **
** **
****************************************************************/
Const #DEBUG = False
/*
** Make sure we have at least Hollywood 6.1
** Make sure we have at least Hollywood 7.1
*/
@VERSION 7,1

Expand All @@ -25,10 +25,10 @@ Const #DEBUG = False
** Information about this app
*/
@APPTITLE "AnimPlayer"
@APPVERSION "$VER: AnimPlayer 2.2 (2018-11-08)"
@APPVERSION "$VER: AnimPlayer 2.3 (2018-11-10)"
@APPCOPYRIGHT "(C) Copyright 2016-2018 by Dimitris Panokostas"
@APPAUTHOR "Dimitris Panokostas"
@APPDESCRIPTION "A simple anim player done in Hollywood"
@APPDESCRIPTION "A simple Amiga ANIM player"

/*
** Button and list view images
Expand Down Expand Up @@ -76,6 +76,7 @@ InstallEventHandler({RapaGUI = p_EventFunc, SizeWindow = p_EventFunc})
musstate$ = "init"
animDrawInterval = Nil
animSize = "original"
loopAnim = false

; main loop!
Repeat
Expand Down
1 change: 1 addition & 0 deletions AnimPlayer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<menu title="V_iew">
<item id="mn_pl" type="toggle" selected="false" shortcut="Ctrl-L">Playlist</item>
<item id="mn_loop" type="toggle" selected="false">Loop Anims</item>
</menu>
<menu title="Help">
<item id="mn_about" shortcut="Shift-F1">_About...</item>
Expand Down
16 changes: 15 additions & 1 deletion AnimPlayerLib.hws
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,18 @@ Function p_DrawNextFrame()
ClearInterval(animDrawInterval)
animDrawInterval = Nil
EndIf
p_Next()
; If Loop Anims was selected, restart the same Anim instead of going to the Next one
If loopAnim = True
If #DEBUG Then DebugPrint("p_DrawNextFrame(): Loop is enabled...")
p_Stop()
If #DEBUG Then DebugPrint("p_DrawNextFrame(): Now calling p_LoadSelectedAnim()...")
p_LoadSelectedAnim()
If #DEBUG Then DebugPrint("p_DrawNextFrame(): Now calling p_Play() on the loaded Anim...")
p_Play()
Else
If #DEBUG Then DebugPrint("p_DrawNextFrame(): Anim ended, no Loop is enabled, skipping to Next...")
p_Next()
EndIf
EndIf
EndFunction

Expand Down Expand Up @@ -344,6 +355,9 @@ Function p_GUIEvent(id)
moai.Request("AnimPlayer2", "AnimPlayer2\n(C) 2016 by Dimitris Panokostas\n", "OK")
Case "pl":
moai.Set("playlist", "open", moai.Get("mn_pl", "selected"))
Case "loop":
If #DEBUG Then DebugPrint("Clicked on Loop, current status: ", moai.Get("mn_loop", "selected"))
loopAnim = moai.Get("mn_loop", "selected")
Case "original":
animSize = "original"
p_ResizeDisplay(animSize)
Expand Down

0 comments on commit cca2492

Please sign in to comment.