Cleanup Snapserver includes

This commit is contained in:
badaix 2024-04-04 19:02:45 +02:00
parent d1a4677970
commit 6f040d3d22
53 changed files with 234 additions and 245 deletions

View file

@ -202,12 +202,12 @@ bool BrowseBonjour::browse(const string& serviceName, mDNSResult& result, int /*
service.get(), 0, 0, serviceName.c_str(), "local.", service.get(), 0, 0, serviceName.c_str(), "local.",
[](DNSServiceRef /*service*/, DNSServiceFlags /*flags*/, uint32_t /*interfaceIndex*/, DNSServiceErrorType errorCode, const char* serviceName, [](DNSServiceRef /*service*/, DNSServiceFlags /*flags*/, uint32_t /*interfaceIndex*/, DNSServiceErrorType errorCode, const char* serviceName,
const char* regtype, const char* replyDomain, void* context) const char* regtype, const char* replyDomain, void* context)
{ {
auto replyCollection = static_cast<deque<mDNSReply>*>(context); auto replyCollection = static_cast<deque<mDNSReply>*>(context);
CHECKED(errorCode); CHECKED(errorCode);
replyCollection->push_back(mDNSReply{string(serviceName), string(regtype), string(replyDomain)}); replyCollection->push_back(mDNSReply{string(serviceName), string(regtype), string(replyDomain)});
}, },
&replyCollection)); &replyCollection));
runService(service); runService(service);
@ -222,12 +222,12 @@ bool BrowseBonjour::browse(const string& serviceName, mDNSResult& result, int /*
service.get(), 0, 0, reply.name.c_str(), reply.regtype.c_str(), reply.domain.c_str(), service.get(), 0, 0, reply.name.c_str(), reply.regtype.c_str(), reply.domain.c_str(),
[](DNSServiceRef /*service*/, DNSServiceFlags /*flags*/, uint32_t /*interfaceIndex*/, DNSServiceErrorType errorCode, const char* /*fullName*/, [](DNSServiceRef /*service*/, DNSServiceFlags /*flags*/, uint32_t /*interfaceIndex*/, DNSServiceErrorType errorCode, const char* /*fullName*/,
const char* hosttarget, uint16_t port, uint16_t /*txtLen*/, const unsigned char* /*txtRecord*/, void* context) const char* hosttarget, uint16_t port, uint16_t /*txtLen*/, const unsigned char* /*txtRecord*/, void* context)
{ {
auto resultCollection = static_cast<deque<mDNSResolve>*>(context); auto resultCollection = static_cast<deque<mDNSResolve>*>(context);
CHECKED(errorCode); CHECKED(errorCode);
resultCollection->push_back(mDNSResolve{string(hosttarget), ntohs(port)}); resultCollection->push_back(mDNSResolve{string(hosttarget), ntohs(port)});
}, },
&resolveCollection)); &resolveCollection));
runService(service); runService(service);
@ -245,7 +245,7 @@ bool BrowseBonjour::browse(const string& serviceName, mDNSResult& result, int /*
service.get(), kDNSServiceFlagsLongLivedQuery, 0, kDNSServiceProtocol_IPv4, resolve.fullName.c_str(), service.get(), kDNSServiceFlagsLongLivedQuery, 0, kDNSServiceProtocol_IPv4, resolve.fullName.c_str(),
[](DNSServiceRef /*service*/, DNSServiceFlags /*flags*/, uint32_t interfaceIndex, DNSServiceErrorType /*errorCode*/, const char* hostname, [](DNSServiceRef /*service*/, DNSServiceFlags /*flags*/, uint32_t interfaceIndex, DNSServiceErrorType /*errorCode*/, const char* hostname,
const sockaddr* address, uint32_t /*ttl*/, void* context) const sockaddr* address, uint32_t /*ttl*/, void* context)
{ {
auto result = static_cast<mDNSResult*>(context); auto result = static_cast<mDNSResult*>(context);
result->host = string(hostname); result->host = string(hostname);
@ -259,7 +259,7 @@ bool BrowseBonjour::browse(const string& serviceName, mDNSResult& result, int /*
else else
return; return;
result->valid = true; result->valid = true;
}, },
&resultCollection[i++])); &resultCollection[i++]));
} }
runService(service); runService(service);

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,11 +16,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// prototype/interface header file
#include "config.hpp" #include "config.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/str_compat.hpp" #include "common/str_compat.hpp"
#include "common/utils/file_utils.hpp" #include "common/utils/file_utils.hpp"
// standard headers
#include <cerrno> #include <cerrno>
#include <fcntl.h> #include <fcntl.h>
#include <fstream> #include <fstream>

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,19 +16,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef CONFIG_HPP #pragma once
#define CONFIG_HPP
// local headers
#include "common/json.hpp"
#include "common/utils.hpp"
#include "common/utils/string_utils.hpp"
// standard headers
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <string> #include <string>
#include <sys/time.h> #include <sys/time.h>
#include <vector> #include <vector>
#include "common/json.hpp"
#include "common/utils.hpp"
#include "common/utils/string_utils.hpp"
namespace strutils = utils::string; namespace strutils = utils::string;
using json = nlohmann::json; using json = nlohmann::json;
@ -404,6 +406,3 @@ private:
std::mutex client_mutex_; std::mutex client_mutex_;
std::string filename_; std::string filename_;
}; };
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2023 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -21,19 +21,16 @@
// local headers // local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/message/time.hpp" #include "common/json.hpp"
#include "common/snap_exception.hpp"
#include "common/utils.hpp"
#include "config.hpp"
#include "control_session_http.hpp" #include "control_session_http.hpp"
#include "control_session_tcp.hpp" #include "control_session_tcp.hpp"
#include "jsonrpcpp.hpp"
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <iostream> #include <iostream>
using namespace std; using namespace std;
using json = nlohmann::json; using json = nlohmann::json;

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef CONTROL_SESSION_TCP_HPP #pragma once
#define CONTROL_SESSION_TCP_HPP
// local headers // local headers
#include "control_session.hpp" #include "control_session.hpp"
@ -60,7 +60,3 @@ protected:
boost::asio::strand<boost::asio::any_io_executor> strand_; boost::asio::strand<boost::asio::any_io_executor> strand_;
std::deque<std::string> messages_; std::deque<std::string> messages_;
}; };
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef CONTROL_SESSION_WS_HPP #pragma once
#define CONTROL_SESSION_WS_HPP
// local headers // local headers
#include "control_session.hpp" #include "control_session.hpp"
@ -73,7 +73,3 @@ protected:
boost::asio::strand<boost::asio::any_io_executor> strand_; boost::asio::strand<boost::asio::any_io_executor> strand_;
std::deque<std::string> messages_; std::deque<std::string> messages_;
}; };
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2023 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef ENCODER_HPP #pragma once
#define ENCODER_HPP
// local headers // local headers
#include "common/message/codec_header.hpp" #include "common/message/codec_header.hpp"
@ -91,5 +90,3 @@ protected:
}; };
} // namespace encoder } // namespace encoder
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,7 +16,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// prototype/interface header file
#include "encoder_factory.hpp" #include "encoder_factory.hpp"
// local headers
#include "null_encoder.hpp" #include "null_encoder.hpp"
#include "pcm_encoder.hpp" #include "pcm_encoder.hpp"
#if defined(HAS_OGG) && defined(HAS_VORBIS) && defined(HAS_VORBIS_ENC) #if defined(HAS_OGG) && defined(HAS_VORBIS) && defined(HAS_VORBIS_ENC)
@ -28,7 +31,6 @@
#if defined(HAS_OPUS) #if defined(HAS_OPUS)
#include "opus_encoder.hpp" #include "opus_encoder.hpp"
#endif #endif
#include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/utils/string_utils.hpp" #include "common/utils/string_utils.hpp"

View file

@ -1,10 +1,31 @@
#ifndef ENCODER_FACTORY_H /***
#define ENCODER_FACTORY_H This file is part of snapcast
Copyright (C) 2014-2024 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/>.
***/
#pragma once
// local headers
#include "encoder.hpp" #include "encoder.hpp"
// standard headers
#include <memory> #include <memory>
#include <string> #include <string>
namespace encoder namespace encoder
{ {
@ -16,5 +37,3 @@ public:
}; };
} // namespace encoder } // namespace encoder
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,12 +16,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include <iostream>
// prototype/interface header file
#include "flac_encoder.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/str_compat.hpp" #include "common/str_compat.hpp"
#include "flac_encoder.hpp"
// 3rd party headers
#include "FLAC/metadata.h"
// standard headers
#include <iostream>
using namespace std; using namespace std;

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2020 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,16 +16,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef FLAC_ENCODER_HPP #pragma once
#define FLAC_ENCODER_HPP
// local headers
#include "encoder.hpp" #include "encoder.hpp"
// 3rd party headers
#include "FLAC/stream_encoder.h"
// standard headers
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "FLAC/metadata.h"
#include "FLAC/stream_encoder.h"
namespace encoder namespace encoder
{ {
@ -56,5 +59,3 @@ protected:
}; };
} // namespace encoder } // namespace encoder
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2020 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,7 +16,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// prototype/interface header file
#include "null_encoder.hpp" #include "null_encoder.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"

View file

@ -16,10 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef NULL_ENCODER_HPP #pragma once
#define NULL_ENCODER_HPP
// local headers
#include "encoder.hpp" #include "encoder.hpp"
namespace encoder namespace encoder
{ {
@ -44,5 +46,3 @@ protected:
}; };
} // namespace encoder } // namespace encoder
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,15 +16,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include <cstring> // prototype/interface header file
#include <iostream> #include "ogg_encoder.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/str_compat.hpp" #include "common/str_compat.hpp"
#include "common/utils.hpp"
#include "common/utils/string_utils.hpp" #include "common/utils/string_utils.hpp"
#include "ogg_encoder.hpp"
// standard headers
#include <cstring>
#include <iostream>
using namespace std; using namespace std;

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2020 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,12 +16,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef OGG_ENCODER_HPP #pragma once
#define OGG_ENCODER_HPP
// local headers
#include "encoder.hpp" #include "encoder.hpp"
// 3rd party headers
#include <ogg/ogg.h> #include <ogg/ogg.h>
#include <vorbis/vorbisenc.h> #include <vorbis/vorbisenc.h>
namespace encoder namespace encoder
{ {
@ -54,5 +58,3 @@ private:
}; };
} // namespace encoder } // namespace encoder
#endif

View file

@ -1,7 +1,7 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2015 Hannes Ellinger Copyright (C) 2015 Hannes Ellinger
Copyright (C) 2016-2021 Johannes Pohl Copyright (C) 2016-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -17,12 +17,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// prototype/interface header file
#include "opus_encoder.hpp" #include "opus_encoder.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/str_compat.hpp" #include "common/str_compat.hpp"
#include "common/utils/string_utils.hpp" #include "common/utils/string_utils.hpp"
using namespace std; using namespace std;
namespace encoder namespace encoder

View file

@ -1,26 +1,29 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2015 Hannes Ellinger Copyright (C) 2015 Hannes Ellinger
Copyright (C) 2016-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef OPUS_ENCODER_HPP #pragma once
#define OPUS_ENCODER_HPP
// local headers
#include "common/resampler.hpp" #include "common/resampler.hpp"
#include "encoder.hpp" #include "encoder.hpp"
// 3rd party headers
#include <opus/opus.h> #include <opus/opus.h>
@ -49,5 +52,3 @@ protected:
}; };
} // namespace encoder } // namespace encoder
#endif

View file

@ -16,9 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// prototype/interface header file
#include "pcm_encoder.hpp" #include "pcm_encoder.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/endian.hpp" #include "common/endian.hpp"
// standard headers
#include <memory> #include <memory>

