mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-07 19:57:43 +02:00
report stream state
This commit is contained in:
parent
cd2daa2cf9
commit
94629f9909
9 changed files with 79 additions and 12 deletions
|
@ -40,6 +40,15 @@ StreamServer::~StreamServer()
|
|||
}
|
||||
|
||||
|
||||
void StreamServer::onStateChanged(const PcmReader* pcmReader, const ReaderState& state)
|
||||
{
|
||||
logO << "onStateChanged (" << pcmReader->getName() << "): " << state << "\n";
|
||||
// logO << pcmReader->toJson().dump(4);
|
||||
json notification = JsonNotification::getJson("Stream.OnUpdate", pcmReader->toJson());
|
||||
controlServer_->send(notification.dump(), NULL);
|
||||
}
|
||||
|
||||
|
||||
void StreamServer::onChunkRead(const PcmReader* pcmReader, const msg::PcmChunk* chunk, double duration)
|
||||
{
|
||||
// logO << "onChunkRead (" << pcmReader->getName() << "): " << duration << "ms\n";
|
||||
|
@ -301,7 +310,7 @@ void StreamServer::onMessageReceived(StreamSession* connection, const msg::BaseM
|
|||
connection->send(headerChunk.get());
|
||||
|
||||
json notification = JsonNotification::getJson("Client.OnConnect", client->toJson());
|
||||
logO << notification.dump(4) << "\n";
|
||||
// logO << notification.dump(4) << "\n";
|
||||
controlServer_->send(notification.dump());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue