Module: MPD::Plugins::Reflection

Included in:
MPD
Defined in:
lib/ruby-mpd/plugins/reflection.rb

Overview

Informational commands regarding MPD’s internals and config.

Instance Method Summary collapse

Instance Method Details

#commandsArray<Symbol>

Shows which commands the current user has access to.

Returns:

  • (Array<Symbol>)

    Array of command names.



14
15
16
# File 'lib/ruby-mpd/plugins/reflection.rb', line 14

def commands
  send_command :commands
end

#configHash

Returns the config of MPD (currently only music_directory). Only works if connected trough an UNIX domain socket.

Returns:

  • (Hash)

    Configuration of MPD



8
9
10
# File 'lib/ruby-mpd/plugins/reflection.rb', line 8

def config
  send_command :config
end

#decodersArray<Hash>

Get a list of decoder plugins, with by their supported suffixes and MIME types.

Returns:

  • (Array<Hash>)

    An array of hashes, one per decoder.



33
34
35
# File 'lib/ruby-mpd/plugins/reflection.rb', line 33

def decoders
  send_command :decoders
end

#notcommandsArray<Symbol>

Shows which commands the current user does not have access to.

Returns:

  • (Array<Symbol>)

    Array of command names.



20
21
22
# File 'lib/ruby-mpd/plugins/reflection.rb', line 20

def notcommands
  send_command :notcommands
end

#tagsArray

Get a list of available song metadata fields. This gets only mapped once per-connect (it gets remapped if you connect and disconnect).

Returns:

  • (Array)

    An array of tags.



41
42
43
# File 'lib/ruby-mpd/plugins/reflection.rb', line 41

def tags
  @tags ||= send_command(:tagtypes).map {|tag| tag.downcase }
end

#url_handlersArray<String>

Gets a list of available URL handlers.

Returns:

  • (Array<String>)

    Array of URL’s MPD can handle.



26
27
28
# File 'lib/ruby-mpd/plugins/reflection.rb', line 26

def url_handlers
  send_command :urlhandlers
end