mpd: support password protected MPD

- Add MPD module option `password`, and document it.
- Add logic to send the password, directly after connecting to
  MPD.

Fixes: #576
Signed-off-by: Joseph Benden <joe@benden.us>
This commit is contained in:
Joseph Benden
2020-10-19 11:54:36 -07:00
parent f151d435a8
commit 587eb5fdb4
3 changed files with 19 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#pragma once
#include <mpd/client.h>
#include <fmt/format.h>
#include <mpd/client.h>
#include <spdlog/spdlog.h>
#include <condition_variable>
@ -22,8 +22,9 @@ class MPD : public ALabel {
// Not using unique_ptr since we don't manage the pointer
// (It's either nullptr, or from the config)
const char* server_;
const unsigned port_;
const char* server_;
const unsigned port_;
const std::string password_;
unsigned timeout_;