Module lua_libpulse_glib.proplist

Bindings for PulseAudio’s property lists.

Basic operations are mapped to Lua table operations:

  • get a value: plist[key]
  • set a value: plist[key] = value
  • get the size: #plist
  • get default string presentation: tostring(plist)
  • equality: plist == other

Additional operations are exposed as methods, as documented below.

Table of contents

Tables

pulseaudio.proplist A list of well-known keys.

Constructor functions

new() Creates a new, empty property list.
from_string(str) Parses a string into a PropList.

Static functions

is_key_valid(key) Checks if the given string is a valid key.

Class PropList

PropList:is_empty() Checks if the proplist is empty.
PropList:tostring_sep() Creates a string representation with a custom separator.
PropList:clear() Removes all keys from the proplist
PropList:contains(key) Checks if the proplist contains the given key.
PropList:copy() Duplicates the proplist.

Tables

pulseaudio.proplist

A list of well-known keys. These will likely be used by other consumers of PulseAudio, so should be preferred for interoperatibility.

See proplist.h for details on these values.

 local proplist = require("pulseaudio.proplist")
 proplist.is_key_valid(proplist.MEDIA_NAME) -- true
 print(proplist.MEDIA_NAME) -- media.name

Fields:

  • MEDIA_NAME :  media.name
  • MEDIA_TITLE :  media.title
  • MEDIA_ARTIST :  media.artist
  • MEDIA_COPYRIGHT :  media.copyright
  • MEDIA_SOFTWARE :  media.software
  • MEDIA_LANGUAGE :  media.language
  • MEDIA_FILENAME :  media.filename
  • MEDIA_ICON :  media.icon
  • MEDIA_ICON_NAME :  media.icon_name
  • MEDIA_ROLE :  media.role
  • FILTER_WANT :  filter.want
  • FILTER_APPLY :  filter.apply
  • FILTER_SUPPRESS :  filter.suppress
  • EVENT_ID :  event.id
  • EVENT_DESCRIPTION :  event.description
  • EVENT_MOUSE_X :  event.mouse.x
  • EVENT_MOUSE_Y :  event.mouse.y
  • EVENT_MOUSE_HPOS :  event.mouse.hpos
  • EVENT_MOUSE_VPOS :  event.mouse.vpos
  • EVENT_MOUSE_BUTTON :  event.mouse.button
  • WINDOW_NAME :  window.name
  • WINDOW_ID :  window.id
  • WINDOW_ICON :  window.icon
  • WINDOW_ICON_NAME :  window.icon_name
  • WINDOW_X :  window.x
  • WINDOW_Y :  window.y
  • WINDOW_WIDTH :  window.width
  • WINDOW_HEIGHT :  window.height
  • WINDOW_HPOS :  window.hpos
  • WINDOW_VPOS :  window.vpos
  • WINDOW_DESKTOP :  window.desktop
  • WINDOW_X11_DISPLAY :  window.x11.display
  • WINDOW_X11_SCREEN :  window.x11.screen
  • WINDOW_X11_MONITOR :  window.x11.monitor
  • WINDOW_X11_XID :  window.x11.xid
  • APPLICATION_NAME :  application.name
  • APPLICATION_ID :  application.id
  • APPLICATION_VERSION :  application.version
  • APPLICATION_ICON :  application.icon
  • APPLICATION_ICON_NAME :  application.icon_name
  • APPLICATION_LANGUAGE :  application.language
  • APPLICATION_PROCESS_ID :  application.process.id
  • APPLICATION_PROCESS_BINARY :  application.process.binary
  • APPLICATION_PROCESS_USER :  application.process.user
  • APPLICATION_PROCESS_HOST :  application.process.host
  • APPLICATION_PROCESS_MACHINE_ID :  application.process.machine_id
  • APPLICATION_PROCESS_SESSION_ID :  application.process.session_id
  • DEVICE_STRING :  device.string
  • DEVICE_API :  device.api
  • DEVICE_DESCRIPTION :  device.description
  • DEVICE_BUS_PATH :  device.bus_path
  • DEVICE_SERIAL :  device.serial
  • DEVICE_VENDOR_ID :  device.vendor.id
  • DEVICE_VENDOR_NAME :  device.vendor.name
  • DEVICE_PRODUCT_ID :  device.product.id
  • DEVICE_PRODUCT_NAME :  device.product.name
  • DEVICE_CLASS :  device.class
  • DEVICE_FORM_FACTOR :  device.form_factor
  • DEVICE_BUS :  device.bus
  • DEVICE_ICON :  device.icon
  • DEVICE_ICON_NAME :  device.icon_name
  • DEVICE_ACCESS_MODE :  device.access_mode
  • DEVICE_MASTER_DEVICE :  device.master_device
  • DEVICE_BUFFERING_BUFFER_SIZE :  device.buffering.buffer_size
  • DEVICE_BUFFERING_FRAGMENT_SIZE :  device.buffering.fragment_size
  • DEVICE_PROFILE_NAME :  device.profile.name
  • DEVICE_INTENDED_ROLES :  device.intended_roles
  • DEVICE_PROFILE_DESCRIPTION :  device.profile.description
  • MODULE_AUTHOR :  module.author
  • MODULE_DESCRIPTION :  module.description
  • MODULE_USAGE :  module.usage
  • MODULE_VERSION :  module.version
  • FORMAT_SAMPLE_FORMAT :  format.sample_format
  • FORMAT_RATE :  format.rate
  • FORMAT_CHANNELS :  format.channels
  • FORMAT_CHANNEL_MAP :  format.channel_map
  • CONTEXT_FORCE_DISABLE_SHM :  context.force.disable.shm
  • BLUETOOTH_CODEC :  bluetooth.codec

Constructor functions

new()
Creates a new, empty property list.

Returns:

from_string(str)
Parses a string into a PropList.

Parameters:

  • str :  The string to parse.
    type string

Returns:

Static functions

is_key_valid(key)
Checks if the given string is a valid key.

Parameters:

  • key :  The string to check.
    type string

Returns:

  • type boolean

Class PropList

Methods
PropList:is_empty()
Checks if the proplist is empty.

Returns:

  • type boolean
PropList:tostring_sep()
Creates a string representation with a custom separator.

Returns:

PropList:clear()
Removes all keys from the proplist
PropList:contains(key)
Checks if the proplist contains the given key.

Parameters:

  • key :  The key to check for.
    type string

Returns:

  • type boolean
PropList:copy()
Duplicates the proplist.

Returns: