GSoC:2008 Collections 2.0 Operator list

Erik Massop edited this page Nov 4, 2017 · 1 revision

General operators

Universe

  • Type: XMMS_COLLECTION_TYPE_UNIVERSE
  • Result: All mediaids in the medialibrary
  • Attributes: none
  • Operands: none

Idlist

  • Type: XMMS_COLLECTION_TYPE_IDLIST
  • Result: A medialist containing the mediaids in the idlist found within the operator.
  • Attributes:
    • type: The type of playlist. Typically list, queue or pshuffle. The default value is list.
    • any
  • Operands: Zero or one

Reference

  • Type: XMMS_COLLECTION_TYPE_REFERENCE
  • Result: All mediaids in the collection identified by the namespace and reference attributes
  • Attributes:
    • namespace: The namespace of the referenced collection, e.g. Playlists or Collections
    • reference: The name of the referenced, e.g. Muse, Never Played, That grand Opeth album or just Default
  • Operands: none (except on the daemon-side, where the referenced collection can be attached as an operand to the reference-operator)

Combining operators

Complement

  • Type: XMMS_COLLECTION_TYPE_COMPLEMENT
  • Result: All mediaids in medialibrary, except those in the operand.
  • Attributes: none
  • Operands: Exactly one

Intersection

  • Type: XMMS_COLLECTION_TYPE_INTERSECTION
  • Result: The mediaids that appear in all operands
  • Attributes: none
  • Operands: One or more

Union

  • Type: XMMS_COLLECTION_TYPE_UNION
  • Result: The mediaids that appear in any of the operands
  • Attributes: none
  • Operands: One or more

Concatenation

  • Type: XMMS_COLLECTION_TYPE_CONCATENATION
  • Result: A medialist of the operands behind each other
  • Attributes: none
  • Operands: One or more medialists

Intersection Ordered (soon too be abolished in favour of Intersection)

  • Type: XMMS_COLLECTION_TYPE_INTERSECTION_ORDERED
  • Result: The first operand, but only with the mediaids that are also in the second operand
  • Attributes: none
  • Operands: Exactly two

Filtering operators

Has

  • Type: XMMS_COLLECTION_TYPE_HAS
  • Result: The operand, but only with the mediaids that have a property with a given name, as well as a given source, where only properties are examined using the given source-preference.
  • Attributes:
    • field: The name of the property, e.g. artist, album or title. If this is not specified the name of the property is not taken into account.
    • source: The source of the property, e.g. server, plugin/vorbis, client/xmms2-cli or 2 (only for the daemon). If this is not specified the source of the property is not taken into account.
    • source-preference: The source-preference that needs to be applied, e.g. server:plugin/id3v2:client:plugin:plugin/pls (see Source-Preference Specification). If this is not specified the global source-preference will be used. (Currently only default and all are possible.)
  • Operands: Exactly one

Id

  • Type: XMMS_COLLECTION_TYPE_ID
  • Result: The operand, but only with the mediaids for which id [operation] [value] (e.g. id = 100, id <= 55) is true
  • Attributes:
    • operation: One of <, <=, =, >=, >= and !=. The default is =
    • value: A number
  • Operands: Exactly one

Compare

  • Type: XMMS_COLLECTION_TYPE_COMPARE
  • Result: The operand, but only with the mediaids that have a property with a given name, as well as a given source and a value for which the expression value [operation] [value] is true, given a collation, where only properties are examined using the given source-preference.
  • Attributes:
    • operation: One of <, <=, =, >=, >=, != and prefix. The default is =.
    • field: The name of the property, e.g. artist, album or title. If this is not specified the name of the property is not taken into account.
    • value: A string.
    • collation: A collation to be used when comparing the value from the medialib and the value attribute, e.g. NOCASE, BINARY, INTCOLL or NATCOLL. The default-value is NATCOLL
    • source: The source of the property, e.g. server, plugin/vorbis, client/xmms2-cli or 2 (only for the daemon). If this is not specified the source of the property is not taken into account.
    • source-preference: The source-preference that needs to be applied, e.g. server:plugin/id3v2:client:plugin:plugin/pls (see Source-Preference Specification). If this is not specified the global source-preference will be used. (Currently only default and all are possible.)
  • Operands: Exactly one

Match

  • Type: XMMS_COLLECTION_TYPE_MATCH
  • Result: The operand, but only with the mediaids that have a property with a given name, as well as a given source and a value matching the pattern found in the value attribute, given a collation, where only properties are examined using the given source-preference. The pattern uses the glob-syntax, with the * and ? wildcards.
  • Attributes:
    • field: The name of the property, e.g. artist, album or title. If this is not specified the name of the property is not taken into account.
    • value: A string.
    • collation: A collation to be used when comparing the value from the medialib and the value attribute, e.g. NOCASE, BINARY, INTCOLL or NATCOLL. Currently only BINARY and NOCASE are supported, as the semantics of some patterns for the other two collations is not clear. The default-value is NOCASE.
    • source: The source of the property, e.g. server, plugin/vorbis, client/xmms2-cli or 2 (only for the daemon). If this is not specified the source of the property is not taken into account.
    • source-preference: The source-preference that needs to be applied, e.g. server:plugin/id3v2:client:plugin:plugin/pls (see Source-Preference Specification). If this is not specified the global source-preference will be used. (Currently only default and all are possible.)
  • Operands: Exactly one

Token

  • Type: XMMS_COLLECTION_TYPE_TOKEN
  • Result: The operand, but only with the mediaids that have a property with a given name, as well as a given source and a value consisting of no other tokens than those in the value-attribute, given a collation, where only properties are examined using the given source-preference. To tokenize a string it is split on whitespace, after which all non-alphanumeric characters are stripped from the separate parts.
  • Attributes:
    • field: The name of the property, e.g. artist, album or title. If this is not specified the name of the property is not taken into account.
    • value: A string, which will be tokenized. If a token ends in * prefix-matching will be used for that token.
    • collation: A collation to be used when comparing the value from the medialib and the value attribute, e.g. NOCASE, BINARY, INTCOLL or NATCOLL. Currently only BINARY and NOCASE are supported for prefix-matching, as the semantics of some patterns for the other two collations is not clear.
    • source: The source of the property, e.g. server, plugin/vorbis, client/xmms2-cli or 2 (only for the daemon). If this is not specified the source of the property is not taken into account.
    • source-preference: The source-preference that needs to be applied, e.g. server:plugin/id3v2:client:plugin:plugin/pls (see Source-Preference Specification). If this is not specified the global source-preference will be used. (Currently only default and all are possible.)
  • Operands: Exactly one

Date (reserved)

  • Type: XMMS_COLLECTION_TYPE_DATE
  • Result: undefined
  • Attributes: undefined
  • Operands: Exactly one

'Medialist' operators

Order

  • Type: XMMS_COLLECTION_TYPE_ORDER
  • Result: A medialist, with the mediaids in the operand sorted according to a value depending on the type attribute and the mediaid. If the operand also is an order operator, then the values generated by that will be used for secondary sorting.
  • Attributes:
    • order: ASC or DESC for ascending and descending ordering. The default-value is ASC.
    • collation: A collation to be used when the values are strings. The default-value is NATCOLL.
    • type: What kind of value should be retrieved, typically value, field, id or random. The default value is value.
    • field: If type=value, defines which property to order by.
  • Operands: Exactly one

Limit

  • Type: XMMS_COLLECTION_TYPE_LIMIT
  • Result: A medialist equal to the operand, but without the first start entries and containing length or fewer entries.
  • Attributes:
    • start: an integer, defaulting to 0.
    • length: an integer, defaulting to UINT_MAX.
  • Operands: Exactly one (a medialist)

Mediaset

  • Type: XMMS_COLLECTION_TYPE_MEDIASET
  • Result: A mediaset containing the mediaids in the operand. (Removing duplicates and order)
  • Attributes: none
  • Operands: Exactly one
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.