mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 08:06:41 +02:00
Reformat code
This commit is contained in:
parent
c6518a4709
commit
e1c8250876
32 changed files with 505 additions and 351 deletions
|
@ -127,10 +127,14 @@ void PcmStream::onControlRequest(const jsonrpcpp::Request& request)
|
|||
void PcmStream::pollProperties()
|
||||
{
|
||||
property_timer_.expires_after(10s);
|
||||
property_timer_.async_wait([this](const boost::system::error_code& ec) {
|
||||
property_timer_.async_wait(
|
||||
[this](const boost::system::error_code& ec)
|
||||
{
|
||||
if (!ec)
|
||||
{
|
||||
stream_ctrl_->command({++req_id_, "Plugin.Stream.Player.GetProperties"}, [this](const jsonrpcpp::Response& response) {
|
||||
stream_ctrl_->command({++req_id_, "Plugin.Stream.Player.GetProperties"},
|
||||
[this](const jsonrpcpp::Response& response)
|
||||
{
|
||||
LOG(INFO, LOG_TAG) << "Response for Plugin.Stream.Player.GetProperties: " << response.to_json() << "\n";
|
||||
if (response.error().code() == 0)
|
||||
setProperties(response.result());
|
||||
|
@ -154,7 +158,9 @@ void PcmStream::onControlNotification(const jsonrpcpp::Notification& notificatio
|
|||
else if (notification.method() == "Plugin.Stream.Ready")
|
||||
{
|
||||
LOG(DEBUG, LOG_TAG) << "Plugin is ready\n";
|
||||
stream_ctrl_->command({++req_id_, "Plugin.Stream.Player.GetProperties"}, [this](const jsonrpcpp::Response& response) {
|
||||
stream_ctrl_->command({++req_id_, "Plugin.Stream.Player.GetProperties"},
|
||||
[this](const jsonrpcpp::Response& response)
|
||||
{
|
||||
LOG(INFO, LOG_TAG) << "Response for Plugin.Stream.Player.GetProperties: " << response.to_json() << "\n";
|
||||
if (response.error().code() == 0)
|
||||
setProperties(response.result());
|
||||
|
@ -453,7 +459,9 @@ void PcmStream::sendRequest(const std::string& method, const jsonrpcpp::Paramete
|
|||
return handler({ControlErrc::can_not_control});
|
||||
|
||||
jsonrpcpp::Request req(++req_id_, method, params);
|
||||
stream_ctrl_->command(req, [handler](const jsonrpcpp::Response& response) {
|
||||
stream_ctrl_->command(req,
|
||||
[handler](const jsonrpcpp::Response& response)
|
||||
{
|
||||
if (response.error().code() != 0)
|
||||
handler({static_cast<ControlErrc>(response.error().code()), response.error().data()});
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue