From fc693e02108bc2d388b59c21aa319a574ef0c6b3 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 28 May 2022 19:40:31 +0200 Subject: [PATCH] obs/tools: Remove more legacy tools --- source/obs/obs-tools.cpp | 18 ------------------ source/obs/obs-tools.hpp | 40 ---------------------------------------- 2 files changed, 58 deletions(-) diff --git a/source/obs/obs-tools.cpp b/source/obs/obs-tools.cpp index 6099a73..c150682 100644 --- a/source/obs/obs-tools.cpp +++ b/source/obs/obs-tools.cpp @@ -110,21 +110,3 @@ bool streamfx::obs::tools::source_find_source(::streamfx::obs::source haystack, return false; } - -streamfx::obs::tools::child_source::child_source(obs_source_t* parent, std::shared_ptr child) - : _parent(parent), _child(child) -{ - if (!obs_source_add_active_child(_parent, _child.get())) { - throw std::runtime_error("recursion detected"); - } -} - -streamfx::obs::tools::child_source::~child_source() -{ - obs_source_remove_active_child(_parent, _child.get()); -} - -std::shared_ptr streamfx::obs::tools::child_source::get() -{ - return _child; -} diff --git a/source/obs/obs-tools.hpp b/source/obs/obs-tools.hpp index 7253210..51800fb 100644 --- a/source/obs/obs-tools.hpp +++ b/source/obs/obs-tools.hpp @@ -24,46 +24,6 @@ namespace streamfx::obs { namespace tools { bool source_find_source(::streamfx::obs::source haystack, ::streamfx::obs::source needle); - - class child_source { - obs_source_t* _parent; - std::shared_ptr _child; - - public: - child_source(obs_source_t* parent, std::shared_ptr child); - virtual ~child_source(); - - std::shared_ptr get(); - }; - - // Class to manage - class active_source { - obs_source_t* _child; - - public: - active_source(obs_source_t* child) : _child(child) - { - obs_source_inc_active(_child); - } - virtual ~active_source() - { - obs_source_dec_active(_child); - } - }; - - class visible_source { - obs_source_t* _child; - - public: - visible_source(obs_source_t* child) : _child(child) - { - obs_source_inc_showing(_child); - } - virtual ~visible_source() - { - obs_source_dec_showing(_child); - } - }; } // namespace tools inline void obs_source_deleter(obs_source_t* v)