A simple program needed, please.

Find quick help here to get you started with Hollywood
plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: A simple program needed, please.

Post by plouf »

There rhousants of converters on windows, like ffmpeg itself
CDXL not work at ant case ?(would be more amiga ;-))

As for video when user closes is just exiting last until loop

So put a playvideo under this last exppression
Christos
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

I have no idea how to covert video to CDXL format. The one I created using https://mschordan.github.io/amiga/agaconv.html is not recognized by Hollywood as Andreas confirmed.

Anyway, regarding playing video after the user closes the Hollywood window (or presses the Esc button), I wrote a function for that but I am struggling hard to trigger it without blocking the actual slideshow - because the slideshow is being shown in a loop forever, you know. Can you advise, please?

Code: Select all

Function p_HandlerFunc(msg)
  Switch(msg.action)
  Case "CloseWindow":
     SetDisplayAttributes({Width = 640, Height = 360, Borderless = True})
     SetVideoSize(2,640,360)
     PlayVideo(2)
     While IsVideoPlaying(2)	
	   Wait(1)
     Wend
     CloseVideo(2)
     End
  Case "OnKeyDown":
    If msg.key = "ESC" Then End
  EndSwitch
EndFunction

InstallEventHandler({CloseWindow = p_HandlerFunc,
   OnKeyDown = p_HandlerFunc})
   
Repeat

;LOAD FIRST IMAGE
DisplayBrushFX(1, 0, 0, {type = #CROSSFADE, speed = #NORMALSPEED})

WaitLeftMouse

;SECOND 
DisplayBrushFX(2, 0, 0, {type = #CROSSFADE, speed = #FASTSPEED})

WaitLeftMouse

Forever

plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: A simple program needed, please.

Post by plouf »

you have no CheckEvent() to check and grab, also waitmouse block script and looses events have to let script running and catch events
example

Code: Select all


Function p_HandlerFunc(msg)

  Switch(msg.action)
  Case "CloseWindow":
     DebugPrint("last video")
     End
  Case "OnMouseUp":
     displayfx=displayfx+1
  Case "OnKeyDown":
    If msg.key = "ESC" Then End
  EndSwitch
EndFunction

InstallEventHandler({	CloseWindow =    p_HandlerFunc,
   			OnKeyDown =      p_HandlerFunc,
			OnMouseUp = p_HandlerFunc })
DisplayFX = 1 ; initiate a global var
Repeat

Switch(DisplayFX)
Case 1:
	;DisplayBrushFX(1, 0, 0, {type = #CROSSFADE, speed = #NORMALSPEED})
	DebugPrint("fisrt")
Case 2:
	;DisplayBrushFX(2, 0, 0, {type = #CROSSFADE, speed = #FASTSPEED})
	DebugPrint("second")
EndSwitch

CheckEvent()
Wait(1)
Forever
Christos
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Oh, I got the logic now, thank you Christos!

I've just added the following lines into the Function, right after the displayfx=displayfx+1, to keep my slideshow in the loop :)

Code: Select all

if displayfx > 8
   displayfx = 1
endif
Please let me know your full name via PM so I can add you to the credits.
Thanks again!
Jan
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Oh, one more thing, please. The event checking works too good now :P I mean there is a video playing before the slideshow is launched and if I press a mouse button at that time, the click is saved for later that makes the following slideshow to switch from the first slide to the second one immediately... Despite the PlayVideo command is launched before everything else in the script.

Can I disable user input during the video replaying, somehow?
plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: A simple program needed, please.

Post by plouf »

there are too solutions for each problem, and too many implementation for each requirement :)
for this specific already created implementation i will add variable increment inside a

if IsVideoPlaying(id)=False
Christos
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Well, the video starts at the beginning of the script as follows

Code: Select all

PlayVideo(1)
While IsVideoPlaying(1) 
  Wait(1)
Wend
CloseVideo(1)
Then the Function, InstallEventHandler the Switch (Slideshow) parts follow.

If I encapsulate those parts into:

if IsVideoPlaying(1)=False
endif

then the Hollywood complains that "Could not find video 1"

If I remove CloseVideo(1) from the video replaying code, it does not complain anymore, of course, but the mouse clicks over the video are transferred to the slideshow, exactly as before. I am puzzled.
plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: A simple program needed, please.

Post by plouf »

"i will add the variable increment"

Code: Select all

if IsVideoPlaying(1)=False
  displayfx = displayfx+1
  if displayfx > 8
     displayfx = 1
  endif
endif
Christos
Jan
Posts: 26
Joined: Sun Sep 17, 2017 10:28 am
Location: Slovakia
Contact:

Re: A simple program needed, please.

Post by Jan »

Same result :(
plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: A simple program needed, please.

Post by plouf »

the video you are playins is 1 or ?
i see in your example above you use playvideo(2)
Christos
Post Reply