View file

@ -16,10 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef PCM_ENCODER_HPP #pragma once
#define PCM_ENCODER_HPP
// local headers
#include "encoder.hpp" #include "encoder.hpp"
namespace encoder namespace encoder
{ {
@ -35,5 +37,3 @@ protected:
}; };
} // namespace encoder } // namespace encoder
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef IMAGE_CACHE_HPP #pragma once
#define IMAGE_CACHE_HPP
// 3rd party headers // 3rd party headers
@ -25,11 +24,9 @@
#include <boost/uuid/detail/md5.hpp> #include <boost/uuid/detail/md5.hpp>
// standard headers // standard headers
#include <iostream>
#include <map> #include <map>
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <regex>
#include <string> #include <string>
@ -95,6 +92,3 @@ private:
std::map<std::string, std::string> url_to_data_; std::map<std::string, std::string> url_to_data_;
std::mutex mutex_; std::mutex mutex_;
}; };
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -25,8 +25,6 @@
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <cstdio>
#include <cstdlib>
static constexpr auto LOG_TAG = "Avahi"; static constexpr auto LOG_TAG = "Avahi";

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,9 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#pragma once
#ifndef PUBLISH_AVAHI_HPP
#define PUBLISH_AVAHI_HPP
// local headers // local headers
@ -33,10 +32,10 @@
#include <boost/asio/steady_timer.hpp> #include <boost/asio/steady_timer.hpp>
// standard headers // standard headers
#include <atomic>
#include <string> #include <string>
#include <vector> #include <vector>
class PublishAvahi; class PublishAvahi;
#include "publish_mdns.hpp" #include "publish_mdns.hpp"
@ -57,6 +56,3 @@ private:
std::vector<mDNSService> services_; std::vector<mDNSService> services_;
boost::asio::steady_timer timer_; boost::asio::steady_timer timer_;
}; };
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,9 +16,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#pragma once
#ifndef PUBLISH_BONJOUR_HPP class PublishBonjour;
#define PUBLISH_BONJOUR_HPP
// local headers
#include "publish_mdns.hpp"
// 3rd party headers // 3rd party headers
#include <dns_sd.h> #include <dns_sd.h>
@ -27,9 +30,6 @@
#include <string> #include <string>
#include <thread> #include <thread>
class PublishBonjour;
#include "publish_mdns.hpp"
class PublishBonjour : public PublishmDNS class PublishBonjour : public PublishmDNS
{ {
@ -44,6 +44,3 @@ private:
std::atomic<bool> active_; std::atomic<bool> active_;
std::vector<DNSServiceRef> clients; std::vector<DNSServiceRef> clients;
}; };
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef PUBLISH_MDNS_HPP #pragma once
#define PUBLISH_MDNS_HPP
// 3rd party headers // 3rd party headers
#include <boost/asio/io_context.hpp> #include <boost/asio/io_context.hpp>
@ -61,5 +61,3 @@ using PublishZeroConf = PublishAvahi;
#include "publish_bonjour.hpp" #include "publish_bonjour.hpp"
using PublishZeroConf = PublishBonjour; using PublishZeroConf = PublishBonjour;
#endif #endif
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2023 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -21,13 +21,13 @@
// local headers // local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/message/pcm_chunk.hpp"
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <iostream> #include <iostream>
using namespace std; using namespace std;
using namespace streamreader; using namespace streamreader;

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef STREAM_SESSION_TCP_HPP #pragma once
#define STREAM_SESSION_TCP_HPP
// local headers // local headers
#include "stream_session.hpp" #include "stream_session.hpp"
@ -53,7 +53,3 @@ protected:
private: private:
tcp::socket socket_; tcp::socket socket_;
}; };
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef STREAM_SESSION_WS_HPP #pragma once
#define STREAM_SESSION_WS_HPP
// local headers // local headers
#include "stream_session.hpp" #include "stream_session.hpp"
@ -35,7 +35,7 @@
#include <boost/beast/websocket.hpp> #include <boost/beast/websocket.hpp>
// standard headers // standard headers
#include <deque>
namespace beast = boost::beast; // from <boost/beast.hpp> namespace beast = boost::beast; // from <boost/beast.hpp>
// namespace http = beast::http; // from <boost/beast/http.hpp> // namespace http = beast::http; // from <boost/beast/http.hpp>
@ -69,7 +69,3 @@ protected:
protected: protected:
beast::flat_buffer buffer_; beast::flat_buffer buffer_;
}; };
#endif

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef AIRPLAY_STREAM_HPP #pragma once
#define AIRPLAY_STREAM_HPP
// local headers // local headers
#include "process_stream.hpp" #include "process_stream.hpp"
@ -107,5 +107,3 @@ private:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef ALSA_STREAM_HPP #pragma once
#define ALSA_STREAM_HPP
// local headers // local headers
#include "pcm_stream.hpp" #include "pcm_stream.hpp"
@ -68,5 +68,3 @@ protected:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef ASIO_STREAM_HPP #pragma once
#define ASIO_STREAM_HPP
// local headers // local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
@ -30,7 +30,6 @@
#include <boost/asio/steady_timer.hpp> #include <boost/asio/steady_timer.hpp>
// standard headers // standard headers
#include <atomic>
namespace streamreader namespace streamreader
@ -268,5 +267,3 @@ void AsioStream<ReadStream>::do_read()
} }
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -24,6 +24,7 @@
René Nyffenegger rene.nyffenegger@adp-gmbh.ch René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/ */
#include "base64.h" #include "base64.h"
static const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" static const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

View file

@ -16,10 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef BASE64_H #pragma once
#define BASE64_H
#include <string> #include <string>
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len); std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len);
std::string base64_decode(std::string const& encoded_string); std::string base64_decode(std::string const& encoded_string);
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// prototype/interface header file
#include "control_error.hpp" #include "control_error.hpp"
namespace snapcast::error::control namespace snapcast::error::control
{ {

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef FILE_STREAM_HPP #pragma once
#define FILE_STREAM_HPP
// local headers // local headers
#include "asio_stream.hpp" #include "asio_stream.hpp"
@ -44,5 +44,3 @@ protected:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef SPOTIFY_STREAM_HPP #pragma once
#define SPOTIFY_STREAM_HPP
// local headers // local headers
#include "process_stream.hpp" #include "process_stream.hpp"
@ -48,5 +48,3 @@ protected:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -23,7 +23,6 @@
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/utils/string_utils.hpp" #include "common/utils/string_utils.hpp"
#include "encoder/encoder_factory.hpp"
using namespace std; using namespace std;

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef META_STREAM_HPP #pragma once
#define META_STREAM_HPP
// local headers // local headers
#include "common/resampler.hpp" #include "common/resampler.hpp"
@ -84,5 +84,3 @@ protected:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// prototype/interface header file
#include "metadata.hpp" #include "metadata.hpp"
// local headers
#include "common/aixlog.hpp"
// standard headers
#include <set>
static constexpr auto LOG_TAG = "Metadata"; static constexpr auto LOG_TAG = "Metadata";

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,16 +16,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef METADATA_HPP #pragma once
#define METADATA_HPP
#include "common/aixlog.hpp"
// local headers
#include "common/json.hpp" #include "common/json.hpp"
// standard headers
#include <optional> #include <optional>
#include <set>
#include <string> #include <string>
using json = nlohmann::json; using json = nlohmann::json;
class Metadata class Metadata
@ -145,6 +146,3 @@ public:
void fromJson(const json& j); void fromJson(const json& j);
bool operator==(const Metadata& other) const; bool operator==(const Metadata& other) const;
}; };
#endif

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef PCM_STREAM_HPP #pragma once
#define PCM_STREAM_HPP
// local headers // local headers
#include "common/error_code.hpp" #include "common/error_code.hpp"
@ -207,7 +207,4 @@ protected:
std::vector<char> silent_chunk_; std::vector<char> silent_chunk_;
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef PIPE_STREAM_HPP #pragma once
#define PIPE_STREAM_HPP
// local headers // local headers
#include "asio_stream.hpp" #include "asio_stream.hpp"
@ -45,5 +45,3 @@ protected:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -25,10 +25,8 @@
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/utils.hpp" #include "common/utils.hpp"
#include "common/utils/file_utils.hpp" #include "common/utils/file_utils.hpp"
#include "common/utils/string_utils.hpp"
// standard headers // standard headers
#include <climits>
#include <cstdio> #include <cstdio>

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef PROCESS_STREAM_HPP #pragma once
#define PROCESS_STREAM_HPP
// local headers // local headers
#include "asio_stream.hpp" #include "asio_stream.hpp"
@ -26,7 +26,6 @@
// standard headers // standard headers
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector>
namespace bp = boost::process; namespace bp = boost::process;
@ -78,5 +77,3 @@ protected:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// prototype/interface header file
#include "properties.hpp" #include "properties.hpp"
// local headers
#include "common/aixlog.hpp"
// standard headers
#include <set>
static constexpr auto LOG_TAG = "Properties"; static constexpr auto LOG_TAG = "Properties";
namespace namespace

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2021 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,17 +16,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef PROPERTIES_HPP #pragma once
#define PROPERTIES_HPP
// local headers // local headers
#include "common/aixlog.hpp"
#include "common/json.hpp" #include "common/json.hpp"
#include "metadata.hpp" #include "metadata.hpp"
// standard headers // standard headers
#include <optional> #include <optional>
#include <set>
#include <string> #include <string>
@ -191,6 +189,3 @@ public:
void fromJson(const json& j); void fromJson(const json& j);
bool operator==(const Properties& other) const; bool operator==(const Properties& other) const;
}; };
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -22,10 +22,7 @@
// local headers // local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/str_compat.hpp"
#include "common/utils/file_utils.hpp" #include "common/utils/file_utils.hpp"
#include "common/utils/string_utils.hpp"
#include "encoder/encoder_factory.hpp"
// 3rd party headers // 3rd party headers
#include <boost/asio/read_until.hpp> #include <boost/asio/read_until.hpp>

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef STREAM_CONTROL_HPP #pragma once
#define STREAM_CONTROL_HPP
// local headers // local headers
#include "jsonrpcpp.hpp" #include "jsonrpcpp.hpp"
@ -111,7 +111,4 @@ protected:
bp::opstream in_; bp::opstream in_;
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -24,10 +24,8 @@
#ifdef HAS_ALSA #ifdef HAS_ALSA
#include "alsa_stream.hpp" #include "alsa_stream.hpp"
#endif #endif
#include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include "common/str_compat.hpp" #include "common/str_compat.hpp"
#include "common/utils.hpp"
#include "file_stream.hpp" #include "file_stream.hpp"
#include "librespot_stream.hpp" #include "librespot_stream.hpp"
#include "meta_stream.hpp" #include "meta_stream.hpp"

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef STREAM_MANAGER_HPP #pragma once
#define STREAM_MANAGER_HPP
// local headers // local headers
#include "pcm_stream.hpp" #include "pcm_stream.hpp"
@ -59,5 +59,3 @@ private:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2020 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -20,9 +20,11 @@
#define NOMINMAX #define NOMINMAX
#endif // NOMINMAX #endif // NOMINMAX
// prototype/interface header file
#include "stream_uri.hpp" #include "stream_uri.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/str_compat.hpp"
#include "common/utils/string_utils.hpp" #include "common/utils/string_utils.hpp"

