'****** CREATE MESSAGE PORTS ****** p = CreateObject("roMessagePort") tmr = CreateObject("roMessagePort") sp = CreateObject("roMessagePort") '****** CREATE GPIO PORT ****** gpio = CreateObject("roGpioControlPort") gpio.SetPort(p) gpio.EnableInput(0) gpio.EnableInput(1) gpio.EnableInput(2) gpio.EnableInput(3) gpio.EnableInput(4) gpio.EnableInput(5) gpio.EnableOutput(6) gpio.EnableOutput(7) '****** CREATE TIMER ****** st = CreateObject("roSystemTime") Timer = CreateObject("roTimer") Timer.SetPort(p) '****** CREATE SERIAL PORT ****** serial = CreateObject("roSerialPort",0,4800) serial.SetLineEventPort(p) '****** AVAILABLE AUDIO SETTINGS ****** ' ANALOG OUTPUT VALUES: ' 0 - Analog audio ' 1 - USB Audio ' 2 - SPDIF audio, stereo PCM ' 3 - SPDIF audio, raw AC3 ' 4 - Analog audio with SPDIF mirroring raw AC3 ' AUDIO MODE VALUES: ' 0 - AC3 Surround ' 1 - AC3 mixed down to stereo ' 2 - No audio ' (Options 0 & 1 only apply to video files, 2 applies to all audio sources) ' MAPPING VALUES: ' 0 - Stereo audio is mapped to HD810 analog output ' 1 - Stereo audio is mapped to Expander Audio 1 (left) if Expander is present ' 2 - Stereo audio is mapped to Expander Audio 2 (middle) if Expander is present ' 3 - Stereo audio is mapped to Expander Audio 3 (right) if Expander is present ' VOLUME SETTING RANGE: ' 0 = lowest to 100 full volume '****** VIDEO MPEG FILE SETTINGS ****** video = CreateObject("roVideoPlayer") video.SetPort(p) vm = CreateObject("roVideoMode") vm.SetMode ("1920x1080x29.97p") video.SetAudioOutput(3) video.SetAudioMode(0) video.MapDigitalOutput(0) video.SetVolume(100) '****** AUDIO MP3 FILE SETTINGS ****** audio = CreateObject("roAudioPlayer") audio.SetPort(p) audio.SetAudioOutput(0) audio.SetAudioMode(2) audio.MapStereoOutput(2) audio.SetVolume(100) '****** IMAGE SETTINGS ****** image = CreateObject("roImagePlayer") ok = image.SetDefaultMode(1) 'SET INITIAL IMAGE SCALING ok = image.DisplayFile("black.png") Print "System started." event_loop: msg = wait(0, p) if type(msg)="roGpioButton" then buttonpress goto event_loop buttonpress: tm=msg.GetInt() If tm = 0 Then 'Start English ok = video.Stop() ok = image.StopDisplay() ok = audio.Stop() gpio.SetOutputState(6,1) 'English Feedback Light '*********** Put Video Filename in the quotes below ************* ok = video.PlayFile("RIVER_ENG.ts") '**************************************************************** If ok = 0 Then Print "Unable to read video file.": GoTo event_loop Print "Movie started from button panel." msg = wait(100, tmr) 'Delay in ms to sync MP3 file playback with video. ok = audio.PlayFile("ENG_AD.mp3") 'used as a place holder If ok = 0 Then Print "Unable to read audio description file." else Print "Audio Description audio started." endif timeout = st.GetLocalDateTime() Print timeout '*********** Put program length in seconds in the parenthesis below ****** timeout.AddSeconds(607) 'Number of seconds from start of movie until end '************************************************************************* Timer.SetDateTime(timeout) timer.Start() Print timeout GoTo clear_events EndIf If tm = 1 Then 'Start Spanish ok = video.Stop() ok = image.StopDisplay() ok = audio.Stop() gpio.SetOutputState(7,1) 'Spanish Feedback Light '*********** Put Video Filename in the quotes below ************* ok = video.PlayFile("RIVER_SPA.ts") '**************************************************************** If ok = 0 Then Print "Unable to read video file.": GoTo event_loop Print "Movie started from button panel." msg = wait(100, tmr) 'Delay in ms to sync MP3 file playback with video. ok = audio.PlayFile("SPA_AD.mp3") 'used as a placeholder If ok = 0 Then Print "Unable to read audio description file." else Print "Audio Description audio started." endif '*********** Put program length in seconds in the parenthesis below ****** timeout.AddSeconds(607) 'Number of seconds from start of movie until end '************************************************************************* Timer.SetDateTime(timeout) timer.Start() Print timeout GoTo clear_events GoTo clear_events EndIf GoTo event_loop clear_events: msg = wait(0, p) if type(msg) = "roTimerEvent" then Print "lights up." GoTo Clear_events EndIf if type(msg) = "roVideoEvent" then If msg.GetInt() = 8 Then Print "Movie has ended." Print "lights up." ok = image.DisplayFile("black.png") gpio.SetOutputState(6,0) 'turn off feedback english gpio.SetOutputState(7,0) 'turn off feedback spanish GoTo event_loop EndIf EndIf if type(msg)="roGpioButton" then tm=msg.GetInt() If tm = 2 Then print "Stop button pushed." Print "lights up." ok = video.Stop() ok = image.StopDisplay() ok = audio.Stop() Timer.Stop() gpio.SetOutputState(6,0) 'turn off feedback english gpio.SetOutputState(7,0) 'turn off feedback spanish ok = image.DisplayFile("black.png") GoTo event_loop EndIf EndIf GoTo clear_events