module MPD::Plugins::Reflection

Informational commands regarding MPD’s internals and config.

Public Instance Methods

commands() click to toggle source

Shows which commands the current user has access to. @return [Array<Symbol>] Array of command names.

# File lib/ruby-mpd/plugins/reflection.rb, line 14
def commands
  send_command :commands
end
config() click to toggle source

Returns the config of MPD (currently only music_directory). Only works if connected trough an UNIX domain socket. @return [Hash] Configuration of MPD

# File lib/ruby-mpd/plugins/reflection.rb, line 8
def config
  send_command :config
end
decoders() click to toggle source

Get a list of decoder plugins, with by their supported suffixes and MIME types. @return [Array<Hash>] An array of hashes, one per decoder.

# File lib/ruby-mpd/plugins/reflection.rb, line 33
def decoders
  send_command :decoders
end
notcommands() click to toggle source

Shows which commands the current user does not have access to. @return [Array<Symbol>] Array of command names.

# File lib/ruby-mpd/plugins/reflection.rb, line 20
def notcommands
  send_command :notcommands
end
tags() click to toggle source

Get a list of available song metadata fields. This gets only mapped once per-connect (it gets remapped if you connect and disconnect). @return [Array] An array of tags.

# File lib/ruby-mpd/plugins/reflection.rb, line 41
def tags
  @tags ||= send_command(:tagtypes).map {|tag| tag.downcase }
end
url_handlers() click to toggle source

Gets a list of available URL handlers. @return [Array<String>] Array of URL’s MPD can handle.

# File lib/ruby-mpd/plugins/reflection.rb, line 26
def url_handlers
  send_command :urlhandlers
end