reformat code

This commit is contained in:
badaix 2019-09-25 19:07:23 +02:00
parent 8b231c7cc6
commit 6b729ad61c
19 changed files with 23 additions and 35 deletions

View file

@ -179,8 +179,8 @@ bool BrowseAvahi::browse(const std::string& serviceName, mDNSResult& result, int
throw SnapException("BrowseAvahi - Failed to create client: " + std::string(avahi_strerror(error))); throw SnapException("BrowseAvahi - Failed to create client: " + std::string(avahi_strerror(error)));
/* Create the service browser */ /* Create the service browser */
if (!(sb_ = if (!(sb_ = avahi_service_browser_new(client_, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, serviceName.c_str(), nullptr, (AvahiLookupFlags)0, browse_callback,
avahi_service_browser_new(client_, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, serviceName.c_str(), nullptr, (AvahiLookupFlags)0, browse_callback, this))) this)))
throw SnapException("BrowseAvahi - Failed to create service browser: " + std::string(avahi_strerror(avahi_client_errno(client_)))); throw SnapException("BrowseAvahi - Failed to create service browser: " + std::string(avahi_strerror(avahi_client_errno(client_))));
result_.valid = false; result_.valid = false;

View file

@ -28,7 +28,8 @@ class Decoder
{ {
public: public:
Decoder(){}; Decoder(){};
virtual ~Decoder()= default;; virtual ~Decoder() = default;
virtual bool decode(msg::PcmChunk* chunk) = 0; virtual bool decode(msg::PcmChunk* chunk) = 0;
virtual SampleFormat setHeader(msg::CodecHeader* chunk) = 0; virtual SampleFormat setHeader(msg::CodecHeader* chunk) = 0;

View file

@ -105,7 +105,8 @@ SampleFormat FlacDecoder::setHeader(msg::CodecHeader* chunk)
throw SnapException("ERROR: allocating decoder"); throw SnapException("ERROR: allocating decoder");
// (void)FLAC__stream_decoder_set_md5_checking(decoder, true); // (void)FLAC__stream_decoder_set_md5_checking(decoder, true);
init_status = FLAC__stream_decoder_init_stream(decoder, read_callback, nullptr, nullptr, nullptr, nullptr, write_callback, metadata_callback, error_callback, this); init_status =
FLAC__stream_decoder_init_stream(decoder, read_callback, nullptr, nullptr, nullptr, nullptr, write_callback, metadata_callback, error_callback, this);
if (init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK) if (init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK)
throw SnapException("ERROR: initializing decoder: " + string(FLAC__StreamDecoderInitStatusString[init_status])); throw SnapException("ERROR: initializing decoder: " + string(FLAC__StreamDecoderInitStatusString[init_status]));

View file

@ -48,8 +48,7 @@ public:
msg["SnapStreamProtocolVersion"] = 2; msg["SnapStreamProtocolVersion"] = 2;
} }
~Hello() override ~Hello() override = default;
= default;
std::string getMacAddress() const std::string getMacAddress() const
{ {

View file

@ -36,8 +36,7 @@ public:
{ {
} }
~JsonMessage() override ~JsonMessage() override = default;
= default;
void read(std::istream& stream) override void read(std::istream& stream) override
{ {

View file

@ -126,8 +126,7 @@ struct BaseMessage
{ {
} }
virtual ~BaseMessage() virtual ~BaseMessage() = default;
= default;
virtual void read(std::istream& stream) virtual void read(std::istream& stream)
{ {

View file

@ -48,8 +48,7 @@ public:
{ {
} }
~PcmChunk() override ~PcmChunk() override = default;
= default;
int readFrames(void* outputBuffer, size_t frameCount) int readFrames(void* outputBuffer, size_t frameCount)
{ {

View file

@ -36,8 +36,7 @@ public:
setMuted(false); setMuted(false);
} }
~ServerSettings() override ~ServerSettings() override = default;
= default;
int32_t getBufferMs() int32_t getBufferMs()
{ {

View file

@ -65,8 +65,7 @@ public:
{ {
} }
~StreamTags() override ~StreamTags() override = default;
= default;
}; };
} }

View file

@ -31,8 +31,7 @@ public:
{ {
} }
~Time() override ~Time() override = default;
= default;
void read(std::istream& stream) override void read(std::istream& stream) override
{ {

View file

@ -30,8 +30,7 @@
using namespace std; using namespace std;
SampleFormat::SampleFormat() SampleFormat::SampleFormat() = default;
= default;
SampleFormat::SampleFormat(const std::string& format) SampleFormat::SampleFormat(const std::string& format)

View file

@ -72,8 +72,7 @@ public:
} }
~AsyncSnapException() throw() override ~AsyncSnapException() throw() override = default;
= default;
}; };

View file

@ -97,7 +97,7 @@ void Config::init(const std::string& root_directory, const std::string& user, co
if (j.count("ConfigVersion")) if (j.count("ConfigVersion"))
{ {
json jGroups = j["Groups"]; json jGroups = j["Groups"];
for (auto & jGroup : jGroups) for (auto& jGroup : jGroups)
{ {
GroupPtr group = make_shared<Group>(); GroupPtr group = make_shared<Group>();
group->fromJson(jGroup); group->fromJson(jGroup);

View file

@ -160,8 +160,7 @@ struct Snapcast
{ {
} }
virtual ~Snapcast() virtual ~Snapcast() = default;
= default;
virtual void fromJson(const json& j) virtual void fromJson(const json& j)
{ {

View file

@ -54,8 +54,7 @@ public:
{ {
} }
virtual ~Encoder() virtual ~Encoder() = default;
= default;
/// The listener will receive the encoded stream /// The listener will receive the encoded stream
virtual void init(EncoderListener* listener, const SampleFormat& format) virtual void init(EncoderListener* listener, const SampleFormat& format)

View file

@ -149,8 +149,8 @@ void PublishAvahi::create_services(AvahiClient* c)
/// We will now add two services and one subtype to the entry group /// We will now add two services and one subtype to the entry group
for (const auto& service : services_) for (const auto& service : services_)
{ {
if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AvahiPublishFlags(0), name, service.name_.c_str(), nullptr, nullptr, if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AvahiPublishFlags(0), name, service.name_.c_str(), nullptr,
service.port_, NULL)) < 0) nullptr, service.port_, NULL)) < 0)
{ {
if (ret == AVAHI_ERR_COLLISION) if (ret == AVAHI_ERR_COLLISION)
goto collision; goto collision;

View file

@ -23,8 +23,7 @@ public:
{ {
} }
virtual ~PublishmDNS() virtual ~PublishmDNS() = default;
= default;
virtual void publish(const std::vector<mDNSService>& services) = 0; virtual void publish(const std::vector<mDNSService>& services) = 0;

View file

@ -35,8 +35,7 @@ StreamServer::StreamServer(asio::io_service* io_service, const StreamServerSetti
} }
StreamServer::~StreamServer() StreamServer::~StreamServer() = default;
= default;
void StreamServer::onMetaChanged(const PcmStream* pcmStream) void StreamServer::onMetaChanged(const PcmStream* pcmStream)

View file

@ -63,8 +63,7 @@ SpotifyStream::SpotifyStream(PcmListener* pcmListener, const StreamUri& uri) : P
} }
SpotifyStream::~SpotifyStream() SpotifyStream::~SpotifyStream() = default;
= default;
void SpotifyStream::initExeAndPath(const std::string& filename) void SpotifyStream::initExeAndPath(const std::string& filename)