Accessing myMPD and MPD status information

Accessing myMPD and MPD status information#

Populates the lua table mympd_state with configuration values and current status of myMPD and MPD.

mympd.init()

Parameters:

No parameters required.

Returns:

FIELD

TYPE

DESCRIPTION

rc

integer

response code: 0 = success, 1 = error

result

lua table

jsonrpc result or error as lua table

The lua table mympd_state is populated with following fields.

mympd_state#

KEY

TYPE

DESCRIPTION

au to_play

Boolean

true = enabled, false = disabled

consum e_state

Integer

MPD consume state: 0 = off, 1 = on, 2 = oneshot, 3 = unknown

curren t_album

String

myMPD AlbumId

cr ossfade

Integer

MPD crossfade option

curre nt_song

Table

Current MPD song

elaps ed_time

Integer

Elapsed time of current song

juke box_ignor e_hated

Boolean

Ignore hated songs for jukebox

juk ebox_last _played

Integer

Don’t add songs that are played in the last x hours

`` jukebox_m ax_song_d uration``

Integer

Only songs with this minimum length will be considered.

`` jukebox_m in_song_d uration``

Integer

If greater then zero: Only songs with this maximum length will be considered.

jukeb ox_mode

Integer

Jukebox mode: 0 = off, 1 = song, 2 = album, 3 = script

`` jukebox_p laylist``

String

Jukebox playlist: Database or MPD playlist name

juke box_queue _length

Integer

Number of songs in the queue before the jukebox add’s more songs.

`` jukebox_u niq_tag``

String

Build the jukebox queue with this tag as uniq constraint: Song, Album, Artist

li stenbrain z_token

String

ListenBrainz Token

mixra mpdelay

Float

Mixramp delay

mi xrampdb

Float

Mixramp DB

` music_di rectory`

String

Path to the mpd music directory

my mpd_uri

String

Canonical myMPD uri

` mympd_ur i_plain`

String

Canonical myMPD uri (http://)

next_ song_id

Integer

Next song id in queue

next_s ong_pos

Integer

Next song position in queue

pla y_state

Integer

Player state: 0 = unknown, 1 = stop, 2 = play, 3 = pause

pl aylist_di rectory

String

path to the mpd playlist directory

queue _length

Integer

Length of the queue

queue_ version

Integer

Version of the queue

` repeat`

Boolean

MPD repeat option

rep laygain

Integer

0 = off, 1 = track, 2 = album, 3 = auto, 4 = unknown

` random`

Boolean

MPD random option

singl e_state

Integer

MPD single state: 0 = off, 1 = on, 2 = oneshot, 3 = unknown

`` song_id``

Integer

Song id of current song

s ong_pos

Integer

Current song position in queue

sta rt_time

Integer

Current song start playing timestamp

tot al_time

Integer

Total time of current song

` volume`

Integer

0 - 100 percent

mympd_state.current_song#

KEY

TYPE

DESCRIPTION

uri

String

Song uri

Duration

Integer

Song duration in seconds

Tag

Tag value(s)

MPD tag name with values.