From 3667426f49add338a4756abf08c9fca3a2271329 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 28 May 2022 20:01:12 +0200 Subject: [PATCH] obs/signal-handler: Update to new classes --- source/obs/obs-signal-handler.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/obs/obs-signal-handler.hpp b/source/obs/obs-signal-handler.hpp index 1dd290de..47f466ef 100644 --- a/source/obs/obs-signal-handler.hpp +++ b/source/obs/obs-signal-handler.hpp @@ -19,6 +19,7 @@ #pragma once #include "common.hpp" +#include "obs/obs-source.hpp" #include "util/util-event.hpp" namespace streamfx::obs { @@ -68,7 +69,7 @@ namespace streamfx::obs { // Audio Capture is also here, as it could be considered a signal. class audio_signal_handler { - std::shared_ptr _keepalive; + ::streamfx::obs::source _keepalive; static void handle_audio(void* ptr, obs_source_t*, const struct audio_data* audio_data, bool muted) noexcept try { @@ -78,17 +79,17 @@ namespace streamfx::obs { } public: - audio_signal_handler(std::shared_ptr keepalive) : _keepalive(keepalive), event() + audio_signal_handler(::streamfx::obs::source const& keepalive) : _keepalive(keepalive), event() { - obs_source_add_audio_capture_callback(_keepalive.get(), handle_audio, this); + obs_source_add_audio_capture_callback(_keepalive, handle_audio, this); } virtual ~audio_signal_handler() { event.clear(); - obs_source_remove_audio_capture_callback(_keepalive.get(), handle_audio, this); + obs_source_remove_audio_capture_callback(_keepalive, handle_audio, this); } - streamfx::util::event, const struct audio_data*, bool> event; + streamfx::util::event<::streamfx::obs::source, const struct audio_data*, bool> event; }; } // namespace streamfx::obs