Appendix A: A Longer Script Example - Roku HD1000 Manual

External control protocol
Hide thumbs Also See for HD1000:
Table of Contents

Advertisement

Appendix A: A longer script example

#!/bin/sh
# This script shows a set of images from the Memory
# Stick and SD/MMC cards, while playing music from the
# Compact Flash.
# features, like pan and zoom and information display.
# Adding /usr/local/bin to the path allows the script
# to call "photo" and "ecp" instead of
# "/usr/local/bin/photo" and "/usr/local/bin/ecp"
PATH=$PATH:/usr/local/bin
echo "launching"
# Launch the image viewer, and give it a couple of
# seconds to start up.
# Photo to /dev/null so as not to clutter up the
# terminal.
# the ECP lines as well, but it has been omitted for
# readability.
photo -p > /dev/null 2>&1 &
sleep 2
# Set the image directory.
# directory to be set in case the user starts
# punching buttons on the remote.
ecp photoApp IMAGEDIR "/tmp/Volumes/Memory Stick" | \
grep "photoApp: ok"
if [ $? –ne 0 ]
echo "setting the image directory failed"
exit 1
fi
# display the first image
ecp photoApp DISPLAY _ IMAGE "/mnt/flash3/racecar. jpg"
# For this slideshow, we won't display any info.
# it was on be default, dismiss it immediately
ecp photoApp SHOW _ INFO none
# Start the music
mp3player "/tmp/Volumes/CompactFlash/"*.mp3 > /dev/null 2>&1 &
# Start Photo fetching the next image in the background,
# so displaying it will be quick
ecp photoApp PREFETCH _ IMAGE "/mnt/flash3/F16 _ hires. jpg"
# Turn off info display for all images (we
# do this here because the first command besides the
# directory causes Photo to open the image display
# window, which paints the screen black – waiting until
# the first image has been displayed eliminates the
It shows off some of the image viewer's
We re-direct any output from
You would normally do this with each of
Photo requires a valid
If
Roku External Control Protocol for the HD1000
© 2003 Roku, LLC
5

Advertisement

Table of Contents
loading

Table of Contents