View file

@ -16,14 +16,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef STREAM_URI_HPP #pragma once
#define STREAM_URI_HPP
// local headers
#include "common/json.hpp"
// standard headers
#include <map> #include <map>
#include <string> #include <string>
#include "common/json.hpp"
using json = nlohmann::json; using json = nlohmann::json;
@ -59,5 +61,3 @@ struct StreamUri
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -16,8 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef TCP_STREAM_HPP #pragma once
#define TCP_STREAM_HPP
// local headers // local headers
#include "asio_stream.hpp" #include "asio_stream.hpp"
@ -53,5 +53,3 @@ protected:
}; };
} // namespace streamreader } // namespace streamreader
#endif

View file

@ -1,6 +1,6 @@
/*** /***
This file is part of snapcast This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl Copyright (C) 2014-2024 Johannes Pohl
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -16,15 +16,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#ifndef WATCH_DOG_HPP #pragma once
#define WATCH_DOG_HPP
// 3rd party headers // 3rd party headers
#include <boost/asio/any_io_executor.hpp> #include <boost/asio/any_io_executor.hpp>
#include <boost/asio/steady_timer.hpp> #include <boost/asio/steady_timer.hpp>
// standard headers // standard headers
#include <memory>
namespace streamreader namespace streamreader
@ -58,5 +57,3 @@ private:
}; };
} // namespace streamreader } // namespace streamreader
#endif