Last update:
NOTE:
Information on this page is only valid for v2.3.0. Latest version can
be found 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)
Abbreviations
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 either a predefined tag
($TAG) or an element. |
|
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. |
|
ONCE |
ONCE
section is a section that is drawn once in the beginning. The
parts mentioned won't be updated anymore and should not contain
any data that changes. The idea is to optimize screenupdating.
This is good for drawing windows frames, background pictures and
other static things. <ONCE> |
|
LCD screen |
XML file contents |
|---|---|
|
<DEFAULT> <MP3_SELECT> |
$Tags are set in to VALUE property in element.
|
VALUE TAG |
LCD |
TV |
MP3 |
DVD |
MOV |
CD |
Description |
|---|---|---|---|---|---|---|---|
|
$BACKGROUND |
- |
x |
- |
- |
- |
- |
(gfx) The background image of the current theme |
|
$BUTTON |
|
|
|
|
|
|
(---) A button on screen |
|
$IMAGE |
|
|
|
|
|
|
(gfx) Draws an image to the screen. |
|
$LIST |
x |
|
x |
x |
x |
x |
The
list with the $ARTIST/$SONG/$ALBUM information. Use listmode
to select what to print. |
|
$CHILDIMAGE |
|
x |
|
|
|
|
(---) |
|
$TEXT |
x |
|
|
|
|
|
(string) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In addition to basic properties, certain $TAGs ($BACKGROUND, $IMAGE and $BUTTON) have extra values.
|
LCD |
TV |
Description |
|
|---|---|---|---|
|
VALUE |
x |
x |
(string)
The $TAG for the element |
|
CAPTION |
x |
x |
(string)
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 |
(string)
Name of the font. |
|
FONTBOLD |
- |
x |
(boolean)
Defines is text or caption is to be printed in bold
style |
|
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 current TAG |
|
ATTR |
x |
- |
(string
- attrtype) The attribute to use when printing characters to
screen. |
|
ALIGN |
x |
x |
(string - aligntype) Horizontal alignment of $TAG or text. LCD: |
|
ALIGNVERTICAL |
- |
x |
(string - aligntype) Vertical alignment of $TAG. Allowed values are TOP, BOTTOM, CENTER. TV: X =
supported. |
|
LISTMODE |
x |
x |
(string)
Defines what is to be printed on the list. The value can be plaing
text with or without $TAG string
types. |
|
LISTHIGHLIGHT |
x |
x |
(string
- attrtype) 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)
Y or N. 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 |
(string)
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 $IMAGE or $BUTTON.
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
ACTION=”third|”
ACTION="page|” ACTION="page|xml_weather.txt" |
|
|
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 |
(--) On-screen graphics we want to change depending on the active button. |
|
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. |
A
table that hopefully clarifies the dependencies.
|
|
$BACKGROUND |
$BUTTON |
$CHILDIMAGE |
$CLOCK |
$IMAGE |
$LIST |
$TEXT |
|
ACTION |
- |
x |
- |
- |
- |
- |
- |
|
ALIGN |
- |
x |
? |
? |
? |
? |
x |
|
ALIGNVERTICAL |
top |
x |
top |
? |
top |
top |
x |
|
ATTR |
- |
- |
- |
only LCD |
- |
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 |
- |
- |
|
FONTBOLD |
- |
x |
- |
x |
- |
x |
x |
|
FONTCOLOR |
- |
x |
- |
x |
- |
x |
x |
|
FONTCOLORACTIVE |
- |
x |
- |
x |
- |
? |
x |
|
FONTNAME |
- |
x |
- |
x |
- |
x |
x |
|
FONTSIZE |
- |
x |
- |
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 |
x |
|
WIDTH |
x |
x |
x |
x |
x |
x |
x |
The properties below can be used with both $TEXT tag and $LIST tag.
|
$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'. |
All
commands are sent from module to core with SendCmd:
procedure
SendCmd(cmd:TCmd; val: integer;
modName:String);
Abbreviations:
sectionname: Section in
mok.ini (eg. [MP3]).
state:
|
Tcmd (cmdNAME) |
Description |
|
cmdNONE |
|
|
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 the first song* found from the path specified in
mok.ini's sectionname. |
|
cmdMP3JUKEBOX |
not implemented yet |
|
cmdDVDSELECT |
see: cmdMP3SELECT |
|
cmdDVD |
see: cmdMP3 |
|
cmdMOVIESELECT |
see: cmdMP3SELECT |
|
cmdMOVIE |
see: cmdMP3 |
|
cmdCD |
MokCC
starts playing the CD audio disk inserted. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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). |