mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-27 16:06:15 +02:00
Add mixer mode "none"
This commit is contained in:
parent
4a7b72773a
commit
dd913acff9
8 changed files with 90 additions and 81 deletions
|
@ -64,20 +64,18 @@ void Controller::getNextMessage()
|
|||
{
|
||||
if (stream_ && decoder_)
|
||||
{
|
||||
// auto wireChunk = msg::message_cast<msg::WireChunk>(std::move(response));
|
||||
// execute on the io_context to do the (costly) decoding on another thread (if more than one thread is used)
|
||||
// boost::asio::post(io_context_, [this, response = std::move(response)]() mutable {
|
||||
auto pcmChunk = msg::message_cast<msg::PcmChunk>(std::move(response));
|
||||
pcmChunk->format = sampleFormat_;
|
||||
// std::make_unique<msg::PcmChunk>(sampleFormat_, *wireChunk);
|
||||
// pcmChunk->deserialize(baseMessage, buffer);
|
||||
// LOG(TRACE, LOG_TAG) << "chunk: " << pcmChunk->payloadSize << ", sampleFormat: " << sampleFormat_.getFormat() << "\n";
|
||||
if (decoder_->decode(pcmChunk.get()))
|
||||
{
|
||||
// LOG(TRACE, LOG_TAG) << ", decoded: " << pcmChunk->payloadSize << ", Duration: " << pcmChunk->durationMs()
|
||||
// << ", sec: " << pcmChunk->timestamp.sec << ", usec: " << pcmChunk->timestamp.usec / 1000 << ", type: " <<
|
||||
// pcmChunk->type
|
||||
// << "\n";
|
||||
// LOG(TRACE, LOG_TAG) << ", decoded: " << pcmChunk->payloadSize << ", Duration: " << pcmChunk->durationMs() << ", sec: " <<
|
||||
// pcmChunk->timestamp.sec << ", usec: " << pcmChunk->timestamp.usec / 1000 << ", type: " << pcmChunk->type << "\n";
|
||||
stream_->addChunk(std::move(pcmChunk));
|
||||
}
|
||||
// });
|
||||
}
|
||||
}
|
||||
else if (response->type == message_type::kTime)
|
||||
|
@ -94,8 +92,7 @@ void Controller::getNextMessage()
|
|||
<< ", volume: " << serverSettings_->getVolume() << ", muted: " << serverSettings_->isMuted() << "\n";
|
||||
if (stream_ && player_)
|
||||
{
|
||||
player_->setVolume(serverSettings_->getVolume() / 100.);
|
||||
player_->setMute(serverSettings_->isMuted());
|
||||
player_->setVolume(serverSettings_->getVolume() / 100., serverSettings_->isMuted());
|
||||
stream_->setBufferLen(std::max(0, serverSettings_->getBufferMs() - serverSettings_->getLatency() - settings_.player.latency));
|
||||
}
|
||||
}
|
||||
|
@ -181,8 +178,7 @@ void Controller::getNextMessage()
|
|||
// The player class will send the device's volume to the server instead
|
||||
if (settings_.player.mixer.mode != ClientSettings::Mixer::Mode::hardware)
|
||||
{
|
||||
player_->setVolume(serverSettings_->getVolume() / 100.);
|
||||
player_->setMute(serverSettings_->isMuted());
|
||||
player_->setVolume(serverSettings_->getVolume() / 100., serverSettings_->isMuted());
|
||||
}
|
||||
}
|
||||
else if (response->type == message_type::kStreamTags)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue