0

HD600 Keyboard Input



I need to demo an HD600 that plays 4 video clips in a series, looped, but on a key press it should jump to the corresponding clip then continue the loop with the next clip. The plan is to use a GPIO board, but until I order or make one I want to be able to test it using the keyboard numbers 1 through 4 to correspond to the clips. I've searched the board and gone through the support website but it's not jumping out at me. Does anyone have any idea how to accomplish this?

1 comment

  • 0
    Avatar
    RokuLyndon


    debug = falese



    REM

    rem This script waits for a button press to starting playing a video

    rem It plays numbered videos from 1 - 4. It plays each video in a loop

    rem until it detects another button press. Pressing a button 1 when video1

    rem is playing will restart video1. Assumes video1.mpg, video2.mpg,

    rem video3.mpg, video4.mpg are present. Use buttons 1 - 4 to play videos 1 - 4.

    rem



    REM ******************************************************************

    REM Initialize Objects

    REM ******************************************************************

    REM Initialize Video & Button

    video=CreateObject("roVideoPlayer")

    rem mode=CreateObject("roVideoMode")

    kbpress=CreateObject("roKeyboard")

    p=CreateObject("roMessagePort")

    video.SetPort(p)

    kbpress.SetPort(p)





    REM *********************************************************************

    REM Set Constants

    REM *********************************************************************

    rem videomode$="1280x720x60p" 'sets video mode to 720p, when enabled

    MEDEN=8

    video_to_play$=""

    one=49 'value returned when you press #1 on the keyboard

    two=50 'value returned when you press #2 on the keyboard

    three=51 'value returned when you press #3 on the keyboard

    four=52 'value returned when you press #4 on the keyboard



    rem

    rem Set Video Mode

    rem Sets the video output. To use, remove the comment "rem" from the mode.SetMode line

    rem This script uses the current video settings.

    rem For VGA, use "1024x768x60p"

    rem For Component, use "1280x720x60p"

    rem Consult your user's guide for other video mode options

    rem

    rem mode.SetMode(videomode$)





    rem

    rem Audio Settings

    rem This script uses the current audio settings. To use the settings below,

    rem remove the comment "rem". The unit defaults to analog audio, with volume of 100

    rem SetAudioOutput - to change from analog (0), to USB(1), to Optical/HDMI(2)

    rem SetVolume - to change the volume level, from 0 to 100

    rem Consult your user's guide for other audio options

    rem

    rem video.SetAudioOutput(0)

    rem video.SetVolume(100)







    rem

    rem Waiting for a keyboard press to start playback

    rem All buttons are ignored except for buttons 1 - 4

    rem



    wait_for_key:

    If debug print "Waiting for a key to be pressed."

    msg=wait(0,p)



    if type(msg)="roKeyboardPress" then



    if msg.GetInt() = one then

    video_to_play$="video1.mpg"



    else if msg.GetInt() = two then

    video_to_play$="video2.mpg"



    else if msg.GetInt() = three then

    video_to_play$="video3.mpg"



    else if msg.GetInt() = four then

    video_to_play$="video4.mpg"



    endif



    else if type(msg)="roVideoEvent" then

    status=msg.GetInt()

    if status <> MEDEN then goto wait_for_key

    goto play_video

    endif





    play_video:

    if debug print "Current file is: "; video_to_play$

    video.PlayFile(video_to_play$)



    goto wait_for_key
Please sign in to leave a comment.