mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-30 09:26:15 +02:00
reformat code
This commit is contained in:
parent
8b231c7cc6
commit
6b729ad61c
19 changed files with 23 additions and 35 deletions
|
@ -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)));
|
||||
|
||||
/* Create the service browser */
|
||||
if (!(sb_ =
|
||||
avahi_service_browser_new(client_, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, serviceName.c_str(), nullptr, (AvahiLookupFlags)0, browse_callback, this)))
|
||||
if (!(sb_ = avahi_service_browser_new(client_, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, serviceName.c_str(), nullptr, (AvahiLookupFlags)0, browse_callback,
|
||||
this)))
|
||||
throw SnapException("BrowseAvahi - Failed to create service browser: " + std::string(avahi_strerror(avahi_client_errno(client_))));
|
||||
|
||||
result_.valid = false;
|
||||
|
|
|
@ -28,7 +28,8 @@ class Decoder
|
|||
{
|
||||
public:
|
||||
Decoder(){};
|
||||
virtual ~Decoder()= default;;
|
||||
virtual ~Decoder() = default;
|
||||
|
||||
virtual bool decode(msg::PcmChunk* chunk) = 0;
|
||||
virtual SampleFormat setHeader(msg::CodecHeader* chunk) = 0;
|
||||
|
||||
|
|
|
@ -105,7 +105,8 @@ SampleFormat FlacDecoder::setHeader(msg::CodecHeader* chunk)
|
|||
throw SnapException("ERROR: allocating decoder");
|
||||
|
||||
// (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)
|
||||
throw SnapException("ERROR: initializing decoder: " + string(FLAC__StreamDecoderInitStatusString[init_status]));
|
||||
|
||||
|
|
|
@ -48,8 +48,7 @@ public:
|
|||
msg["SnapStreamProtocolVersion"] = 2;
|
||||
}
|
||||
|
||||
~Hello() override
|
||||
= default;
|
||||
~Hello() override = default;
|
||||
|
||||
std::string getMacAddress() const
|
||||
{
|
||||
|
|
|
@ -36,8 +36,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
~JsonMessage() override
|
||||
= default;
|
||||
~JsonMessage() override = default;
|
||||
|
||||
void read(std::istream& stream) override
|
||||
{
|
||||
|
|
|
@ -126,8 +126,7 @@ struct BaseMessage
|
|||
{
|
||||
}
|
||||
|
||||
virtual ~BaseMessage()
|
||||
= default;
|
||||
virtual ~BaseMessage() = default;
|
||||
|
||||
virtual void read(std::istream& stream)
|
||||
{
|
||||
|
|
|
@ -48,8 +48,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
~PcmChunk() override
|
||||
= default;
|
||||
~PcmChunk() override = default;
|
||||
|
||||
int readFrames(void* outputBuffer, size_t frameCount)
|
||||
{
|
||||
|
|
|
@ -36,8 +36,7 @@ public:
|
|||
setMuted(false);
|
||||
}
|
||||
|
||||
~ServerSettings() override
|
||||
= default;
|
||||
~ServerSettings() override = default;
|
||||
|
||||
int32_t getBufferMs()
|
||||
{
|
||||
|
|
|
@ -65,8 +65,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
~StreamTags() override
|
||||
= default;
|
||||
~StreamTags() override = default;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -31,8 +31,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
~Time() override
|
||||
= default;
|
||||
~Time() override = default;
|
||||
|
||||
void read(std::istream& stream) override
|
||||
{
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
using namespace std;
|
||||
|
||||
|
||||
SampleFormat::SampleFormat()
|
||||
= default;
|
||||
SampleFormat::SampleFormat() = default;
|
||||
|
||||
|
||||
SampleFormat::SampleFormat(const std::string& format)
|
||||
|
|
|
@ -72,8 +72,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
~AsyncSnapException() throw() override
|
||||
= default;
|
||||
~AsyncSnapException() throw() override = default;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ void Config::init(const std::string& root_directory, const std::string& user, co
|
|||
if (j.count("ConfigVersion"))
|
||||
{
|
||||
json jGroups = j["Groups"];
|
||||
for (auto & jGroup : jGroups)
|
||||
for (auto& jGroup : jGroups)
|
||||
{
|
||||
GroupPtr group = make_shared<Group>();
|
||||
group->fromJson(jGroup);
|
||||
|
|
|
@ -160,8 +160,7 @@ struct Snapcast
|
|||
{
|
||||
}
|
||||
|
||||
virtual ~Snapcast()
|
||||
= default;
|
||||
virtual ~Snapcast() = default;
|
||||
|
||||
virtual void fromJson(const json& j)
|
||||
{
|
||||
|
|
|
@ -54,8 +54,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual ~Encoder()
|
||||
= default;
|
||||
virtual ~Encoder() = default;
|
||||
|
||||
/// The listener will receive the encoded stream
|
||||
virtual void init(EncoderListener* listener, const SampleFormat& format)
|
||||
|
|
|
@ -149,8 +149,8 @@ void PublishAvahi::create_services(AvahiClient* c)
|
|||
/// We will now add two services and one subtype to the entry group
|
||||
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,
|
||||
service.port_, NULL)) < 0)
|
||||
if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AvahiPublishFlags(0), name, service.name_.c_str(), nullptr,
|
||||
nullptr, service.port_, NULL)) < 0)
|
||||
{
|
||||
if (ret == AVAHI_ERR_COLLISION)
|
||||
goto collision;
|
||||
|
|
|
@ -23,8 +23,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual ~PublishmDNS()
|
||||
= default;
|
||||
virtual ~PublishmDNS() = default;
|
||||
|
||||
virtual void publish(const std::vector<mDNSService>& services) = 0;
|
||||
|
||||
|
|
|
@ -35,8 +35,7 @@ StreamServer::StreamServer(asio::io_service* io_service, const StreamServerSetti
|
|||
}
|
||||
|
||||
|
||||
StreamServer::~StreamServer()
|
||||
= default;
|
||||
StreamServer::~StreamServer() = default;
|
||||
|
||||
|
||||
void StreamServer::onMetaChanged(const PcmStream* pcmStream)
|
||||
|
|
|
@ -63,8 +63,7 @@ SpotifyStream::SpotifyStream(PcmListener* pcmListener, const StreamUri& uri) : P
|
|||
}
|
||||
|
||||
|
||||
SpotifyStream::~SpotifyStream()
|
||||
= default;
|
||||
SpotifyStream::~SpotifyStream() = default;
|
||||
|
||||
|
||||
void SpotifyStream::initExeAndPath(const std::string& filename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue