Module: MPD::Plugins::Reflection

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

Overview

Informational commands regarding MPD’s internals and config.

Changes: tagtypes was mapped to tags and gets fetched only once.

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.



16
17
18
# File 'lib/ruby-mpd/plugins/reflection.rb', line 16

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



10
11
12
# File 'lib/ruby-mpd/plugins/reflection.rb', line 10

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.



35
36
37
# File 'lib/ruby-mpd/plugins/reflection.rb', line 35

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.



22
23
24
# File 'lib/ruby-mpd/plugins/reflection.rb', line 22

def notcommands
  send_command :notcommands
end

#tagsArray

Get a list of available song metadata.

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.



28
29
30
# File 'lib/ruby-mpd/plugins/reflection.rb', line 28

def url_handlers
  send_command :urlhandlers
end