Documentos de Académico
Documentos de Profesional
Documentos de Cultura
From Xtreamer
Contents
1 Introduction 2 Standard RSS Structure 3 <item> Element Structure 4 Optional 'item' Element Attributes 4.1 Thumbnails - <media:thumbnail 4.2 'mediaDisplay' Element Attributes 4.2.1 Styles - <mediaDisplay name 4.3 Design attributes for all media names 4.3.1 Header attributes 4.3.2 Caption attributes 4.3.3 Menu attributes 4.3.4 Item attributes 4.3.5 Focus attributes 4.3.6 Popup (Warning message) attributes 4.3.7 Suffix attributes 4.3.8 Side attributes 4.3.9 Image attributes 4.3.10 Idle image (Loading icon) attributes 4.3.11 Miscellaneous attributes 4.4 Animated Loading Icon 5 Additional xDisplay definitions 5.1 'itemDisplay' Element Attributes 5.2 'infoDisplay' Element Attributes 5.3 'backgroundDisplay' Element Attributes 6 Advanced RSS Scripting 6.1 Supported Remote Keys 6.2 Null commands / inputs / functions 6.3 Events which can have scripted actions 6.4 Example scripted actions for <onUserInput> 6.5 Function calls / actions 6.6 Some example usage 7 Supported <link> protocols 8 AP Functions / classes 9 Item Templates 10 Example <item> feed from the official RSS Feed 11 Credits
Introduction
Since firmware version 2.2 of Xtreamer we have had the ability to easily host a file on any drive attached to the Xtreamer (Internal or USB) by simply creating a folder on the sda1 drive called scripts and placing a file inside this folder called menu.rss which can be created manually using any text editor. You can also use any menu.rss created by others for the Xtreamer or other similar Realtek devices (Such as the lists posted on the official forum) and this will work also. The format of the menu.rss files are detailed below.
Please note that all of the tags / elements used (except the xml versioning) have a start <nameofelement> and an end </nameofelement> these tags are case specific. Elements can also have optional additional attributes for example you could have: <exampleelement>Xtreamer Rocks!</exampleelement> and then add optional entries like this: <exampletag height:"120px" width:"100px">Xtreamer Rocks!</exampletag>. There are many other similar types of usage which will be detailed below. If you have any further questions after reading the guide then please post them on the official Xtreamer forum. Remember that you can view any of the current rss feeds in any text editor or view the source of any online RSS feed such as those hosted by Xtreamer at [1] to see how they are compiled. Remember that you can copy and paste an existing feed and change just the title / link & thumbnail to your own. If you get a 404 Error on trying to enter the 'Custom RSS (Personal)' page then you have made a typing error or installed the menu.rss incorrectly. Paste details of your file names and locations and your rss file to the official forum for help in finding the typing mistake or assistance in making it work.
<title>Name of feed here</title> <link>URL of feed for example http://www.myfeed.com/rss</link> >>All optional elements & attributes go here<< </item>
Example use:
<mediaDisplay name=photoView attribute1="" ... attributeN="" />
photoView* (example) (http://forum.xtreamer.net/download/file.php?id=1607) Easily tweakable panel type display useful for channel selection and video feeds with thumbnails specific to each episode
photoFocusView* Scrolling 'Coverflow' type display useful for channel selection with thumbnails specific to each feed threePartsView* Style used for Youtube Note: This style can help make feeds work which fail to play with no error message shown onePartView* Suitable for blogs / news rss view or long lists of videos without thumbnails
Header attributes
Attribute showHeader headerXPC headerYPC headerWidthPC headerHeightPC headerImageXPC headerImageYPC headerImageWidthPC headerImageHeightPC headerCapXPC headerCapYPC headerCapWidthPC Allowed Values "yes" / "no" 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 Description of usage Show header or not Horizontal position of header Vertical position of header Header width Proportion of Header height Header image proportional vertical position Proportion of Header image width Proportion of Header image height Header image proportional vertical position Header caption proportional width Example Value showHeader="no" headerXPC="7" headerYPC="10" headerWidthPC="0" headerHeightPC="4" headerImageYPC="10" headerImageWidthPC="95" headerImageHeightPC="10" headerCapYPC="10" headerCapWidthPC="0"
Header caption proportional width Colour of header Size of header fonts Round corners on headers
Caption attributes
Attribute capXPC capYPC capWidthPC capHeightPC Allowed Values 0 to 100 0 to 100 0 to 100 0 to 100 Description of usage Caption horizontal proportional position Caption vertical proportional position Width of caption Height of caption Example Value capXPC="0" capYPC="7" capWidthPC="70" capHeightPC="7"
Menu attributes
Attribute menuXPC menuYPC menuWidthPC menuHeightPC menuImageXPC menuImageYPC menuImageWidthPC menuImageHeightPC menuOffsetXPC menuOffsetYPC menuBorderColor selectMenuOnRight menuPerPage menuCornerRounding Allowed Values 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 RGB Values rrr:ggg:bbb "yes" / "no" 0 to ? "yes" / "no" Description of usage Menu horizontal position Menu vertical position Width of menu Height of menu Menu image horizontal position Menu image vertical position Width of menu image Height of menu image Proportion of gap left & right of menu Proportion of gap above & below menu Colour of menu border Should select menu display on right side? # of menus to display per page Round corners of menu Example Value menuXPC="5" menuYPC="5" menuWidthPC="15" menuHeightPC="15" menuImageXPC="5" menuImageYPC="5" menuImageWidthPC="15" menuImageHeightPC="15" menuOffsetXPC="8" menuOffsetYPC="12" menuBorderColor="20:20:20" selectMenuOnRight="yes" menuPerPage="1" menuCornerRounding
Item attributes
Attribute drawItemText slidingItemText itemXPC itemYPC itemWidthPC itemHeightPC itemImageXPC itemImageYPC itemImageWidthPC itemImageHeightPC itemOffsetXPC itemOffsetYPC itemBorderColor itemBackgroundColor itemBackgroundWidthPC itemBackgroundHeightPC itemGap itemGapXPC itemGapYPC itemPerPage itemPerColumn autoSelectItem rollItems itemCornerRounding itemAlignt Allowed Values "yes" / "no" "yes" / "no" 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 RGB Values rrr:ggg:bbb RGB Values rrr:ggg:bbb 0 to 100 0 to 100 0 to ? 0 to 100 0 to 100 0 to ? 0 to ? "yes" / "no" "yes" / "no" "yes" / "no" Description of usage Display Item description 'on' item Use sliding item text Horizontal proportion of item Vertical proportion of item Proportional width of item to display Proportional height of item to display Proportion of item image width to display Proportion of item image height to display Proportion of item image width displayed Proportion of item image height displayed Horizontal offset of item Vertical offset of item Colour of item border Colour of item background Item background width Item background height Gap between items on display Horizontal proportion of gap between items Vertical proportion of gap between items Number of items to display per page Number of items to display per Column Automatically select item on entry Use 'Roll items' function Round item corners Example Value drawItemText="no" slidingItemText="yes" itemXPC="20" itemYPC="18" itemWidthPC="12.5" itemHeightPC="33.3" itemImageXPC="12" itemImageYPC="18" itemImageWidthPC="7" itemImageHeightPC="8" itemOffsetXPC="9" itemOffsetYPC="49" itemBorderColor="0:0:0" itemBackgroundColor="0:0:0" itemBackgroundWidthPC="13.5" itemBackgroundHeightPC="35" itemGap="0" itemGapXPC="1.5" itemGapYPC="1" itemPerPage="9" itemPerColumn="3" autoSelectItem="no" rollItems="yes" itemCornerRounding="yes" itemAlignt="left"
Focus attributes
Attribute forceFocusOnItem imageFocus Allowed Values "yes" / "no" null / image url Description of usage Force item focus on Image to display when item state = in focus Example Value forceFocusOnItem="no" imageFocus=null
imageUnFocus imageParentFocus parentFocusFontColor focusBorderColor unFocusBorderColor focusFontColor unFocusFontColor focusItemOffsetYPC focusItemWidthPC focusItemHeightPC
null / image url null / ? RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx 0 to 100 0 to 100 0 to 100
Image to display when item state = not in focus ? ? Colour of item border when item in focus Colour of item border when item is not in focus Colour of item text when item in focus focus Colour of item text when item is not in focus Offset height of selected item (Item in focus) Width of selected item (Item in focus) Height of selected item (Item in focus) Width of background of selected item Height of background of selected item
imageUnFocus=null imageParentFocus=null parentFocusFontColor="100:0:100" focusBorderColor="0:0:0" unFocusBorderColor="0:0:0" FontColor="255:255:255" unFocusFontColor="110:110:110" focusItemOffsetYPC="20" focusItemWidthPC="23.43" focusItemHeightPC="62.5" focusItemBackgroundWidthPC="24" focusItemBackgroundHeightPC="65"
Suffix attributes
Attribute suffixXPC suffixYPC suffixBgColor suffixTextColor suffixClearImage suffixClearImageXPC suffixClearImageYPC suffixClearImageWPC suffixClearImageHPC Allowed Values 0 to 100 0 to 100 RGB Values RGB Values Image url(?) 0 to 100 0 to 100 0 to 100 0 to 100 Description of usage Proportional position suffix Proportional position of suffix xxx:xxx:xxx Colour of suffix background xxx:xxx:xxx Colour of suffix font 'Clear image' for suffix Example Value' suffixXPC="7" suffixYPC="22" suffixBgColor="255:255:0" suffixTextColor="255:255:0" suffixClearImage="http://example.com /test.jpg"
Proportional horizontal position of suffix 'clear suffixClearImageXPC="10" image' Proportional vertical position of suffix 'clear image' Proportional width of suffix 'clear image' Proportional height of suffix 'clear image' suffixClearImageYPC="20" suffixClearImageWPC="30" suffixClearImageHPC="30"
Side attributes
Attribute sideLeftWidthPC sideRightWidthPC sideTopHeightPC sideBottomHeightPC sideColorRight sideColorLeft sideColorTop sideColorBottom Allowed Values 0 to 100 0 to 100 0 to 100 0 to 100 RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx Description of usage Width of left side bar Width of right side bar Height of top bar Height of bottom bar Colour of right side bar on screen display Colour of left side bar on screen display Colour of top bar on screen display Colour of bottom bar on screen display Example Value sideLeftWidthPC="10" sideRightWidthPC="0" sideTopHeightPC="20" sideBottomHeightPC="10" sideColorRight="0:0:0" sideColorLeft="0:0:0" sideColorTop="0:0:0" sideColorBottom="0:0:0"
Image attributes
Attribute imageRightSide imageRightSide_tile imageLeftSide imageLeftSide_tile imageBottomSide imageBottomSide_Tile imageTopSide imageTopSide_Tile imageBackground_tile Allowed Values URL of image URL of image URL of image URL of image URL of image URL of image URL of image URL of image URL of image Description of usage Image to display on right side of screen Image to display tiled on right side of screen Image to display on left side of screen Image to display tiled on left side of screen Image to display on bottom side of screen Image to display on top side of screen Image to display tiled on top side of screen Image to use tiled as background Example Value imageRightSide="http://123.com.image.jpg" imageRightSide_tile="http://123.com.image.jpg" imageLeftSide="http://123.com.image.jpg" imageLeftSide_tile="http://123.com.image.jpg" imageBottomSide="http://123.com.image.jpg" imageBottomSide="http://123.com.image.jpg" imageBottomSide_Tile="http://123.com.image.jpg" imageBackground_tile="http://123.com.image.jpg"
Description of usage Horizontal position of loading icon Vertical position of loading icon Width of animated loading icon Height of animated loading icon
Miscellaneous attributes
Attribute showDefaultInfo sliding rowCount columnCount columnPerPage centerXPC centerYPC cornerRounding fontSize bottomYPC infoYPC backgroundColor mainPartColor viewAreaWidthPC Allowed Values "yes" / "no" "yes" / "no" 0 to ? 0 to ? 0 to ? 0 to 100 0 to 100 "yes" / "no" ? 0 to 100 0 to 100 RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx 0 to 100 Description of usage Should default information be shown? Sliding items (yes) or static (no)? Example Value showDefaultInfo="yes" sliding="no"
How many rows of items should be displayed rowCount="1" How many columns of items should be shown? columnCount="5" Number of columns per page columnPerPage="3" proportional horizontal position of center proportional vertical position of center Turn on rounding of object corners What size font should be used for display? Proportion of display allocated to 'bottom' (footer) Proportion of display allocated to 'info' Colour assigned to main display background Colour of main area Proportion of view area width centerXPC="50" centerYPC="50" cornerRounding="yes" fontSize="15" bottomYPC="10" infoYPC="85" backgroundColor="0:0:0" mainPartColor="0:0:0" viewAreaWidthPC="70"
Note: You can easily create your own custom loading icon in jpg or png format by simply uploading the images or storing locally in your scripts directory for example and referencing them in your rss as above or by replacing the original icons above with your own - I would suggest the first route is both easier and safer for novices.
ImageSample:
Value (returned string of currentUserInput()) Value (returned string of currentUserInput() on prodigy) GUIDE 1 2 3 4 video_search (not supported) setup 8 (not supported) DISPLAY 0 RET U TODO!! one two three four five six seven eight TVOUT display zero return up down left right TODO!! TODO!! TODO!!
Down (arrow) D Left (arrow) L Right (arrow) R Enter PGUP PGDN ENTR PU PD
prodigy-3d-keyboard-rss-mappings (http://forum.xtreamer.net/topic/27656-prodigy-3d-keyboard-rss-mappings/) Implementation sample to support Xtreamer family (MK1, Pro,... and SW2, prodigy)
userInput = currentUserInput(); if ( userInput == "video_search" || userInput == "five" || userInput == "option_blue" ) ... } if ( userInput == "1" || userInput == "one" || userInput == "option_red" ) { ... } if ( userInput == "3" || userInput == "three" || userInput == "option_yellow" ) { ... } if ( userInput == "4" || userInput == "four" ) { ... } if ( userInput == "8" || userInput == "eight" ) { ... } if ( userInput == "D" || userInput == "down" ) { ... } if ( userInput == "U" || userInput == "up" ) { ... }
description
example
getUserInput()
getInput
currentUserInput
postMessage
setRefreshTime getURL getCSVFromURL getItemInfo getPageInfo getQueryItemIndex getQueryMenuIndex() getFocusItemIndex() / getFocusMenuIndex() setFocusMenuIndex(idx) getSelectedItemIndex fetch the state of the item which is be Drawing. getDrawingItemState Item's state,such as: "focus" "unfocus" "inactive"
<script> state_string = getDrawingItemState(); </script>
fetch the index (idx) of the item/munu which is in focus set item index (idx) of the menu which should be in Focus
setFocusMenuIndex(0);
getItemInfoArray catStringArray getStringArrayAt( Array, index get the text of specific element from array( ); that has "\n" as delimiter )
idArray = null; idArray = pushBackStringArray(idArray, "1"); idArray = pushBackStringArray(idArray, "2"); the idArray will contain "1\n2\n". Use getStringArrayAt(idArray, 1); will return 2.
Return value is the new StringArray. If index = -1 mean current item index. Default value is -1.
If xml contain: getXMLText ( "element1", element1_count, "element2", element2_count,"element3", element3_count, ... ) get the text of specific element from global xml dom object
<element1> <element2> <element3>Hello ! </element3> </element2> parameter = name string of specific element <element2> <element3>Hello world !</element3> </element2> <element1>
getXMLText will return content = "Hello world!" NOTE: getXMLText("element1", "element2", is the same as getXMLText("element1", 0, "element2", ...) 0 is the default element index! get the attribute of a specific element from getXMLAttribute("element1", global xml dom object. "element2", "attribute"); The last parameter is the attribute element.
If rss contain:
<element1> <element2 url="url 1" /> <element2 url="url 2" /> <element2 url="url 3" /> </element1>
getXMLAttribute will return attribute = "url 2" pushBackStringArray ( stringArray, stringElement ) getURLforStock selectMenu executeScript jumpToLink setItemFocus writeStringToFile playItemURL playAtTime getPlaybackStatus getCachedStreamDataSize setVoutDisplay GetScreenSaverStatus SetScreenSaverStatus isInternalHDDExist updatePlaybackProgress readStringFromFile getStoragePath drawImageOnScreen drawImage urlEncode menuCmd deleteItem setFocusItemIndex setFocusMenuIndex showIdle() show the idle image
showIdle();
Function append an stringElement to the end of an existing string array, A stringArray is a see getStringArrayAt for sample. text string separated with \n.
cancelIdle()
dlok = loadXMLFile(topUrl); if (dlok != null) print("success"); else { print("Download xml file fail: ", currentUrl); cancelIdle(); }
totalItems = getXMLText("video", "totalResults"); if xmlfile has the following structure totalItems should be 2. <video> <totalResults>2</totalResults> </video>
itemsPerPage = getXMLText("video", "itemsPerPage"); if xmlfile has the following structure itemsPerPage should be 45. <video> <itemsPerPage>45</itemsPerPage> </video>
count = 3; title = getXMLText("video","item", count, "title"); if xmlfile has the following structure title should be "Title 4", because count start with 0, title of item0 = "Title 1". <video> <item> <title>Title 1</title> </item> <item> <title>Title 2</title> </item> <item> <title>Title 3</title> </item> <item> <title>Title 4</title> </item> <item> <title>Title 5</title> </item> </video>
titleArray = pushBackStringArray(titleArray, title); example: titleArray = pushBackStringArray(titleArray, "Title 1"); titleArray = pushBackStringArray(titleArray, "Title 2"); titleArray = pushBackStringArray(titleArray, "Title 3"); titleArray = pushBackStringArray(titleArray, "Title 4"); titleArray has the following content: "Title 1\nTitle 2\nTitle 3\nTitle 4\n"
AP Functions / classes
VideoPlaybackAP VideoPlaybackSearchMenu VideoPlaybackSubTitleMenu VideoPlaybackSubTitleMenu ScreenSaverAP HDDEditingChoiceAP RootAP - Calls main.cpp - aka initial root app call (Alias TV) GBrowserAP FileCopyAP - Calls the file manager UI (Alias FileCopy) PopupMenuAP - Calls the popup display of text cached in /proc/sys/vm/drop_caches
APs are given some aliases and the actual functions to call are named differently in various Relatek media players. Each class represents a differing .cpp file entry. TODO - Seperate section for AP calls detailing all of the entries and the implementation of the arrays and title arrays (include aliases such as TV etc..) also the interaction with DVDPlayer specified more clearly and the functionality of the database interaction with the core modules.
Item Templates
Item templates <item_template> are used to define a framework for on the fly additions to temporary RSS feeds used for a variety of reasons (Such as dynamic search results). There is scope for development of this area....
<rss> <item_template> <displayTitle> <script> getStringArrayAt(titleArray , -1); </script> </displayTitle> <media:thumbnail>
<script> url = getStringArrayAt(thumbnailArray , -1); print("thumbnail:"); print(url); url; </script> </media:thumbnail> <playURL> <script> url = "http://URL_folder" + getStringArrayAt(fileArray , -1); print("playURL:"); print(url); url = getXMLText("video","durl","url"); print("real playURL:"); print(url); url; </script> </playURL> <media:content type="image/video" /> <onClick> print("onClick"); </onClick> </item_template> <channel> <title>Sina Film</title> <link>http://127.0.0.1/media/sda1/scripts_local/sina_dp.rss</link> <media:thumbnail url="image/logoTVGuide.gif" width="120" height="90" /> <itemSize> <script> itemSize; </script> </itemSize> </channel> </rss>
null; pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); null; pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg"); pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg"); pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg");
= = = =
<mediaDisplay name="photoView" width="200" fontSize="" rowCount="2" columnCount="7" menuBorderColor="20:20:20" menuOffsetYPC="8" menuOffsetXPC="8" menuWidthPC="100" rollItems="yes" sideColorBottom="0:0:0" sideColorTop="0:0:0" sideColorLeft="0:0:0" sideColorRight="0:0:0" itemImageXPC="10" itemImageYPC="0" itemOffsetXPC="7" itemOffsetYPC="20" backgroundColor="0:0:0" itemBorderColor="0:255:180" itemCornerRounding="yes" sliding="yes" idleImageXPC="45" idleImageYPC="42" idleImageWidthPC="7" idleImageHeightPC="16" > <idleImage> image/POPUP_LOADING_01.jpg </idleImage> <idleImage> image/POPUP_LOADING_02.jpg </idleImage> <idleImage> image/POPUP_LOADING_03.jpg </idleImage> <idleImage> image/POPUP_LOADING_04.jpg </idleImage> <idleImage> image/POPUP_LOADING_05.jpg </idleImage> <idleImage> image/POPUP_LOADING_06.jpg </idleImage> <backgroundDisplay> <image redraw="yes" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100"> <script> getStringArrayAt(bgArray , -1); </script> </image> </backgroundDisplay> <itemDisplay> <image redraw="yes" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100"> <script> getStringArrayAt(imgArray , -1); </script> </image> </itemDisplay> </mediaDisplay> <item_template> <displayTitle> <script> getStringArrayAt(titleArray , -1);
</script> </displayTitle> <link> <script> getStringArrayAt(linkArray , -1); </script> </link> </item_template> <channel> <title>TEST</title> <link>test.rss</link> <media:thumbnail url="./image/moviewall.jpg" width="120" height="90" /> <itemSize> <script> 3; </script> </itemSize> </channel> </rss>
Credits
Special thanks go to the following in no particular order for their contributions to the Xtreamer RSS scene: CaP Nedstar Exe Vonck XenDE Rafal123 Csb SS - Thx for photos :) Tweakradje Welph Conkast Xdreamer Mrs. CaP (For having the patience of a saint :)) Xtreamer staff - For listening to us all Retrieved from "http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_RSS_Guide" This page was last modified on 7 April 2012, at 20:54.