From 56c8a3f6930bfbcb72e1828d7c793e4f1152b0ae Mon Sep 17 00:00:00 2001 From: badaix Date: Sun, 22 Jan 2023 11:34:02 +0100 Subject: [PATCH] Fix common/message includes --- client/CMakeLists.txt | 2 +- client/client_connection.cpp | 4 ++-- client/client_connection.hpp | 6 +++--- client/controller.cpp | 10 +++++----- client/controller.hpp | 6 +++--- client/decoder/decoder.hpp | 18 +++++++++++------- client/decoder/ogg_decoder.cpp | 18 +++++++++++++----- client/stream.hpp | 19 ++++++++++++------- client/time_provider.hpp | 16 +++++++++------- server/streamreader/control_error.hpp | 9 +++------ server/streamreader/file_stream.cpp | 4 +++- server/streamreader/librespot_stream.cpp | 2 +- 12 files changed, 66 insertions(+), 48 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index c257d0b6..f3eb3cdf 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -12,7 +12,7 @@ set(CLIENT_SOURCES set(CLIENT_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ${ATOMIC_LIBRARY} common) set(CLIENT_INCLUDE ${Boost_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/client - ${CMAKE_SOURCE_DIR}/common) + ${CMAKE_SOURCE_DIR}) if(MACOSX) # Bonjour diff --git a/client/client_connection.cpp b/client/client_connection.cpp index f975478a..74d89c0f 100644 --- a/client/client_connection.cpp +++ b/client/client_connection.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2022 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -21,9 +21,9 @@ // local headers #include "common/aixlog.hpp" +#include "common/message/hello.hpp" #include "common/snap_exception.hpp" #include "common/str_compat.hpp" -#include "message/hello.hpp" // 3rd party headers #include diff --git a/client/client_connection.hpp b/client/client_connection.hpp index 0d906a6a..9f542f9c 100644 --- a/client/client_connection.hpp +++ b/client/client_connection.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2022 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -21,9 +21,9 @@ // local headers #include "client_settings.hpp" +#include "common/message/factory.hpp" +#include "common/message/message.hpp" #include "common/time_defs.hpp" -#include "message/factory.hpp" -#include "message/message.hpp" // 3rd party headers #include diff --git a/client/controller.cpp b/client/controller.cpp index cc55a658..13bc8919 100644 --- a/client/controller.cpp +++ b/client/controller.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2022 Johannes Pohl + Copyright (C) 2014-2023 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,8 +24,8 @@ #include "controller.hpp" // local headers -#include "decoder/pcm_decoder.hpp" #include "decoder/null_decoder.hpp" +#include "decoder/pcm_decoder.hpp" #if defined(HAS_OGG) && (defined(HAS_TREMOR) || defined(HAS_VORBIS)) #include "decoder/ogg_decoder.hpp" #endif @@ -58,10 +58,10 @@ #include "browseZeroConf/browse_mdns.hpp" #include "common/aixlog.hpp" +#include "common/message/client_info.hpp" +#include "common/message/hello.hpp" +#include "common/message/time.hpp" #include "common/snap_exception.hpp" -#include "message/client_info.hpp" -#include "message/hello.hpp" -#include "message/time.hpp" #include "time_provider.hpp" // standard headers diff --git a/client/controller.hpp b/client/controller.hpp index 358da6c0..2daf9088 100644 --- a/client/controller.hpp +++ b/client/controller.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2021 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -22,9 +22,9 @@ // local headers #include "client_connection.hpp" #include "client_settings.hpp" +#include "common/message/message.hpp" +#include "common/message/server_settings.hpp" #include "decoder/decoder.hpp" -#include "message/message.hpp" -#include "message/server_settings.hpp" #include "player/player.hpp" #include "stream.hpp" diff --git a/client/decoder/decoder.hpp b/client/decoder/decoder.hpp index 61b5fe78..679059b5 100644 --- a/client/decoder/decoder.hpp +++ b/client/decoder/decoder.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -16,11 +16,17 @@ along with this program. If not, see . ***/ -#ifndef DECODER_H -#define DECODER_H +#pragma once + + +// local headers +#include "common/message/codec_header.hpp" +#include "common/message/pcm_chunk.hpp" #include "common/sample_format.hpp" -#include "message/codec_header.hpp" -#include "message/pcm_chunk.hpp" + +// 3rd party headers + +// standard headers #include namespace decoder @@ -40,5 +46,3 @@ protected: }; } // namespace decoder - -#endif diff --git a/client/decoder/ogg_decoder.cpp b/client/decoder/ogg_decoder.cpp index b583ef16..8540fcbe 100644 --- a/client/decoder/ogg_decoder.cpp +++ b/client/decoder/ogg_decoder.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2021 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -16,15 +16,23 @@ along with this program. If not, see . ***/ + +// prototype/interface header file +#include "ogg_decoder.hpp" + +// local headers +#include "common/aixlog.hpp" +#include "common/endian.hpp" +#include "common/snap_exception.hpp" + +// 3rd party headers + +// standard headers #include #include #include #include -#include "common/aixlog.hpp" -#include "common/endian.hpp" -#include "common/snap_exception.hpp" -#include "ogg_decoder.hpp" using namespace std; diff --git a/client/stream.hpp b/client/stream.hpp index 28c6b09d..ce8a9f12 100644 --- a/client/stream.hpp +++ b/client/stream.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2021 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -19,6 +19,17 @@ #ifndef STREAM_HPP #define STREAM_HPP +// local headers +#include "common/message/message.hpp" +#include "common/message/pcm_chunk.hpp" +#include "common/queue.h" +#include "common/resampler.hpp" +#include "common/sample_format.hpp" +#include "double_buffer.hpp" + +// 3rd party headers + +// standard headers #include #include #include @@ -27,12 +38,6 @@ #include #endif -#include "common/queue.h" -#include "common/sample_format.hpp" -#include "double_buffer.hpp" -#include "message/message.hpp" -#include "message/pcm_chunk.hpp" -#include "resampler.hpp" /// Time synchronized audio stream /** diff --git a/client/time_provider.hpp b/client/time_provider.hpp index 7d1476b9..5a0b6ef0 100644 --- a/client/time_provider.hpp +++ b/client/time_provider.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -16,12 +16,17 @@ along with this program. If not, see . ***/ -#ifndef TIME_PROVIDER_H -#define TIME_PROVIDER_H +#pragma once + +// local headers +#include "common/message/message.hpp" #include "common/time_defs.hpp" #include "double_buffer.hpp" -#include "message/message.hpp" + +// 3rd party headers + +// standard headers #include #include @@ -84,6 +89,3 @@ private: DoubleBuffer diffBuffer_; std::atomic diffToServer_; }; - - -#endif diff --git a/server/streamreader/control_error.hpp b/server/streamreader/control_error.hpp index feff4387..0a450c9a 100644 --- a/server/streamreader/control_error.hpp +++ b/server/streamreader/control_error.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2021 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -16,10 +16,10 @@ along with this program. If not, see . ***/ -#ifndef STREAMREADER_ERROR_HPP -#define STREAMREADER_ERROR_HPP +#pragma once +// standard headers #include @@ -77,6 +77,3 @@ struct is_error_code_enum : public std::true_type } // namespace std std::error_code make_error_code(ControlErrc); - - -#endif diff --git a/server/streamreader/file_stream.cpp b/server/streamreader/file_stream.cpp index 2300ccc2..1a545ea5 100644 --- a/server/streamreader/file_stream.cpp +++ b/server/streamreader/file_stream.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2021 Johannes Pohl + Copyright (C) 2014-2023 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 @@ -25,6 +25,8 @@ #include "encoder/encoder_factory.hpp" // 3rd party headers + +// standard headers #include diff --git a/server/streamreader/librespot_stream.cpp b/server/streamreader/librespot_stream.cpp index 137e1be6..29838d6b 100644 --- a/server/streamreader/librespot_stream.cpp +++ b/server/streamreader/librespot_stream.cpp @@ -187,7 +187,7 @@ void LibrespotStream::onStderrMsg(const std::string& line) size_t ms_pos = 0; size_t n = 0; if (((title_pos = line.find("<")) != std::string::npos) && ((n = line.find(">", title_pos)) != std::string::npos) && - ((ms_pos = line.find("(", n)) != std::string::npos) && ((n = line.find("ms) loaded", ms_pos)) != std::string::npos)) + ((ms_pos = line.find("(", n)) != std::string::npos) && ((n = line.find("ms) loaded", ms_pos)) != std::string::npos)) { title_pos += 1; std::string title = line.substr(title_pos, line.find(">", title_pos) - title_pos);