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 |
|---|---|---|
|
Boolean |
true = enabled, false = disabled |
|
Integer |
MPD consume state: 0 = off, 1 = on, 2 = oneshot, 3 = unknown |
|
String |
myMPD AlbumId |
|
Integer |
MPD crossfade option |
|
Table |
Current MPD song |
|
Integer |
Elapsed time of current song |
|
Boolean |
Ignore hated songs for jukebox |
|
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. |
|
Integer |
Jukebox mode: 0 = off, 1 = song, 2 = album, 3 = script |
`` jukebox_p laylist`` |
String |
Jukebox playlist: Database or MPD playlist name |
|
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 |
|
String |
ListenBrainz Token |
|
Float |
Mixramp delay |
|
Float |
Mixramp DB |
` music_di rectory` |
String |
Path to the mpd music directory |
|
String |
Canonical myMPD uri |
` mympd_ur i_plain` |
String |
Canonical myMPD uri (http://) |
|
Integer |
Next song id in queue |
|
Integer |
Next song position in queue |
|
Integer |
Player state: 0 = unknown, 1 = stop, 2 = play, 3 = pause |
|
String |
path to the mpd playlist directory |
|
Integer |
Length of the queue |
|
Integer |
Version of the queue |
` repeat` |
Boolean |
MPD repeat option |
|
Integer |
0 = off, 1 = track, 2 = album, 3 = auto, 4 = unknown |
` random` |
Boolean |
MPD random option |
|
Integer |
MPD single state: 0 = off, 1 = on, 2 = oneshot, 3 = unknown |
`` song_id`` |
Integer |
Song id of current song |
|
Integer |
Current song position in queue |
|
Integer |
Current song start playing timestamp |
|
Integer |
Total time of current song |
` volume` |
Integer |
0 - 100 percent |
mympd_state.current_song#
KEY |
TYPE |
DESCRIPTION |
|---|---|---|
|
String |
Song uri |
|
Integer |
Song duration in seconds |
Tag |
Tag value(s) |
MPD tag name with values. |