Difference between revisions of "Miscellaneous Functions"

From JRiverWiki
Jump to: navigation, search
m (Fixing a typo in a sample expression.)
(20 intermediate revisions by 2 users not shown)
Line 89: Line 89:
 
<div style="text-align:right;">([[#top|Back to top)]]</div>
 
<div style="text-align:right;">([[#top|Back to top)]]</div>
  
=== <span id="Counter">Counter(&hellip;)</span> ===
+
=== <span id="Char">Char(&hellip;)</span> ===
: Counts upwards in specified increments.
+
: Returns a character from the numeric code of that character
  
{| style="width: 100%; border-spacing: 0; border: 0px solid black;" align="top" cellpadding="3" cellspacing="0"
+
{{function description box
|- id="Counter" valign="top"
+
| name=Char
! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 2px 1px 0 2px; border-right: 1px solid #bbb;" width="100" | Description
+
| arguments=Numeric Number Code
| style="background: #f9f9f9; color: #111; border-style: solid; border-width: 2px 2px 0 0" width="1200" | <span style="font-family: monospace,monospace; font-size:1em; color:#0f3f8d; font-size:110%"><b>counter(</b><i>start value</i><b>, </b><i>increment</i><b>)</b></span>
+
| description=
The [[#Counter|Counter()]] function outputs a monotonically increasing number (more simply stated, it counts) from a <i>start value</i>,
+
[[#Char|Char()]] has unicode support, however, only decimal values are supported. If you require a Hex to Decimal convertor, try [https://unicode-search.net/ unicode-search.net], or search for an alternative online.
and each time called, increases by the <i>increment</i> value.
 
It is useful for sequentially numbering fields.
 
The [[#Counter|Counter()]] function maintains an internal counter, and it resets itself to zero after five seconds of inactivity.
 
  
Because [[#Counter|Counter()]] continues to count, it should only be used in single-use situations such as assigning its output to some field through field value assignment, for example, <span style="font-family: monospace,monospace; font-size:1em;">=counter()</span>.
+
| examples=
With proper care, it can be used as part of an expression in the Rename, Move & Copy tool, but see also [[#CustomData|CustomData()]].
+
'''{{monospace|Char(189)}}'''
 
+
: Returns ½
It is not recommended for use in any context that continually refreshes its content, such as in a panes column, file list, or expression-based custom query.
+
'''{{monospace|Char(9679)}}'''
Probably the best way to understand the results is to test the first example below as an expression column in a file list, and move the mouse around over that column.
+
: Returns ●
 
+
}}
Argument <i>start value</i> is optional (defaults to 1).
 
 
 
Argument <i>increment</i> is optional (defaults to 1).
 
 
 
|- valign="top"
 
! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 0px 1px 2px 2px; border-top: 1px solid #bbb; border-right: 1px solid #bbb;" | Examples
 
|style="background: #f9f9f9; color: #111; border-style: solid; border-width: 0px 2px 2px 0; border-top: 1px solid #bbb;" | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>counter()</nowiki></b></span>
 
<p style="margin-left:20pt;">Outputs values starting at <span style="font-family: monospace,monospace; font-size:1em;">1</span>, and incrementing by one, it will return <span style="font-family: monospace,monospace; font-size:1em;">1</span>, <span style="font-family: monospace,monospace; font-size:1em;">2</span>, <span style="font-family: monospace,monospace; font-size:1em;">3</span>, ... until no longer called.
 
This might be used, for example, to assign to the [Track #] field of several tracks using the field assignment expression <span style="font-family: monospace,monospace; font-size:1em;">=counter()</span>.</p>
 
<span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>padnumber(counter(370, 2), 4)</nowiki></b></span>
 
<p style="margin-left:20pt;">Outputs numbers beginning from 370, incremented by two each, and padded to four digits.  For example, <span style="font-family: monospace,monospace; font-size:1em;">0370</span>, <span style="font-family: monospace,monospace; font-size:1em;">0372</span>, <span style="font-family: monospace,monospace; font-size:1em;">0374</span>, etc.</p>
 
|}
 
<div style="text-align:right;">([[#top|Back to top)]]</div>
 
  
 
=== <span id="CustomData">CustomData(&hellip;)</span> ===
 
=== <span id="CustomData">CustomData(&hellip;)</span> ===
Line 158: Line 142:
 
<p style="margin-left:20pt;">In and of itself, you might think that this is not 'all that', however, remember that we can combine this with other functions, thus giving us the ability to create expressions with playlist rules. A simple example would be:</p>
 
<p style="margin-left:20pt;">In and of itself, you might think that this is not 'all that', however, remember that we can combine this with other functions, thus giving us the ability to create expressions with playlist rules. A simple example would be:</p>
 
<span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>[=IsEqual(fileplaylists(),genre,8)]=1</nowiki></b></span>
 
<span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>[=IsEqual(fileplaylists(),genre,8)]=1</nowiki></b></span>
<p style="margin-left:20pt;">which when used in the search bar, will return all files that appear on a playlist called 'Genre'</p>
+
<p style="margin-left:20pt;">which when used in the search bar, will return all files that appear on any playlist containing 'Genre' in its name</p>
 
|}
 
|}
 
<div style="text-align:right;">([[#top|Back to top)]]</div>
 
<div style="text-align:right;">([[#top|Back to top)]]</div>
  
=== <span id="Math">Math(&hellip;)</span> ===
+
=== <span id="Literal">Literal(&hellip;)</span> ===
: Evaluates a given mathematical formula.
+
: Returns a string as given without any formatting or processing
 
 
{| style="width: 100%; border-spacing: 0; border: 0px solid black;" align="top" cellpadding="3" cellspacing="0"
 
|- id="Math" valign="top"
 
! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 2px 1px 0 2px; border-right: 1px solid #bbb;" width="100" | Description
 
| style="background: #f9f9f9; color: #111; border-style: solid; border-width: 2px 2px 0 0" width="1200" | <span style="font-family: monospace,monospace; font-size:1em; color:#0f3f8d; font-size:110%"><b>math(</b><i>expression</i><b>)</b></span>
 
The [[#Math|Math()]] function performs mathematical calculations.
 
Standard arithmetic operators are supported, as are various numerical, trigonometric, and comparative functions.
 
Simple variables are supported, as are multiple statements.
 
 
 
<blockquote>
 
{| style="background: #f9f9f9;" border="1" cellpadding="1" cellspacing="0"
 
| rowspan="6" width="100" valign="top" | '''Arithmetic Operators'''
 
| align="center" width="65" | + || Addition
 
|-
 
| align="center" | - || Subtraction
 
|-
 
| align="center" | * || Multiplication
 
|-
 
| align="center" | / || Division
 
|-
 
| align="center" | ^ || Power
 
|-
 
| align="center" | % || Modulo
 
|-
 
| rowspan="3" | '''Boolean Operators'''
 
| align="center" | ! || NOT
 
|-
 
| align="center" | & || AND
 
|-
 
| align="center" | <nowiki>|</nowiki> || OR
 
|-
 
| rowspan="1" | '''Grouping Operators'''
 
| align="center" | ( ) || Precedence grouping
 
|-
 
| rowspan="4" | '''Comparison Operators'''
 
| align="center" | } || Absolute value maximum (i.e. x or y that is maximum distance from 0).
 
|-
 
| align="center" | { || Absolute value minimum (i.e. x or y that is minimum distance from 0).
 
|-
 
| align="center" |  > || Distance between x and y, positive when x greater than y, negative otherwise.
 
|-
 
| align="center" | < || Distance between x and y, positive when x less than y, negative otherwise.
 
|-
 
| rowspan="7" | '''Functions'''
 
| align="center" | abs(x) || Returns the absolute value of x.
 
|-
 
| align="center" | sign(x) || Returns the sign of x (1 when x >= 0, -1 when x < 0).
 
|-
 
| align="center" | log(x) || Returns the natural logarithm (base e) of x.
 
|-
 
| align="center" | log10(x) || Returns the common logarithm (base 10) of x.
 
|-
 
| align="center" | pow(x,y) || Returns x raised to the y-th power.
 
|-
 
| align="center" | rand(x) || Returns a random value ranging between 0 to x.
 
|-
 
| align="center" | randn(x) || Returns a random value ranging between -x and x.
 
|-
 
| rowspan="5" | '''Comparison Functions'''
 
| align="center" | min(x,y) || Returns the minimum value of x and y.
 
|-
 
| align="center" | max(x,y) || Returns the maximum value of x and y.
 
|-
 
| align="center" | equal(x,y) || Returns 1 when x = y, 0 otherwise.
 
|-
 
| align="center" | below(x,y) || Returns 1 when x < y, 0 otherwise.
 
|-
 
| align="center" | above(x,y) || Returns 1 when x > y, 0 otherwise.
 
|-
 
| rowspan="4" | '''Formatting Functions'''
 
| align="center" | int(x) || Returns the integer portion of x.
 
|-
 
| align="center" | frac(x) || Returns the fractional portion of x.
 
|-
 
| align="center" | round(x) || Returns x rounded to the nearest whole number.
 
|-
 
| align="center" | trunc(x,n) || Returns x truncated to n decimal places.
 
|-
 
| rowspan="6" | '''Trigonometric Functions'''
 
| align="center" | atan(x) || Returns the arctangent of x.
 
|-
 
| align="center" | cos(x) || Returns the cosine of x.
 
|-
 
| align="center" | sin(x) || Returns the sine of x.
 
|-
 
| align="center" | tan(x) || Returns the tangent of x.
 
|-
 
| align="center" | abscos(x) || Returns the absolute value of cosine(x).
 
|-
 
| align="center" | abssin(x) || Returns the absolute value of sin(x).
 
|}
 
</blockquote>
 
 
 
The order of operator precedence is summarized as follows, from top to bottom:
 
 
 
<div style="margin-left: 20pt;"><table style="border-spacing:0px; border-collapse:collapse; background: #f9f9f9">
 
<tr><td style="text-align:left; padding-right:20pt"><b>(&nbsp;&nbsp;&nbsp;)</b></td><td>&nbsp;</td></tr>
 
<tr><td style="text-align:left; padding-right:20pt"><b>&nbsp;&nbsp;!</b></td><td>&nbsp;</td></tr>
 
<tr><td style="text-align:left; padding-right:20pt"><b>&nbsp;&nbsp;^</b></td><td>&nbsp;</td></tr>
 
<tr><td style="text-align:left; padding-right:20pt"><b>*&nbsp;&nbsp;&nbsp;/</b></td><td>Left to right</td></tr>
 
<tr><td style="text-align:left; padding-right:20pt"><b>+&nbsp;&nbsp;&nbsp;-</b></td><td>Left to right</td></tr>
 
<tr><td style="text-align:left; padding-right:20pt"><b><nowiki>|</nowiki>&nbsp;&nbsp;&nbsp;&amp;</b></td><td>Left to right</td></tr>
 
</table></div>
 
 
 
Variables may be assigned and used by specifying a simple string of letters. Examples: <span style="font-family: monospace,monospace; font-size:1em;">math(val=2)</span> or <span style="font-family: monospace,monospace; font-size:1em;">math(x=pow(2,3))</span>.
 
  
Multiple equations may be specified, each separated by a semicolon.
+
{{function description box
Expressions are evaluated left to right.
+
| name=Literal
The final value of the [[#Math|Math()]] function will be the result of the right-most equation. For example, the equation <span style="font-family: monospace,monospace; font-size:1em;">math(x=4; pow(2^x))</span> will output 16.
+
| arguments=String
 +
| description=
 +
[[#Literal|Literal()]] returns a given string as-is without any formatting or processing
  
<b>Note</b>: Empty fields
+
| examples=
 +
'''{{monospace|If(IsEqual([Artist], Queen, 1), Literal(If all music was Queen, I would be 10/10ths happy!), Literal(This is not Queen, which makes me sad. :-/))}}'''
 +
: This does not work, with the sad face breaking the expression completely and generating an error. It should work, suggesting that the Literal() function is currently broken.
 +
: This reference will be updated once clarification has been received. In the meantime, as detailed under [[Expression Language#Expression Language Syntax|Expression Language Syntax]], using /* ... /* does work as Literal() is expected to. See next example...
  
Fields used inside of [[#Math|Math()]] are expanded (interpolated) directly.
+
'''{{monospace|/*Left(Theater,3) returns/* Left(Theater,3)}}'''
Fields with empty values may produce incomplete [[#Math|Math()]] statements.
+
: Returns {{monospace|Left(Theater,3) returns The}}. Here, the first expression function is not evaluated and instead, presented as given, whilst the second function, which is not escaped, is evaluated. Escaping text in this way could be useful if working with a large block of text that might contain parenthesis, forward slashes or other characters that would otherwise require to be escaped individually.
For example, if the field [number plays] is empty, an <i>expression</i> such as <span style="font-family: monospace,monospace; font-size:1em;">math([number plays] + 2)</span> would be seen
+
}}
by [[#Math|Math()]] as <span style="font-family: monospace,monospace; font-size:1em;"> + 2</span>.
 
This incomplete <i>expression</i> would produce a syntax error.  See the Additional Examples for more information.
 
  
<b>Note</b>: Locales and Commas
+
=== <span id="Repeat">Repeat(&hellip;)</span> ===
 +
: Repeats a given string a specified number of times
  
Special care must be taken with the [[#Math|Math()]] function and locales that use <span style="font-family: monospace,monospace; font-size:1em;">,</span> (comma) as a decimal separator.
+
{{function description box
Many Media Center fields and the return values from functions may contain comma as the decimal point.
+
| name=Repeat
Your expressions will need to [[#Replace|Replace()]] these before passing the values to [[#Math|Math()]],
+
| arguments=Value, Count
which always uses dot <span style="font-family: monospace,monospace; font-size:1em;">.</span> as the numeric decimal point.
+
| description=
 +
Repeats {{monospace|"Value", "Count"}} number of times.
 +
| examples=
 +
'''{{monospace|<nowiki>Repeat(*,10)</nowiki>}}'''
 +
: Returns **********
  
For example, the <i>expression</i> <span style="font-family: monospace,monospace; font-size:1em;">math(1,5 + 1,5)</span> will fail since [[#Math|Math()]] does not consider <span style="font-family: monospace,monospace; font-size:1em;">1,5</span> to be a valid number.
+
'''{{monospace|<nowiki>Repeat(Ha,5)</nowiki>}}'''
 +
: Returns HaHaHaHaHa
 +
}}
  
Fields that cause problems are any fields that produce floating-point values, such as any Date type field in raw format
+
=== <span id="Row">Row(&hellip;)</span> ===
(e.g. <span style="font-family: monospace,monospace; font-size:1em;">[date,0]</span>, <span style="font-family: monospace,monospace; font-size:1em;">[last played,0]</span>, <span style="font-family: monospace,monospace; font-size:1em;">[date modified,0]</span>, and <span style="font-family: monospace,monospace; font-size:1em;">[date imported,0]</span>), or any textual field that contains
+
: Returns the row number of a list entry
floating-point values that will be used for various calculations (e.g. any of the Dynamic Range variants).
 
Certain functions such as [[#Now|Now()]] and [[#ConvertTime|ConvertTime()]] also return localized floating-point values.
 
  
Handling this problem is not difficult.
+
{{function description box
Before passing any floating point number to [[#Math|Math()]], use [[#Replace|Replace()]] first.  See the examples below.
+
| name=Row
|- valign="top"
+
| arguments=
! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 0px 1px 2px 2px; border-top: 1px solid #bbb; border-right: 1px solid #bbb;" | Examples
+
| description=
|style="background: #f9f9f9; color: #111; border-style: solid; border-width: 0px 2px 2px 0; border-top: 1px solid #bbb;" | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math(10 + 4)</nowiki></b></span>
+
Row() returns the row number for each item in a list.
<p style="margin-left:20pt;">Returns 14.</p>
+
| examples=
<span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math(10 + 2 * 25)</nowiki></b></span>
+
'''{{monospace|<nowiki>Row()</nowiki>}}'''
<p style="margin-left:20pt;">Returns 60, demonstrating that multiplication has higher precedence than addition.</p>
+
: When used as an expression column in a file list, each row is numbered starting at 1, incrementing by 1.
<span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math((10 + 2) * 25)</nowiki></b></span>
 
<p style="margin-left:20pt;">Returns 300, demonstrating that parenthesis grouping has higher precedence than multiplication.</p>
 
<span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math(replace(now(), /,, .) - replace([last played,0], /,, .))</nowiki></b></span>
 
<p style="margin-left:20pt;">The <span style="font-family: monospace,monospace; font-size:1em;">,</span> is replaced by a <span style="font-family: monospace,monospace; font-size:1em;">.</span> in the output of both [[#Now|Now()]] and in the raw field value <span style="font-family: monospace,monospace; font-size:1em;">[last played,0]</span>.
 
Note that the comma must be escaped so that it is seen as an argument and not as an argument separator.</p>
 
<span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>math(replace(now() - [last layed,0], /,, .))</nowiki></b></span>
 
<p style="margin-left:20pt;">The same as the previous example, but is more efficient and simpler since it calls [[#Replace|Replace()]] just once on the entire string to be passed to [[#Math|Math()]].</p>
 
  
Additional Examples
+
}}
 
 
:[http://yabb.jriver.com/interact/index.php?topic=58110.0 An explanation and some solutions for fields that evaluate to empty within Math().]
 
|}
 
<div style="text-align:right;">([[#top|Back to top)]]</div>
 
  
 
=== <span id="Size">Size(&hellip;)</span> ===
 
=== <span id="Size">Size(&hellip;)</span> ===
Line 344: Line 220:
 
<div style="text-align:right;">([[#top|Back to top)]]</div>
 
<div style="text-align:right;">([[#top|Back to top)]]</div>
  
=== <span id="TrackNumber">TrackNumber(&hellip;)</span> ===
+
=== <span id="Translate">Translate(&hellip;)</span> ===
: Returns a file's track # value.
+
: Converts an English string found in the program to the current language selected in the language menu
 +
 
 +
{{function description box
 +
| name=Translate
 +
| arguments=String
 +
| description=
 +
When using Media Center with any language ''other than English'', the Translate() function can be used to translate an English string in the program to the current language.
 +
 
 +
| examples=
 +
'''{{monospace|<nowiki>Translate(Keywords)</nowiki>}}'''
 +
: If using the French language setting, this will return Mots-clés
 +
}}
 +
 
 +
=== <span id="TreeNode">TreeNode(&hellip;)</span> ===
 +
: Returns the selected tree path.
  
{| style="width: 100%; border-spacing: 0; border: 0px solid black;" align="top" cellpadding="3" cellspacing="0"
+
{{function description box
|- id="TrackNumber" valign="top"
+
| name=TreeNode
! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 2px 1px 0 2px; border-right: 1px solid #bbb;" width="100" | Description
+
| arguments=Mode
| style="background: #f9f9f9; color: #111; border-style: solid; border-width: 2px 2px 0 0" width="1200" | <span style="font-family: monospace,monospace; font-size:1em; color:#0f3f8d; font-size:110%"><b>tracknumber(</b><b>)</b></span>
+
| description=
The [[#TrackNumber|TrackNumber()]] function returns a file's track #, or 0 if the no value exists.
+
{{argument optional}}
It is used to populate the Library field <span style="font-family: monospace,monospace; font-size:1em;">track #</span> with its value.
+
{{argument table
Either the field or [[#TrackNumber|TrackNumber()]] can be used.
+
| name=mode
|- valign="top"
+
| contents=
! scope="row" style="background: #ecedf3; color: #111; border-style: solid; border-width: 0px 1px 2px 2px; border-top: 1px solid #bbb; border-right: 1px solid #bbb;" | Examples
+
{{argument table row|0|Returns the full tree path}}
|style="background: #f9f9f9; color: #111; border-style: solid; border-width: 0px 2px 2px 0; border-top: 1px solid #bbb;" | <span style="font-family: monospace,monospace; font-size:1em;"><b><nowiki>tracknumber()</nowiki></b></span>
+
{{argument table row|1|Returns the currently selected tree node}}
<p style="margin-left:20pt;">Returns the value present in the <span style="font-family: monospace,monospace; font-size:1em;">track #</span> field.</p>
+
{{argument table row|2|Returns the parent of the currently selected tree node}}
|}
+
}}
<div style="text-align:right;">([[#top|Back to top)]]</div>
+
 
 +
| examples=
 +
'''{{monospace|<nowiki>TreeNode()</nowiki>}}'''
 +
: Will return the full tree path of the currently selected tree item (Uses mode zero by default)
 +
 
 +
What this function does is self-explanatory. '''[https://yabb.jriver.com/interact/index.php/topic,128134.msg888957.html#msg888957 This conversation]''' on the Interact forums demonstrates a practical use-case scenario.
 +
}}
  
 
=== <span id="TVInfo">TVInfo(&hellip;)</span> ===
 
=== <span id="TVInfo">TVInfo(&hellip;)</span> ===

Revision as of 00:44, 5 June 2021

The functions in this section are varied and have specialized applicability. Some are primarily used internally by MC to generate values available in various Library fields.

AlbumArtist(…)

Returns a file's calculated album artist.
Description albumartist()

The AlbumArtist() function calculates the album artist value used in various views and fields. It is used to populate the Library field album artist (auto) with its value. Either the field or AlbumArtist() can be used.

Examples albumartist()

Returns the value present in the album artist (auto) field.

Additional Examples

Describes the algorithm used by AlbumArtist() to calculate the "album artist (auto)" field's value.

AlbumKey(…)

Returns a unique album key for a file.
Description albumkey()

The AlbumKey() function returns "[album artist (auto)] - [album]". It is a convenience function, used to return the generally unique album / artist combination string used to distinguish between two like-named albums such as "Greatest Hits".

Examples albumkey()

For an album named Greatest Hits and an album artist (auto) of The Eagles, returns The Eagles - Greatest Hits.

AlbumType(…)

Returns the album type for a file.
Description albumtype()

The AlbumType() function returns a description regarding an album's completeness and its quantity of artists. It is used to populate the Library field album type with its value. Either the field or AlbumType() can be used.

Examples albumtype()

Returns, for example, Single artist (complete), or Multiple artists (incomplete).

AudioAnalysisState(…)

Returns the state of audio analysis for a file.
Description audioanalysisstate()

The AudioAnalysisState() function returns a file's state of audio analysis. It can be used to determine if audio analysis (Library Tools > Analyze Audio...) should be performed on a media file. The AudioAnalysisState() function will return a string indicating the state of analysis. Possible values are currently:

NeededAudio analysis is needed
DoneAudio analysis is complete
N/AThe file type does not support audio analysis
Excluded (No Audio)The file type supports analysis, but contains no audio
Failed on <date>Audio analysis failed on the <date> specified
Examples audioanalysisstate()

Returns, for example, Needed for files that require audio analysis, or N/A if the file type does not support audio analysis.

Additional Examples

Describes the improved audio analysis and R128 volume leveling feature.

Char(…)

Returns a character from the numeric code of that character
Description Char(Numeric Number Code)

Char() has unicode support, however, only decimal values are supported. If you require a Hex to Decimal convertor, try unicode-search.net, or search for an alternative online.

Examples Char(189)
Returns ½

Char(9679)

Returns ●

CustomData(…)

Returns internal data to the expression language.
Description customdata(mode)

The CustomData() function supports returning Media Center internal data to the expression language. Currently the only supported mode provides a file's row number in a file list, which is useful in the Rename, Move & Copy tool to assist in numbering files. It can also be used in expressions in a playlist to obtain the file's sequence number.

Available mode values:

#Returns a file's row number in a file list
Examples Spring_Break_Bash_padnumber(customdata(#), 4)

In the Rename, Move & Copy tool, each consecutive file would be named Spring_Break_Bash_ followed by a four digit, zero-padded number starting at 0001.

FilePlaylists()

Returns a list of playlists a file belongs to.
Description FilePlaylists()

This function returns the list of playlists a file is in separated by semi-colons.

Examples FilePlaylists()

Using this will return a list of all the playlists a file is in, separated by semi-colons.

In and of itself, you might think that this is not 'all that', however, remember that we can combine this with other functions, thus giving us the ability to create expressions with playlist rules. A simple example would be:

[=IsEqual(fileplaylists(),genre,8)]=1

which when used in the search bar, will return all files that appear on any playlist containing 'Genre' in its name

Literal(…)

Returns a string as given without any formatting or processing
Description Literal(String)

Literal() returns a given string as-is without any formatting or processing

Examples If(IsEqual([Artist], Queen, 1), Literal(If all music was Queen, I would be 10/10ths happy!), Literal(This is not Queen, which makes me sad. :-/))
This does not work, with the sad face breaking the expression completely and generating an error. It should work, suggesting that the Literal() function is currently broken.
This reference will be updated once clarification has been received. In the meantime, as detailed under Expression Language Syntax, using /* ... /* does work as Literal() is expected to. See next example...

/*Left(Theater,3) returns/* Left(Theater,3)

Returns Left(Theater,3) returns The. Here, the first expression function is not evaluated and instead, presented as given, whilst the second function, which is not escaped, is evaluated. Escaping text in this way could be useful if working with a large block of text that might contain parenthesis, forward slashes or other characters that would otherwise require to be escaped individually.

Repeat(…)

Repeats a given string a specified number of times
Description Repeat(Value, Count)

Repeats "Value", "Count" number of times.

Examples Repeat(*,10)
Returns **********

Repeat(Ha,5)

Returns HaHaHaHaHa

Row(…)

Returns the row number of a list entry
Description Row()

Row() returns the row number for each item in a list.

Examples Row()
When used as an expression column in a file list, each row is numbered starting at 1, incrementing by 1.

Size(…)

Returns a file's size in a format specific to the media type.
Description size()

The Size() function returns media size information specific to the particular media type. It is used to populate the Library fields duration and dimensions with their values. Either the field or Size() can be used.

Type of information reported by size for the file's media type:

AudioDuration
VideoDuration
ImageDimensions
DataNo information returned.
Examples size()

Returns values such as 400x225 for images, or 3:09 for audio files.

Translate(…)

Converts an English string found in the program to the current language selected in the language menu
Description Translate(String)

When using Media Center with any language other than English, the Translate() function can be used to translate an English string in the program to the current language.

Examples Translate(Keywords)
If using the French language setting, this will return Mots-clés

TreeNode(…)

Returns the selected tree path.
Description TreeNode(Mode)
  • Argument mode is optional (defaults to 0).

Available mode values:

0Returns the full tree path
1Returns the currently selected tree node
2Returns the parent of the currently selected tree node
Examples TreeNode()
Will return the full tree path of the currently selected tree item (Uses mode zero by default)

What this function does is self-explanatory. This conversation on the Interact forums demonstrates a practical use-case scenario.

TVInfo(…)

Miscellaneous television and other pre-formatted information.
Description tvinfo(type)

The TVInfo() function is multi-purpose, and returns a specific type of information about television recordings, programs, and pre-formatted informational strings for use in captions, thumbnails, grouping, etc.

Available type values:

IsProgramReturns 1 if the file is a program, 0 otherwise
IsGuideProgramReturns 1 if the file is a guide program, 0 otherwise
IsRecordedProgramReturns 1 if the file is a recorded program, 0 otherwise
IsTVChannelReturns 1 if the selection is a TV Channel program
ChannelReturns the channel name associated with a given program
ChannelKeywordsReturns channel keywords
ChannelProgramNowReturns the name of a playing TV program on a given channel, empty otherwise
DateReturns a program's date
DateNoTimeSame as Date, but without the time.
NameDisplayReturns [name]: [series] or just [name]
NameDisplayWithDateNameDisplay + ([year])
RecordReturns 1 if the program is scheduled to be recorded, 0 otherwise
RecordMarkReturns a red dot if the program is schedule to be recorded.
RecordStatusReturns a string describing the record status, blank if not to be recorded.
SeriesDisplayReturns [series] or [name]
SeasonDisplayReturns [season]
SeasonEpisodeReturns [season].[episode]
TimeDisplayReturns program start time (system time format), or "Showing" if program on now
TimeDisplayNoOnNowTimeDisplay without on now handling
SizeDisplayReturns [duration] ([file size]) or [dimensions] ([file size])
WatchedDisplayReturns Watched() information, such as No, Yes, 80%, etc.
IsOnNonTopGroupedChannelReturns 1 if an EPG program is on a channel that is grouped as a non-top member, 0 otherwise.
ProgramChannelNumberReturns channel number of the television channel the program is on.
Examples tvinfo(namedisplay)

Returns formatted name and series output. If the file has no [series] value, only [name] is output.