mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 23:56:43 +02:00
removed command message
This commit is contained in:
parent
fe89220b15
commit
4218bedd01
6 changed files with 2 additions and 79 deletions
|
@ -32,7 +32,6 @@
|
||||||
#include "message/time.h"
|
#include "message/time.h"
|
||||||
#include "message/request.h"
|
#include "message/request.h"
|
||||||
#include "message/ack.h"
|
#include "message/ack.h"
|
||||||
#include "message/command.h"
|
|
||||||
#include "message/hello.h"
|
#include "message/hello.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -191,10 +190,6 @@ void Controller::worker()
|
||||||
player_->setMute(serverSettings->muted);
|
player_->setMute(serverSettings->muted);
|
||||||
player_->start();
|
player_->start();
|
||||||
|
|
||||||
msg::Command startStream("startStream");
|
|
||||||
shared_ptr<msg::Ack> ackMsg(NULL);
|
|
||||||
while (active_ && !(ackMsg = clientConnection_->sendReq<msg::Ack>(&startStream)));
|
|
||||||
|
|
||||||
while (active_)
|
while (active_)
|
||||||
{
|
{
|
||||||
for (size_t n=0; n<10 && active_; ++n)
|
for (size_t n=0; n<10 && active_; ++n)
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
/***
|
|
||||||
This file is part of snapcast
|
|
||||||
Copyright (C) 2014-2016 Johannes Pohl
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
***/
|
|
||||||
|
|
||||||
#ifndef COMMAND_MSG_H
|
|
||||||
#define COMMAND_MSG_H
|
|
||||||
|
|
||||||
#include "stringMessage.h"
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
|
|
||||||
namespace msg
|
|
||||||
{
|
|
||||||
|
|
||||||
class Command : public StringMessage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Command() : StringMessage(message_type::kCommand)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Command(const std::string& _command) : StringMessage(message_type::kCommand, _command)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~Command()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const std::string& getCommand() const
|
|
||||||
{
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setCommand(const std::string& command)
|
|
||||||
{
|
|
||||||
str = command;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ enum message_type
|
||||||
kTime = 5,
|
kTime = 5,
|
||||||
kRequest = 6,
|
kRequest = 6,
|
||||||
kAck = 7,
|
kAck = 7,
|
||||||
kCommand = 8,
|
// kCommand = 8,
|
||||||
kHello = 9,
|
kHello = 9,
|
||||||
kMap = 10,
|
kMap = 10,
|
||||||
kString = 11
|
kString = 11
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include "message/time.h"
|
#include "message/time.h"
|
||||||
#include "message/ack.h"
|
#include "message/ack.h"
|
||||||
#include "message/request.h"
|
#include "message/request.h"
|
||||||
#include "message/command.h"
|
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/utils.h"
|
#include "common/utils.h"
|
||||||
#include "common/snapException.h"
|
#include "common/snapException.h"
|
||||||
|
|
|
@ -42,7 +42,6 @@ StreamSession::~StreamSession()
|
||||||
void StreamSession::start()
|
void StreamSession::start()
|
||||||
{
|
{
|
||||||
setActive(true);
|
setActive(true);
|
||||||
streamActive_ = false;
|
|
||||||
readerThread_ = new thread(&StreamSession::reader, this);
|
readerThread_ = new thread(&StreamSession::reader, this);
|
||||||
writerThread_ = new thread(&StreamSession::writer, this);
|
writerThread_ = new thread(&StreamSession::writer, this);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +98,7 @@ void StreamSession::socketRead(void* _to, size_t _bytes)
|
||||||
|
|
||||||
void StreamSession::add(const shared_ptr<const msg::BaseMessage>& message)
|
void StreamSession::add(const shared_ptr<const msg::BaseMessage>& message)
|
||||||
{
|
{
|
||||||
if (!message || !streamActive_)
|
if (!message)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (messages_.size() > 100)// chunk->getDuration() > 10000)
|
while (messages_.size() > 100)// chunk->getDuration() > 10000)
|
||||||
|
|
|
@ -72,13 +72,6 @@ public:
|
||||||
return active_;
|
return active_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Client subscribed for the PCM stream, by sending the "startStream" command
|
|
||||||
/// TODO: Currently there is only one stream ("zone")
|
|
||||||
void setStreamActive(bool active)
|
|
||||||
{
|
|
||||||
streamActive_ = active;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Max playout latency. No need to send PCM data that is older than bufferMs
|
/// Max playout latency. No need to send PCM data that is older than bufferMs
|
||||||
void setBufferMs(size_t bufferMs)
|
void setBufferMs(size_t bufferMs)
|
||||||
{
|
{
|
||||||
|
@ -100,7 +93,6 @@ protected:
|
||||||
void setActive(bool active);
|
void setActive(bool active);
|
||||||
|
|
||||||
std::atomic<bool> active_;
|
std::atomic<bool> active_;
|
||||||
std::atomic<bool> streamActive_;
|
|
||||||
mutable std::mutex mutex_;
|
mutable std::mutex mutex_;
|
||||||
std::thread* readerThread_;
|
std::thread* readerThread_;
|
||||||
std::thread* writerThread_;
|
std::thread* writerThread_;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue