Last
update:
This
information is for v2.3.2+.
Older information for v2.3.0
and v2.3.1 here.
Overview
This
document is something for theme creators, advanced users and
developers.
The document has these sections:
- Screen
-
Example Screens
- $TAG aka
GUI TAG
- $TAG properties
- $TEXT
/ $LIST tags
- Commands (cmdNAME)
|
Abbreviation |
Definition |
|---|---|
|
themeimage |
$TAGs of type $BUTTON, $IMAGE, $CHILDIMAGE, $BACKGROUND |
|
themetext |
$TAGs of type $LIST, $TEXT |
|
$TAG |
|
|
|
|
|
|
|
x
: Available
(x) : Will be available, but this is not done yet.
Could be that something is missing from the code.
(x?) : Not
available, but could be. For some reason (e.g. lazy coder)
functionality is missing in MokCC.strikethrough :
Not available and most probaply will not ever be.
italic:
Unfinished text, a note, something the writer just left
there.
Screen
Each
screen is defined in a file. Each file has three parts: DEFAULT,
ELEMENTS and SCREEN. From these only the screen section is mandatory.
Each section starts with <SECTION NAME> and ends in </SECTION
NAME> (notice the slash '/').
You can build everything in
to one file if you prefer. Just remember to have unique names for the
screens.
|
Section |
Description |
|---|---|
|
SCREEN |
This
section defines the elements to print and their coordinates. The
elements are printed in the order defined. X and Y define the
coordinate on screen and ID is the element name. |
|
DEFAULT |
This
section defines the default settings to use. Each element has a
set of settings which can be used. If nothing is specified, the
settings in DEFAULT are used. If DEFAULT is not
defined, predefined (<------- Link to predef values------)
values will be used. |
|
ELEMENT |
This
section defines the element and it's properties. The properties
defined here will override settings in <DEFAULT> for this
element. |
|
Screen definitions |
Description |
|---|---|
|
X |
The coordinates on the screen where the element is to be drawn. The coordinate can be a strict value or a relative value beginning with +/- signs. X="100" |
|
ID |
The
identification of the element. The rest of the information is read
from the element definition. |
Example screens
|
LCD screen |
XML file contents |
|---|---|
|
<DEFAULT> <MP3_SELECT> |
$TAG aka GUI tags
$TAGs are set in to VALUE property in element.
|
LCD |
TV |
Description |
|
|---|---|---|---|
|
VALUE |
x |
x |
(string)
The $TAG for the element. This is the main property that
all $TAGs must have. Depending on the use, you should
choose a proper value for it. |
Each
$TAG has a set of properties that can be used to define how it looks
or behaves on screen. Below is a table that (hopefully) clarifies the
dependencies.
|
Property / $TAG |
$BACKGROUND |
$BUTTON |
$CHILDIMAGE |
$IMAGE |
$LIST |
$TEXT |
|
ACTION |
- |
x |
- |
- |
x |
- |
|
ALIGN |
- |
x |
? |
? |
? |
x |
|
ALIGNVERTICAL |
top |
x |
top |
top |
top |
x |
|
ATTR |
- |
- |
- |
- |
only LCD |
only LCD |
|
BUTTONACTIVE |
- |
x |
- |
- |
- |
- |
|
BUTTONDISABLED |
- |
x |
- |
- |
- |
- |
|
BUTTONDOWN |
- |
x |
- |
- |
- |
- |
|
BUTTONUP |
- |
x |
- |
- |
- |
- |
|
CAPTION |
- |
x |
- |
- |
- |
x |
|
CAPTIONOFFSETX |
- |
x |
- |
? |
- |
- |
|
CAPTIONOFFSETY |
- |
x |
- |
? |
- |
- |
|
CHILDIMAGE |
- |
x |
- |
x |
- |
- |
|
FILENAME |
x |
x |
x |
x |
- |
- |
|
FONTBOLD |
- |
x |
- |
- |
x |
x |
|
FONTCOLOR |
- |
x |
- |
- |
x |
x |
|
FONTCOLORACTIVE |
- |
x |
- |
- |
? |
x |
|
FONTNAME |
- |
x |
- |
- |
x |
x |
|
FONTSIZE |
- |
x |
- |
- |
x |
x |
|
HEIGHT |
x |
x |
x |
x |
x |
x |
|
LISTHIGHLIGHT |
- |
- |
- |
- |
x |
- |
|
LISTMODE |
- |
- |
- |
- |
x |
- |
|
MASK |
- |
x |
x |
x |
- |
- |
|
MASKCOLOR |
- |
x |
x |
x |
- |
- |
|
NAUGHTYBIT |
? |
x |
x |
x |
- |
- |
|
TABDOWN |
- |
x |
- |
- |
- |
- |
|
TABINDEX |
- |
x |
- |
- |
- |
- |
|
TABLEFT |
- |
x |
- |
- |
- |
- |
|
TABRIGHT |
- |
x |
- |
- |
- |
- |
|
TABUP |
- |
x |
- |
- |
- |
- |
|
TOOLTIP |
|
x |
|
|
|
|
|
VALUE |
x |
x |
x |
x |
x |
x |
|
WIDTH |
x |
x |
x |
x |
x |
x |
|
WRAP |
|
|
|
|
|
x |
$TAG properties
In
addition to basic properties, certain $TAGs
($BACKGROUND, $IMAGE
and $BUTTON) have extra values. Notice
that some of the properties are only supported in TV mode, some in
LCD mode.
Abbreviations
x : Supported.
- : Not
supported.
|
LCD |
TV |
Description |
|
|---|---|---|---|
|
CAPTION |
x |
x |
Text to be
printed. Can also include one (or more) $TEXT/$LIST
tag with or without additional text. |
|
FONTSIZE |
x |
x |
(integer)
Size of the font. |
|
FONTNAME |
- |
x |
Name
of the font. |
|
FONTBOLD |
- |
x |
(boolean)
Defines if text printed will be in bold style. This works
both for $TEXT and $LIST |
|
FONTCOLOR |
- |
x |
(integer)
The color of the font. Color is defined in RGB and can be either
decimal or hex. |
|
WIDTH |
x |
x |
(integer)
Width of the area where to print. |
|
HEIGHT |
x |
x |
(integer)
Height of the area where to print. |
|
ATTR |
x |
- |
(attrtype)
The attribute to use when printing characters to screen. |
|
ALIGN |
x |
x |
(aligntype) Horizontal alignment of $TAG. LCD: |
|
ALIGNVERTICAL |
- |
x |
(aligntype) Vertical alignment of $TAG. Allowed values are TOP, BOTTOM, CENTER. Elem
........ T B C X =
supported. |
|
LISTMODE |
x |
x |
Defines
what is to be printed on the list. The value can be plain text
with or without $TEXT
/ $LIST tags. |
|
LISTHIGHLIGHT |
x |
x |
Defines
how the line in the middle of the list is represented. |
|
LISTROWCOUNT |
- |
x |
(integer)
How many rows to show on screen. |
|
LISTROWSELECT |
- |
x |
(integer)
Which line to use as the row for selection. |
|
NAUGHTYBIT |
- |
x |
(boolean)
Sets the 'parental advisory' bit of an element. If the user so
decides, he/she can set the naughty bits -stuff off somewhere
(where?) so the screen does not display anything which has
NAUGHTYBIT set. This allows screens/skins have content, that can
be generally switched off when so
desired. |
|
LCD |
TV |
Description |
|
|
FILENAME |
x |
x |
(filename)
The filename where the graphics are to be loaded from. If path is
not defined, the default is pics-directory under the theme
(themename\pics). |
|
MASK |
- |
x |
(boolean)
Whether a mask is used when showing themeimage. The color
used as the transparent color is set in MASKCOLOR. Do note
that this works best with .bmp files. |
|
MASKCOLOR |
- |
x |
(integer)
The color used for masking. Anything in a picture with this color
will be transparent. Color is defined in RGB and can be either
decimal or hex. |
|
$BUTTON (only) |
LCD |
TV |
Description |
|
- |
x |
(string) What this element (button) should do when pressed. Values are separated with | (pipe). ACTION=”cmdSOMETHING”
or |
|
|
BUTTONACTIVE |
- |
x |
(filename)
$BUTTON element highlight
graphics |
|
BUTTONUP |
- |
x |
(filename)
$BUTTON element normal graphics
|
|
BUTTONDOWN |
- |
x |
(filename)
$BUTTON element when pressed down graphics
|
|
BUTTONDISABLED |
- |
x |
(filename)
$BUTTON element disabled
graphics |
|
CAPTIONOFFSETX |
- |
x |
(integer)
X/Y-offset where CAPTION is printed from $BUTTON
elements X/Y-coordinate. |
|
FONTCOLORACTIVE |
- |
x |
(integer)
CAPTION is printed with this color when $BUTTON is
active. Color is defined in RGB and can be either decimal or
hex. |
|
CHILDIMAGE |
- |
x |
(element)
On-screen graphics we want to change depending on the active
button. The value you set is the childimage
element. |
|
TOOLTIP |
- |
x |
(string)
When an element is active, a tooltip can be shown to
user. |
|
TABINDEX |
- |
x |
(integer)
The number of tab in a button. This value is used in TAB___
properties. |
|
TABLEFT |
- |
x |
(integer)
Used to determine which element to go to when pressing
left/right/up/down. |
$TEXT / $LIST tags
The properties below can be used with both $TEXT and $LIST.
|
$TEXT / $LIST properties |
LCD |
TV |
MP3 |
DVD |
MOV |
CD |
Description |
|---|---|---|---|---|---|---|---|
|
$ALBUM |
x |
|
x |
x |
x |
x |
The
name of the current album. |
|
$ARTIST |
x |
|
x |
x |
x |
x |
The artist/director information for the current item |
|
$ASPECT |
x |
|
|
x |
(x) |
|
Aspect ratio for the movie (4:3, 16:9) |
|
$BITRATE |
x |
|
x |
(x?) |
(x?) |
(x?) |
Bitrate
of the current audio stream. |
|
$CHAPTER |
x |
|
x |
x |
|
x |
DVD:
The number of the chapter played on DVD. |
|
$CHAPTERAMOUNT |
x |
|
x |
(x) |
|
x |
The
total amount of chapters on DVD. |
|
$CLOCK |
x |
|
x |
x |
x |
x |
The
current time in format 'hh:mm'. |
|
$CODING |
x |
|
|
x |
(x?) |
|
The
coding used for the movie. |
|
$FRAMERATE |
x |
|
|
(x) |
x |
|
The framerate of the movie. On DVD this is constant (PAL=25, NTSC=30) |
|
$LISTLEN |
x |
|
x |
x |
x |
x |
Length of list (1-n) |
|
$LISTPOS |
x |
|
x |
x |
x |
x |
Current position on the list (1-n) |
|
$REGION |
x |
|
|
x |
|
|
The region on DVD |
|
$RESOLUTION |
x |
|
|
x |
x |
|
XXX x YYY as pixels. |
|
$SAMPLERATE |
x |
|
x |
(x?) |
(x?) |
(x?) |
Samplerate
of the current audio stream |
|
$SONG |
x |
|
x |
|
|
x |
The name of the current song. |
|
$STANDARD |
x |
|
|
x |
|
|
The television standard on DVD (PAL, NTSC) |
|
$TIMEALBUMCURRENT |
x |
|
(x?) |
|
|
x |
The
time played the current album. |
|
$TIMEALBUMTOTAL |
x |
|
(x?) |
|
|
x |
The
total time of the current album. |
|
$TIMECURRENT |
x |
|
x |
x |
x |
x |
Time of currently played item. Format 'mm:ss' and if time is longer than 59 minutes, the format is 'hh:mm:ss'. |
|
$TIMELEFT |
x |
|
x |
x |
x |
x |
The time to play the currently played item. Format 'mm:ss' and if time is longer than 59 minutes, the format is 'hh:mm:ss'. |
|
$TIMEPERCENT |
x |
|
x |
x |
x |
x |
Time played vs time total (0-100). |
|
$TIMETOTAL |
x |
|
x |
x |
x |
x |
Total time of the currently played item. Format 'mm:ss' and if time is longer than 59 minutes, the format is 'hh:mm:ss'. |
Commands (cmdNAME)
All
commands are sent from module to core with SendCmd:
procedure
SendCmd(cmd:TCmd; val: integer;
modName:String);
sendCmd(cmdMP3SELECT,0,'MP3|xml_all.txt|<SELECTMP3>');
If
developers do not want to parse for example cmd and modName, you can
always use cmdUNPARSED where you let MokCC take care of all
parsing.
procedure SendCmd(cmdUNPARSED; val: integer;
cmd|modName:String);
sendCmd(cmdUNPARSED,0,'cmdMP3SELECT|MP3|xml_all.txt|<SELECTMP3>');
In
themes the commands are sent with buttons. In them, an ACTION
is defined.
ACTION=”cmdMP3SELECT|MP3|xml_all.txt|<SELECTMP3>”
|
Abbreviation |
Definition |
|---|---|
|
sectionname |
Section in mok.ini (eg. [MP3]). If this is left away, the previously used page is used again. |
|
state |
<tbd> |
|
xmlpage |
The xml page file to use when running current state. Paired always with <SCREEN>. If this is left away, the previously used page is used again. |
|
<SCREEN> |
The screen section (found in the xml page file) to use when running current state. Paired always with xmlpage. |
|
Tcmd (cmdNAME) |
Description |
|
cmdNONE |
Does nothing. |
|
cmdMP3SELECT |
A
selection screen state is activated. This will do normal scan
and create a playlist of found songs* to play. |
|
cmdMP3 |
MokCC
starts playing MP3 music, movie or CD audio disk. The first
song* found from the path specified in mok.ini's
sectionname. |
|
cmdSTOP |
Current
action is stopped and we return to previous state. |
|
cmdSCREENSAVER |
MokCC
activates screensaver state. Any keypress will return back to
the previous state. Use only from mainmenu state. The screensaver
name is always module specific so be careful when assigning this.
All modules should have a default screensaver (eg. empty screen)
which is run during screensaver state. |
|
cmdSHUTDOWN |
Forces
a powerdown (& shutdown) for Windows. Any unsaved data
will be lost. |
|
cmdCLOSEMOKCC |
Closes
MokCC nicely and returns to Windows. |
|
cmdERRORDONE |
Sends
an acknowledge that the error was read. In normal usage MokCC
will show the error for 10 seconds (10*cycletime) and return to
previous state. With this, the user can acknowledge the error and
return from the error. |
|
cmdTHIRDPARTY |
A
third party program is started by MokCC. When the started
program is stopped, MokCC will return to previous state. You can
send cmdSTOP or press kSTOP to close the program and return to
previous state. Note that any unsaved data will cause a popup
that you can not close with Mok. All
application handling is done by MokCC. State will change to
gui_thirdparty. |
|
cmdKEY |
Sends
a keypress from module to MokCC. This is handled as a normal
keypress, similar to a key sent from a remote controller. This
will override key sent via external parties (eg. remote
controller software Girder). |
|
cmdPAGE |
Activates
another page to browse. When you're creating your theme, you
want to create subpages for the users to enter. In these cases
cmdPAGE is to be used. |
|
cmdUNPARSED |
Sends
a command and leaves parsing to MokCC. This is here to make
it easier for GUI developers to send commands. You don't need to
do parsing for the ACTION line - just send it. |
|
cmdHTTPGET |
File
is loaded from internet by MokCC. It is possible to send
multiple cmdHTTPGET at once to load a larger amount of files.
MokCC will load them 'as fast as possible' and eventually the
file is ready. The only way to see if the file is ready, is to
poll for the existence of the file. NOTE
that you cannot use quotes in the fileurl definition; replace
them with text <QUOT> |
|
cmdCYCLETIME |
Set
MokCC cycletime. MokCC has a default (1000ms) cycletime when
it calls dll's to update lists and other information. When
returning to a previous state with either kSTOP or cmdSTOP,
cycletime will be reset back to the default value. |