head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.30 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.28 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.26 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.24 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.22 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.20 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.18 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.16 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.14 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.12 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.10 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.8 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.6 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.4 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.2 pkgsrc-2022Q3-base:1.1; locks; strict; comment @// @; 1.1 date 2022.07.03.16.09.15; author nia; state Exp; branches; next ; commitid IBERnujE1wZAYsKD; desc @@ 1.1 log @add audio/snapcast Snapcast is a multiroom client-server audio player, where all clients are time synchronized with the server to play perfectly synced audio. It's not a standalone player, but an extension that turns your existing audio player into a Sonos-like multiroom solution. @ text @$NetBSD$ Add Sun Audio support for NetBSD. --- client/player/sun_player.hpp.orig 2022-07-03 13:22:32.864495808 +0000 +++ client/player/sun_player.hpp @@@@ -0,0 +1,67 @@@@ +/*** + This file is part of snapcast + Copyright (C) 2014-2020 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 . +***/ + +#ifndef SUN_PLAYER_HPP +#define SUN_PLAYER_HPP + +#include "player.hpp" + +#include +#include + + +namespace player +{ + +static constexpr auto SUN = "sun"; + +/// Audio Player +/** + * Audio player implementation using Sun/NetBSD audio + */ +class SunPlayer : public Player +{ +public: + SunPlayer(boost::asio::io_context& io_context, const ClientSettings::Player& settings, std::shared_ptr stream); + ~SunPlayer() override; + + void start() override; + void stop() override; + + /// List the system's audio output devices + static std::vector pcm_list(); + +protected: + void worker() override; + bool needsThread() const override; + +private: + /// initialize audio device + void initSun(); + /// close audio device + void uninitSun(); + + int handle_; + + std::recursive_mutex mutex_; + std::vector buffer_; +}; + +} // namespace player + +#endif @