Cleanup Snapclient includes

This commit is contained in:
badaix 2024-04-03 21:50:03 +02:00
parent 241bf4913d
commit aa82ba8397
59 changed files with 317 additions and 344 deletions

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,13 +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/>.
***/ ***/
// prototype/interface header file
#include "browse_avahi.hpp" #include "browse_avahi.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
// standard headers
#include <cassert> #include <cassert>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream> #include <iostream>

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
@ -15,19 +15,21 @@
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 BROWSEAVAHI_H
#define BROWSEAVAHI_H
#pragma once
class BrowseAvahi;
// local headers
#include "browse_mdns.hpp"
// 3rd party headers
#include <avahi-client/client.h> #include <avahi-client/client.h>
#include <avahi-client/lookup.h> #include <avahi-client/lookup.h>
#include <avahi-common/error.h> #include <avahi-common/error.h>
#include <avahi-common/malloc.h> #include <avahi-common/malloc.h>
#include <avahi-common/simple-watch.h> #include <avahi-common/simple-watch.h>
class BrowseAvahi;
#include "browse_mdns.hpp"
class BrowseAvahi : public BrowsemDNS class BrowseAvahi : public BrowsemDNS
{ {
@ -49,5 +51,3 @@ private:
mDNSResult result_; mDNSResult result_;
AvahiServiceBrowser* sb_; AvahiServiceBrowser* sb_;
}; };
#endif

View file

@ -1,8 +1,30 @@
/***
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/>.
***/
// prototype/interface header file
#include "browse_bonjour.hpp" #include "browse_bonjour.hpp"
#include <deque> // local headers
#include "common/aixlog.hpp"
// standard headers
#include <iostream> #include <iostream>
#include <memory>
#ifdef WINDOWS #ifdef WINDOWS
#include <WinSock2.h> #include <WinSock2.h>
#include <Ws2tcpip.h> #include <Ws2tcpip.h>
@ -11,8 +33,6 @@
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#include "common/aixlog.hpp"
#include "common/snap_exception.hpp"
using namespace std; using namespace std;

View file

@ -1,15 +1,34 @@
#ifndef BROWSEBONJOUR_H /***
#define BROWSEBONJOUR_H This file is part of snapcast
Copyright (C) 2014-2024 Johannes Pohl
#include <dns_sd.h> 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
class BrowseBonjour; class BrowseBonjour;
// local headers
#include "browse_mdns.hpp" #include "browse_mdns.hpp"
// 3rd party headers
#include <dns_sd.h>
class BrowseBonjour : public BrowsemDNS class BrowseBonjour : public BrowsemDNS
{ {
public: public:
bool browse(const std::string& serviceName, mDNSResult& result, int timeout) override; bool browse(const std::string& serviceName, mDNSResult& result, int timeout) override;
}; };
#endif

View file

@ -1,6 +1,24 @@
#ifndef BROWSEMDNS_H /***
#define BROWSEMDNS_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
// standard headers
#include <string> #include <string>
enum IPVersion enum IPVersion
@ -37,5 +55,3 @@ using BrowseZeroConf = BrowseAvahi;
#include "browse_bonjour.hpp" #include "browse_bonjour.hpp"
using BrowseZeroConf = BrowseBonjour; using BrowseZeroConf = BrowseBonjour;
#endif #endif
#endif

View file

