-- escape for the percent character: %%
template = "%title by %artist, track %num from %album, %year " ..
"(%pos/%len) [%volume]",
+
+ -- output debug filename (false or nil for no debug output)
+ debug = false,
},
-- Memory monitor
-- escape for the percent character: %%
-- a default template
- template = "%artist - %num - %title (%pos / %len)"
+ template = "%artist - %num - %title (%pos / %len)",
+
+ -- output debug filename (false or nil for no debug output)
+ debug = false,
}
local settings = table.join(statusd.get_config("mpd"), defaults)
local timer
local last_volume
local last_state
+local debug_file
-- Function for starting and restarting execution of a process
while data do
+ -- debug
+ if settings.debug then
+ debug_file:write("ion-statusd [statusd_mpd]: DEBUG mpd data:\n"
+ .. data .. "\n\n")
+ debug_file:flush()
+ end
+
if not inited then
-- welcome msg
if string.sub(data, 1, 6) ~= "OK MPD" then
-- Now start execution of all defined processes
+if settings.debug then debug_file = io.open("ion_statusd_mpd.log", "a+") end
timer = statusd.create_timer()
start_execution()