add clang-format file

reformat code
This commit is contained in:
badaix 2019-09-24 22:42:36 +02:00
parent b733f646ea
commit b20add3815
105 changed files with 7773 additions and 7723 deletions

View file

@ -1,6 +1,6 @@
/***
This file is part of snapcast
Copyright (C) 2014-2018 Johannes Pohl
Copyright (C) 2014-2019 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
@ -24,9 +24,9 @@
#if defined(HAS_FLAC)
#include "flacEncoder.h"
#endif
#include "common/utils/string_utils.h"
#include "common/snapException.h"
#include "aixlog.hpp"
#include "common/snapException.h"
#include "common/utils/string_utils.h"
using namespace std;
@ -34,41 +34,38 @@ using namespace std;
Encoder* EncoderFactory::createEncoder(const std::string& codecSettings) const
{
Encoder* encoder;
std::string codec(codecSettings);
std::string codecOptions;
if (codec.find(":") != std::string::npos)
{
codecOptions = utils::string::trim_copy(codec.substr(codec.find(":") + 1));
codec = utils::string::trim_copy(codec.substr(0, codec.find(":")));
}
Encoder* encoder;
std::string codec(codecSettings);
std::string codecOptions;
if (codec.find(":") != std::string::npos)
{
codecOptions = utils::string::trim_copy(codec.substr(codec.find(":") + 1));
codec = utils::string::trim_copy(codec.substr(0, codec.find(":")));
}
if (codec == "pcm")
encoder = new PcmEncoder(codecOptions);
#if defined(HAS_OGG) && defined(HAS_VORBIS) && defined(HAS_VORBISENC)
else if (codec == "ogg")
encoder = new OggEncoder(codecOptions);
encoder = new OggEncoder(codecOptions);
#endif
#if defined(HAS_FLAC)
else if (codec == "flac")
encoder = new FlacEncoder(codecOptions);
else if (codec == "flac")
encoder = new FlacEncoder(codecOptions);
#endif
else
{
throw SnapException("unknown codec: " + codec);
}
else
{
throw SnapException("unknown codec: " + codec);
}
return encoder;
/* try
{
encoder->init(NULL, format, codecOptions);
}
catch (const std::exception& e)
{
cout << "Error: " << e.what() << "\n";
return 1;
}
*/
return encoder;
/* try
{
encoder->init(NULL, format, codecOptions);
}
catch (const std::exception& e)
{
cout << "Error: " << e.what() << "\n";
return 1;
}
*/
}