@ -21,8 +21,6 @@
// local headers // local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/message/hello.hpp"
#include "common/snap_exception.hpp"
#include "common/str_compat.hpp" #include "common/str_compat.hpp"
// 3rd party headers // 3rd party headers
@ -32,7 +30,6 @@
// standard headers // standard headers
#include <iostream> #include <iostream>
#include <mutex>
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-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 CLIENT_CONNECTION_HPP #pragma once
#define CLIENT_CONNECTION_HPP
// local headers // local headers
#include "client_settings.hpp" #include "client_settings.hpp"
@ -32,14 +31,9 @@
#include <boost/asio/strand.hpp> #include <boost/asio/strand.hpp>
// standard headers // standard headers
#include <atomic>
#include <condition_variable>
#include <deque> #include <deque>
#include <memory> #include <memory>
#include <mutex>
#include <set>
#include <string> #include <string>
#include <thread>
using boost::asio::ip::tcp; using boost::asio::ip::tcp;
@ -159,7 +153,3 @@ protected:
}; };
std::deque<PendingMessage> messages_; std::deque<PendingMessage> messages_;
}; };
#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,15 +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 CLIENT_SETTINGS_HPP #pragma once
#define CLIENT_SETTINGS_HPP
#include <string>
#include <vector>
// local headers
#include "common/sample_format.hpp" #include "common/sample_format.hpp"
#include "player/pcm_device.hpp" #include "player/pcm_device.hpp"
// standard headers
#include <string>
struct ClientSettings struct ClientSettings
{ {
@ -79,5 +80,3 @@ struct ClientSettings
Player player; Player player;
Logging logging; Logging logging;
}; };
#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,13 +16,11 @@
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 CONTROLLER_HPP #pragma once
#define CONTROLLER_HPP
// local headers // local headers
#include "client_connection.hpp" #include "client_connection.hpp"
#include "client_settings.hpp" #include "client_settings.hpp"
#include "common/message/message.hpp"
#include "common/message/server_settings.hpp" #include "common/message/server_settings.hpp"
#include "decoder/decoder.hpp" #include "decoder/decoder.hpp"
#include "player/player.hpp" #include "player/player.hpp"
@ -31,8 +29,7 @@
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <atomic>
#include <thread>
using namespace std::chrono_literals; using namespace std::chrono_literals;
@ -75,6 +72,3 @@ private:
std::unique_ptr<msg::ServerSettings> serverSettings_; std::unique_ptr<msg::ServerSettings> serverSettings_;
std::unique_ptr<msg::CodecHeader> headerChunk_; std::unique_ptr<msg::CodecHeader> headerChunk_;
}; };
#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,11 +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/>.
***/ ***/
// prototype/interface header file
#include "flac_decoder.hpp" #include "flac_decoder.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/endian.hpp" #include "common/endian.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
#include <cmath>
// standard headers
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>

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,15 +16,18 @@
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_DECODER_H #pragma once
#define FLAC_DECODER_H
// local headers
#include "decoder.hpp" #include "decoder.hpp"
// 3rd party headers
#include <FLAC/stream_decoder.h> #include <FLAC/stream_decoder.h>
#include <atomic>
// standard headers
#include <memory> #include <memory>
namespace decoder namespace decoder
{ {
@ -60,5 +63,3 @@ public:
}; };
} // namespace decoder } // namespace decoder
#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
@ -20,9 +20,6 @@
#include "null_decoder.hpp" #include "null_decoder.hpp"
// local headers // local headers
#include "common/aixlog.hpp"
#include "common/endian.hpp"
#include "common/snap_exception.hpp"
// 3rd party headers // 3rd party headers

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
@ -28,10 +28,8 @@
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <cmath>
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
#include <iostream>

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,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/>.
***/ ***/
#ifndef OGG_DECODER_H #pragma once
#define OGG_DECODER_H
// local headers
#include "decoder.hpp" #include "decoder.hpp"
// 3rd party headers
#ifdef HAS_TREMOR #ifdef HAS_TREMOR
#include <tremor/ivorbiscodec.h> #include <tremor/ivorbiscodec.h>
#else #else
@ -64,5 +67,3 @@ private:
}; };
} // namespace decoder } // namespace decoder
#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,10 +17,13 @@
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_decoder.hpp" #include "opus_decoder.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"
namespace decoder namespace decoder
{ {

View file

@ -1,6 +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-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
@ -18,9 +19,16 @@
#pragma once #pragma once
// local headers
#include "decoder/decoder.hpp" #include "decoder/decoder.hpp"
// 3rd party headers
#include <opus/opus.h> #include <opus/opus.h>
// standard headers
#include <vector>
namespace decoder namespace decoder
{ {

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,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_decoder.hpp" #include "pcm_decoder.hpp"
#include "common/aixlog.hpp"
// local headers
#include "common/endian.hpp" #include "common/endian.hpp"
#include "common/snap_exception.hpp" #include "common/snap_exception.hpp"
namespace decoder namespace decoder
{ {

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,8 +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 PCM_DECODER_H #pragma once
#define PCM_DECODER_H
// local headers
#include "decoder.hpp" #include "decoder.hpp"
@ -33,5 +34,3 @@ public:
}; };
} // namespace decoder } // namespace decoder
#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
@ -22,6 +22,8 @@
// standard headers // standard headers
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <cstddef>
#include <cstdint>
#include <deque> #include <deque>

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,11 +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 METADATA_H #pragma once
#define METADATA_H
// local headers
#include "common/json.hpp" #include "common/json.hpp"
// standard headers
#include <iostream>
// Prefix used in output // Prefix used in output
#define METADATA std::string("metadata") #define METADATA std::string("metadata")
@ -99,5 +103,3 @@ public:
return 0; return 0;
} }
}; };
#endif

View file

@ -29,6 +29,8 @@
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <chrono>
using namespace std::chrono_literals; using namespace std::chrono_literals;
using namespace std; using namespace std;

View file

@ -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 ALSA_PLAYER_HPP #pragma once
#define ALSA_PLAYER_HPP
// local headers // local headers
#include "player.hpp" #include "player.hpp"
@ -30,6 +29,7 @@
// standard headers // standard headers
#include <chrono> #include <chrono>
#include <optional> #include <optional>
#include <vector>
namespace player namespace player
@ -94,5 +94,3 @@ private:
}; };
} // namespace player } // namespace player
#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
@ -28,8 +28,7 @@
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <cassert>
#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-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
@ -21,13 +21,10 @@
// local headers // local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/snap_exception.hpp"
#include "common/str_compat.hpp"
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <cassert>
#include <iostream> #include <iostream>

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
@ -27,7 +27,6 @@
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <cassert>
#include <iostream> #include <iostream>

View file

@ -16,12 +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/>.
***/ ***/
#ifndef PLAYER_HPP #pragma once
#define PLAYER_HPP
// local headers // local headers
#include "client_settings.hpp" #include "client_settings.hpp"
#include "common/aixlog.hpp"
#include "common/endian.hpp" #include "common/endian.hpp"
#include "stream.hpp" #include "stream.hpp"
@ -32,9 +30,8 @@
#include <atomic> #include <atomic>
#include <functional> #include <functional>
#include <mutex> #include <mutex>
#include <string>
#include <thread> #include <thread>
#include <vector>
#if !defined(WINDOWS) #if !defined(WINDOWS)
#define SUPPORTS_VOLUME_SCRIPT #define SUPPORTS_VOLUME_SCRIPT
@ -137,5 +134,3 @@ inline bool operator!=(const Player::Volume& lhs, const Player::Volume& rhs)
} }
} // namespace player } // namespace player
#endif

View file

@ -30,7 +30,6 @@
#include <pulse/proplist.h> #include <pulse/proplist.h>
// standard headers // standard headers
#include <cassert>
#include <iostream> #include <iostream>

View file

@ -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 PULSE_PLAYER_HPP #pragma once
#define PULSE_PLAYER_HPP
// local headers // local headers
#include "player.hpp" #include "player.hpp"
@ -91,5 +90,3 @@ protected:
}; };
} // namespace player } // namespace player
#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
@ -26,7 +26,6 @@
// 3rd party headers // 3rd party headers
#include <initguid.h> #include <initguid.h>
#include <mmdeviceapi.h> #include <mmdeviceapi.h>
//#include <functiondiscoverykeys_devpkey.h>
// standard headers // standard headers
#include <audioclient.h> #include <audioclient.h>
@ -37,10 +36,7 @@
#include <mmdeviceapi.h> #include <mmdeviceapi.h>
#include <cassert> #include <cassert>
#include <chrono>
#include <codecvt>
#include <functional>
#include <locale>
using namespace std; using namespace std;
using namespace std::chrono; using namespace std::chrono;

View file

@ -37,7 +37,6 @@
#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/version.hpp" #include "common/version.hpp"
// 3rd party headers // 3rd party headers
@ -45,7 +44,6 @@
#include <boost/asio/signal_set.hpp> #include <boost/asio/signal_set.hpp>
// standard headers // standard headers
#include <chrono>
#include <iostream> #include <iostream>
#ifndef WINDOWS #ifndef WINDOWS
#include <csignal> #include <csignal>

View file

@ -408,7 +408,7 @@ bool Stream::getPlayerChunk(void* outputBuffer, const cs::usec& outputBufferDacT
auto miniMedian = miniBuffer_.median(); auto miniMedian = miniBuffer_.median();
if ((cs::usec(shortMedian_) > kCorrectionBegin) && (cs::usec(miniMedian) > cs::usec(50)) && (cs::usec(age) > cs::usec(50))) if ((cs::usec(shortMedian_) > kCorrectionBegin) && (cs::usec(miniMedian) > cs::usec(50)) && (cs::usec(age) > cs::usec(50)))
{ {
double rate = (shortMedian_ / 100) * 0.00005; double rate = (shortMedian_ / 100.) * 0.00005;
rate = 1.0 - std::min(rate, 0.0005); rate = 1.0 - std::min(rate, 0.0005);
// LOG(INFO, LOG_TAG) << "Rate: " << rate << "\n"; // LOG(INFO, LOG_TAG) << "Rate: " << rate << "\n";
// we are late (age > 0), this means we are not playing fast enough // we are late (age > 0), this means we are not playing fast enough
@ -417,7 +417,7 @@ bool Stream::getPlayerChunk(void* outputBuffer, const cs::usec& outputBufferDacT
} }
else if ((cs::usec(shortMedian_) < -kCorrectionBegin) && (cs::usec(miniMedian) < -cs::usec(50)) && (cs::usec(age) < -cs::usec(50))) else if ((cs::usec(shortMedian_) < -kCorrectionBegin) && (cs::usec(miniMedian) < -cs::usec(50)) && (cs::usec(age) < -cs::usec(50)))
{ {
double rate = (-shortMedian_ / 100) * 0.00005; double rate = (-shortMedian_ / 100.) * 0.00005;
rate = 1.0 + std::min(rate, 0.0005); rate = 1.0 + std::min(rate, 0.0005);
// LOG(INFO, LOG_TAG) << "Rate: " << rate << "\n"; // LOG(INFO, LOG_TAG) << "Rate: " << rate << "\n";
// we are early (age > 0), this means we are playing too fast // we are early (age > 0), this means we are playing too fast

View file

@ -16,29 +16,26 @@
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_HPP #pragma once
#define STREAM_HPP
// local headers // local headers
#include "common/message/message.hpp"
#include "common/message/pcm_chunk.hpp" #include "common/message/pcm_chunk.hpp"
#include "common/queue.h" #include "common/queue.hpp"
#include "common/resampler.hpp" #include "common/resampler.hpp"
#include "common/sample_format.hpp" #include "common/sample_format.hpp"
#include "common/utils/logging.hpp" #include "common/utils/logging.hpp"
#include "double_buffer.hpp" #include "double_buffer.hpp"
// 3rd party headers // 3rd party headers
// standard headers
#include <atomic>
#include <deque>
#include <memory>
#ifdef HAS_SOXR #ifdef HAS_SOXR
#include <soxr.h> #include <soxr.h>
#endif #endif
// standard headers
#include <atomic>
#include <memory>
/// Time synchronized audio stream /// Time synchronized audio stream
/** /**
@ -139,7 +136,3 @@ private:
/// Log "failed to get chunk" only once per second /// Log "failed to get chunk" only once per second
utils::logging::TimeConditional time_cond_; utils::logging::TimeConditional time_cond_;
}; };
#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,9 +16,13 @@
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 "time_provider.hpp" #include "time_provider.hpp"
// local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
// standard headers
#include <chrono> #include <chrono>
static constexpr auto LOG_TAG = "TimeProvider"; static constexpr auto LOG_TAG = "TimeProvider";

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,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/>.
***/ ***/
// prototype/interface header file
#include "daemon.hpp" #include "daemon.hpp"
// local headers
#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/file_utils.hpp" #include "common/utils/file_utils.hpp"
// standard headers
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <fcntl.h> #include <fcntl.h>
#include <grp.h> #include <grp.h>
#include <iostream>
#include <pwd.h> #include <pwd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>

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,9 +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/>.
***/ ***/
#ifndef DAEMON_H #pragma once
#define DAEMON_H
// standard headers
#include <string> #include <string>
@ -36,6 +37,3 @@ private:
std::string group_; std::string group_;
std::string pidfile_; std::string pidfile_;
}; };
#endif // DAEMON_H

View file

@ -1,6 +1,24 @@
#ifndef ENDIAN_HPP /***
#define ENDIAN_HPP 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
// standard headers
#include <cstdint> #include <cstdint>
#ifdef IS_BIG_ENDIAN #ifdef IS_BIG_ENDIAN
@ -43,5 +61,3 @@ inline int64_t swap(const int64_t& val)
return SWAP_64(val); return SWAP_64(val);
} }
} // namespace endian } // namespace endian
#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,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 ERROR_CODE_HPP #pragma once
#define ERROR_CODE_HPP
// standard headers
#include <optional> #include <optional>
#include <string> #include <string>
#include <system_error> #include <system_error>
@ -55,7 +54,3 @@ private:
} // namespace snapcast } // namespace snapcast
#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,23 +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 MESSAGE_FACTORY_HPP #pragma once
#define MESSAGE_FACTORY_HPP
// local headers // local headers
#include "client_info.hpp" #include "client_info.hpp"
#include "codec_header.hpp" #include "codec_header.hpp"
#include "common/str_compat.hpp"
#include "common/utils.hpp"
#include "hello.hpp" #include "hello.hpp"
#include "json_message.hpp"
#include "pcm_chunk.hpp" #include "pcm_chunk.hpp"
#include "server_settings.hpp" #include "server_settings.hpp"
#include "time.hpp" #include "time.hpp"
// standard headers
#include <string>
namespace msg namespace msg
{ {
@ -91,5 +84,3 @@ static std::unique_ptr<BaseMessage> createMessage(const BaseMessage& base_messag
} // namespace factory } // namespace factory
} // namespace msg } // namespace msg
#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 MESSAGE_MESSAGE_HPP #pragma once
#define MESSAGE_MESSAGE_HPP
// local headers // local headers
#include "common/endian.hpp" #include "common/endian.hpp"
@ -32,7 +31,6 @@
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include <memory> #include <memory>
#include <vector>
/* /*
template<typename CharT, typename TraitsT = std::char_traits<CharT> > template<typename CharT, typename TraitsT = std::char_traits<CharT> >
@ -344,5 +342,3 @@ protected:
}; };
} // namespace msg } // namespace msg
#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,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 MESSAGE_WIRE_CHUNK_HPP #pragma once
#define MESSAGE_WIRE_CHUNK_HPP
// local headers // local headers
#include "common/time_defs.hpp" #include "common/time_defs.hpp"
@ -28,8 +27,6 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <streambuf>
#include <vector>
namespace msg namespace msg
@ -95,6 +92,3 @@ protected:
} }
}; };
} // namespace msg } // namespace msg
#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,14 +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 QUEUE_H #pragma once
#define QUEUE_H
// standard headers
#include <atomic> #include <atomic>
#include <condition_variable> #include <condition_variable>
#include <deque> #include <deque>
#include <mutex> #include <mutex>
#include <thread>
template <typename T> template <typename T>
class Queue class Queue
@ -164,6 +164,3 @@ private:
mutable std::mutex mutex_; mutable std::mutex mutex_;
mutable std::condition_variable cond_; mutable std::condition_variable cond_;
}; };
#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,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 "resampler.hpp" #include "resampler.hpp"
#include "common/aixlog.hpp"
#include "common/snap_exception.hpp"
// local headers
#include "common/aixlog.hpp"
// standard headers
#include <cmath> #include <cmath>
using namespace std; using namespace std;
static constexpr auto LOG_TAG = "Resampler"; static constexpr auto LOG_TAG = "Resampler";

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,17 +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 RESAMPLER_HPP #pragma once
#define RESAMPLER_HPP
// local headers
#include "common/message/pcm_chunk.hpp" #include "common/message/pcm_chunk.hpp"
#include "common/sample_format.hpp" #include "common/sample_format.hpp"
#include <deque>
#include <vector> // 3rd party headers
#ifdef HAS_SOXR #ifdef HAS_SOXR
#include <soxr.h> #include <soxr.h>
#endif #endif
// standard headers
#include <vector>
class Resampler class Resampler
{ {
@ -48,5 +52,3 @@ private:
soxr_t soxr_{nullptr}; soxr_t soxr_{nullptr};
#endif #endif
}; };
#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,17 +16,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
***/ ***/
// local headers
#include "sample_format.hpp"
#include "common/snap_exception.hpp"
#include "common/str_compat.hpp"
#include "common/utils/string_utils.hpp"
// standard headers
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include "common/aixlog.hpp"
#include "common/snap_exception.hpp"
#include "common/str_compat.hpp"
#include "common/utils.hpp"
#include "common/utils/string_utils.hpp"
#include "sample_format.hpp"
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,9 +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 SAMPLE_FORMAT_H #pragma once
#define SAMPLE_FORMAT_H
// standard headers
#include <cstdint> #include <cstdint>
#include <string> #include <string>
@ -101,6 +101,3 @@ private:
uint16_t bits_; uint16_t bits_;
uint16_t channels_; uint16_t channels_;
}; };
#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,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 SNAP_EXCEPTION_HPP #pragma once
#define SNAP_EXCEPTION_HPP
#include <cstring> // std::strlen, std::strcpy // standard headers
#include <exception> #include <exception>
#include <string> #include <string>
@ -50,6 +49,3 @@ public:
return text_.c_str(); return text_.c_str();
} }
}; };
#endif

View file

@ -1,7 +1,25 @@
#ifndef COMPAT_H /***
#define COMPAT_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
// standard headers
#include <clocale> #include <clocale>
#include <string> #include <string>
@ -114,6 +132,3 @@ static float strtof(const char* str, char** endptr)
#endif #endif
} }
} // namespace cpt } // namespace cpt
#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,9 +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/>.
***/ ***/
#ifndef TIME_DEFS_H #pragma once
#define TIME_DEFS_H
// standard headers
#include <chrono> #include <chrono>
#include <thread> #include <thread>
#ifdef MACOS #ifdef MACOS
@ -34,6 +35,7 @@
#include <winsock2.h> #include <winsock2.h>
#endif #endif
namespace chronos namespace chronos
{ {
using clk = using clk =
@ -159,6 +161,3 @@ inline void usleep(const int32_t& microseconds)
sleep(usec(microseconds)); sleep(usec(microseconds));
} }
} // namespace chronos } // namespace chronos
#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,21 +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 UTILS_H #pragma once
#define UTILS_H
#include "common/str_compat.hpp"
// local headers
#include "common/utils/string_utils.hpp" #include "common/utils/string_utils.hpp"
#include <cctype> // standard headers
#include <cerrno>
// #include <chrono>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>
#include <functional>
#include <iomanip> #include <iomanip>
#include <iterator>
#include <locale>
#include <memory> #include <memory>
#ifndef WINDOWS #ifndef WINDOWS
#include <net/if.h> #include <net/if.h>
@ -43,7 +38,6 @@
#include <string> #include <string>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <vector>
#if !defined(WINDOWS) && !defined(FREEBSD) #if !defined(WINDOWS) && !defined(FREEBSD)
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#endif #endif
@ -463,6 +457,3 @@ static std::string getHostId(const std::string& defaultId = "")
/// The host name should be unique enough in a LAN /// The host name should be unique enough in a LAN
return getHostName(); return getHostName();
} }
#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,11 +16,13 @@
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 VERSION_HPP #pragma once
#define VERSION_HPP
// standard headers
#include <string> #include <string>
namespace version namespace version
{ {
@ -46,5 +48,3 @@ static std::string rev(std::size_t len = 0)
} }
} // namespace version } // namespace version
#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,15 +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 CONTROL_SERVER_HPP #pragma once
#define CONTROL_SERVER_HPP
// local headers // local headers
#include "common/message/codec_header.hpp"
#include "common/message/message.hpp"
#include "common/message/server_settings.hpp"
#include "common/queue.h"
#include "common/sample_format.hpp"
#include "control_session.hpp" #include "control_session.hpp"
#include "server_settings.hpp" #include "server_settings.hpp"
@ -35,7 +29,6 @@
// standard headers // standard headers
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <set>
#include <vector> #include <vector>
@ -82,7 +75,3 @@ private:
ServerSettings::Http http_settings_; ServerSettings::Http http_settings_;
ControlMessageReceiver* controlMessageReceiver_; ControlMessageReceiver* controlMessageReceiver_;
}; };
#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,21 +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 CONTROL_SESSION_HPP #pragma once
#define CONTROL_SESSION_HPP
// local headers // local headers
#include "common/message/message.hpp"
#include "common/queue.h"
#include "server_settings.hpp"
// 3rd party headers // 3rd party headers
// standard headers // standard headers
#include <atomic> #include <functional>
#include <condition_variable>
#include <memory> #include <memory>
#include <set>
#include <string> #include <string>
@ -72,7 +66,3 @@ public:
protected: protected:
ControlMessageReceiver* message_receiver_; ControlMessageReceiver* message_receiver_;
}; };
#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,11 +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 CONTROL_SESSION_HTTP_HPP #pragma once
#define CONTROL_SESSION_HTTP_HPP
// local headers // local headers
#include "control_session.hpp" #include "control_session.hpp"
#include "server_settings.hpp"
// 3rd party headers // 3rd party headers
#include <boost/beast/core.hpp> #include <boost/beast/core.hpp>
@ -77,7 +78,3 @@ protected:
ServerSettings::Http settings_; ServerSettings::Http settings_;
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,6 +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/>.
***/ ***/
// prototype/interface header file // prototype/interface header file
#include "control_session_tcp.hpp" #include "control_session_tcp.hpp"
@ -25,7 +26,6 @@
// local headers // local headers
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/message/pcm_chunk.hpp"
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-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
@ -23,15 +23,16 @@
#include "common/aixlog.hpp" #include "common/aixlog.hpp"
#include "common/message/client_info.hpp" #include "common/message/client_info.hpp"
#include "common/message/hello.hpp" #include "common/message/hello.hpp"
#include "common/message/server_settings.hpp"
#include "common/message/time.hpp" #include "common/message/time.hpp"
#include "config.hpp" #include "config.hpp"
#include "stream_session_tcp.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-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,15 +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 SERVER_HPP #pragma once
#define SERVER_HPP
// local headers // local headers
#include "common/message/codec_header.hpp"
#include "common/message/message.hpp" #include "common/message/message.hpp"
#include "common/message/server_settings.hpp" #include "common/queue.hpp"
#include "common/queue.h"
#include "common/sample_format.hpp"
#include "control_server.hpp" #include "control_server.hpp"
#include "jsonrpcpp.hpp" #include "jsonrpcpp.hpp"
#include "server_settings.hpp" #include "server_settings.hpp"
@ -38,10 +35,6 @@
// standard headers // standard headers
#include <memory> #include <memory>
#include <mutex>
#include <set>
#include <sstream>
#include <vector>
using namespace streamreader; using namespace streamreader;
@ -102,7 +95,3 @@ private:
std::unique_ptr<StreamServer> streamServer_; std::unique_ptr<StreamServer> streamServer_;
std::unique_ptr<StreamManager> streamManager_; std::unique_ptr<StreamManager> streamManager_;
}; };
#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,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 SERVER_SETTINGS_HPP #pragma once
#define SERVER_SETTINGS_HPP
// local headers
#include "image_cache.hpp"
// standard headers
#include <string> #include <string>
#include <vector> #include <vector>
#include "image_cache.hpp"
struct ServerSettings struct ServerSettings
{ {
@ -83,5 +85,3 @@ struct ServerSettings
StreamingClient streamingclient; StreamingClient streamingclient;
Logging logging; Logging logging;
}; };
#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,20 +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 STREAM_SERVER_HPP #pragma once
#define STREAM_SERVER_HPP
// local headers // local headers
#include "common/message/codec_header.hpp"
#include "common/message/message.hpp" #include "common/message/message.hpp"
#include "common/message/server_settings.hpp" #include "common/queue.hpp"
#include "common/queue.h"
#include "common/sample_format.hpp"
#include "control_server.hpp" #include "control_server.hpp"
#include "jsonrpcpp.hpp"
#include "server_settings.hpp" #include "server_settings.hpp"
#include "stream_session.hpp" #include "stream_session.hpp"
#include "streamreader/stream_manager.hpp"
// 3rd party headers // 3rd party headers
#include <boost/asio/io_context.hpp> #include <boost/asio/io_context.hpp>
@ -38,8 +33,6 @@
// standard headers // standard headers
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <set>
#include <sstream>
#include <vector> #include <vector>
@ -94,7 +87,3 @@ private:
Queue<std::shared_ptr<msg::BaseMessage>> messages_; Queue<std::shared_ptr<msg::BaseMessage>> messages_;
StreamMessageReceiver* messageReceiver_; StreamMessageReceiver* messageReceiver_;
}; };
#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,12 +16,11 @@
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_HPP #pragma once
#define STREAM_SESSION_HPP
// local headers // local headers
#include "common/message/message.hpp" #include "common/message/message.hpp"
#include "common/queue.h"
#include "streamreader/stream_manager.hpp" #include "streamreader/stream_manager.hpp"
// 3rd party headers // 3rd party headers
@ -30,12 +29,9 @@
#include <boost/asio/strand.hpp> #include <boost/asio/strand.hpp>
// standard headers // standard headers
#include <atomic>
#include <condition_variable>
#include <deque> #include <deque>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <set>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <vector> #include <vector>
@ -166,7 +162,3 @@ protected:
std::deque<shared_const_buffer> messages_; std::deque<shared_const_buffer> messages_;
mutable std::mutex mutex_; mutable std::mutex mutex_;
}; };
#endif