removed command message

This commit is contained in:
badaix 2016-01-22 22:16:07 +01:00
parent fe89220b15
commit 4218bedd01
6 changed files with 2 additions and 79 deletions

View file

@ -32,7 +32,6 @@
#include "message/time.h"
#include "message/request.h"
#include "message/ack.h"
#include "message/command.h"
#include "message/hello.h"
using namespace std;
@ -191,10 +190,6 @@ void Controller::worker()
player_->setMute(serverSettings->muted);
player_->start();
msg::Command startStream("startStream");
shared_ptr<msg::Ack> ackMsg(NULL);
while (active_ && !(ackMsg = clientConnection_->sendReq<msg::Ack>(&startStream)));
while (active_)
{
for (size_t n=0; n<10 && active_; ++n)

View file

@ -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

View file

@ -56,7 +56,7 @@ enum message_type
kTime = 5,
kRequest = 6,
kAck = 7,
kCommand = 8,
// kCommand = 8,
kHello = 9,
kMap = 10,
kString = 11

View file

@ -20,7 +20,6 @@
#include "message/time.h"
#include "message/ack.h"
#include "message/request.h"
#include "message/command.h"
#include "common/log.h"
#include "common/utils.h"
#include "common/snapException.h"

View file

@ -42,7 +42,6 @@ StreamSession::~StreamSession()
void StreamSession::start()
{
setActive(true);
streamActive_ = false;
readerThread_ = new thread(&StreamSession::reader, 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)
{
if (!message || !streamActive_)
if (!message)
return;
while (messages_.size() > 100)// chunk->getDuration() > 10000)

View file

@ -72,13 +72,6 @@ public:
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
void setBufferMs(size_t bufferMs)
{
@ -100,7 +93,6 @@ protected:
void setActive(bool active);
std::atomic<bool> active_;
std::atomic<bool> streamActive_;
mutable std::mutex mutex_;
std::thread* readerThread_;
std::thread* writerThread_;