obs: Apply coding guidelines

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2021-06-08 04:36:30 +02:00
parent 82ed11e6c1
commit 015fac588b
14 changed files with 163 additions and 158 deletions

View File

@ -34,7 +34,7 @@ gfx::source_texture::source_texture(obs_source_t* parent)
if (!parent) { if (!parent) {
throw std::invalid_argument("_parent must not be null"); throw std::invalid_argument("_parent must not be null");
} }
_parent = std::make_shared<obs::deprecated_source>(parent, false, false); _parent = std::make_shared<streamfx::obs::deprecated_source>(parent, false, false);
_rt = std::make_shared<gs::rendertarget>(GS_RGBA, GS_ZS_NONE); _rt = std::make_shared<gs::rendertarget>(GS_RGBA, GS_ZS_NONE);
} }
@ -46,7 +46,7 @@ gfx::source_texture::source_texture(obs_source_t* _source, obs_source_t* _parent
if (!obs_source_add_active_child(_parent, _source)) { if (!obs_source_add_active_child(_parent, _source)) {
throw std::runtime_error("_parent is contained in _child"); throw std::runtime_error("_parent is contained in _child");
} }
_child = std::make_shared<obs::deprecated_source>(_source, true, true); _child = std::make_shared<streamfx::obs::deprecated_source>(_source, true, true);
} }
gfx::source_texture::source_texture(const char* _name, obs_source_t* _parent) : source_texture(_parent) gfx::source_texture::source_texture(const char* _name, obs_source_t* _parent) : source_texture(_parent)
@ -54,7 +54,7 @@ gfx::source_texture::source_texture(const char* _name, obs_source_t* _parent) :
if (!_name) { if (!_name) {
throw std::invalid_argument("name must not be null"); throw std::invalid_argument("name must not be null");
} }
_child = std::make_shared<obs::deprecated_source>(_name, true, true); _child = std::make_shared<streamfx::obs::deprecated_source>(_name, true, true);
if (!obs_source_add_active_child(_parent, _child->get())) { if (!obs_source_add_active_child(_parent, _child->get())) {
throw std::runtime_error("_parent is contained in _child"); throw std::runtime_error("_parent is contained in _child");
} }
@ -63,8 +63,8 @@ gfx::source_texture::source_texture(const char* _name, obs_source_t* _parent) :
gfx::source_texture::source_texture(std::string _name, obs_source_t* _parent) : source_texture(_name.c_str(), _parent) gfx::source_texture::source_texture(std::string _name, obs_source_t* _parent) : source_texture(_name.c_str(), _parent)
{} {}
gfx::source_texture::source_texture(std::shared_ptr<obs::deprecated_source> pchild, gfx::source_texture::source_texture(std::shared_ptr<streamfx::obs::deprecated_source> pchild,
std::shared_ptr<obs::deprecated_source> pparent) std::shared_ptr<streamfx::obs::deprecated_source> pparent)
{ {
if (!pchild) { if (!pchild) {
throw std::invalid_argument("_child must not be null"); throw std::invalid_argument("_child must not be null");
@ -80,8 +80,8 @@ gfx::source_texture::source_texture(std::shared_ptr<obs::deprecated_source> pchi
this->_rt = std::make_shared<gs::rendertarget>(GS_RGBA, GS_ZS_NONE); this->_rt = std::make_shared<gs::rendertarget>(GS_RGBA, GS_ZS_NONE);
} }
gfx::source_texture::source_texture(std::shared_ptr<obs::deprecated_source> _child, obs_source_t* _parent) gfx::source_texture::source_texture(std::shared_ptr<streamfx::obs::deprecated_source> _child, obs_source_t* _parent)
: source_texture(_child, std::make_shared<obs::deprecated_source>(_parent, false, false)) : source_texture(_child, std::make_shared<streamfx::obs::deprecated_source>(_parent, false, false))
{} {}
obs_source_t* gfx::source_texture::get_object() obs_source_t* gfx::source_texture::get_object()

View File

@ -24,8 +24,8 @@
namespace gfx { namespace gfx {
class source_texture { class source_texture {
std::shared_ptr<obs::deprecated_source> _parent; std::shared_ptr<streamfx::obs::deprecated_source> _parent;
std::shared_ptr<obs::deprecated_source> _child; std::shared_ptr<streamfx::obs::deprecated_source> _child;
std::shared_ptr<gs::rendertarget> _rt; std::shared_ptr<gs::rendertarget> _rt;
@ -37,8 +37,9 @@ namespace gfx {
source_texture(const char* name, obs_source_t* parent); source_texture(const char* name, obs_source_t* parent);
source_texture(std::string name, obs_source_t* parent); source_texture(std::string name, obs_source_t* parent);
source_texture(std::shared_ptr<obs::deprecated_source> child, std::shared_ptr<obs::deprecated_source> parent); source_texture(std::shared_ptr<streamfx::obs::deprecated_source> child,
source_texture(std::shared_ptr<obs::deprecated_source> child, obs_source_t* parent); std::shared_ptr<streamfx::obs::deprecated_source> parent);
source_texture(std::shared_ptr<streamfx::obs::deprecated_source> child, obs_source_t* parent);
public /*copy*/: public /*copy*/:
source_texture(source_texture const& other) = delete; source_texture(source_texture const& other) = delete;

View File

@ -262,7 +262,7 @@ bool gfx::shader::shader::on_refresh_properties(obs_properties_t* props, obs_pro
{ // Clear parameter options. { // Clear parameter options.
auto grp = obs_property_group_content(obs_properties_get(props, ST_PARAMETERS)); auto grp = obs_property_group_content(obs_properties_get(props, ST_PARAMETERS));
for (auto p = obs_properties_first(grp); p != nullptr; p = obs_properties_first(grp)) { for (auto p = obs_properties_first(grp); p != nullptr; p = obs_properties_first(grp)) {
obs::tools::obs_properties_remove_by_name(grp, obs_property_name(p)); streamfx::obs::tools::obs_properties_remove_by_name(grp, obs_property_name(p));
} }
// Rebuild new parameters. // Rebuild new parameters.
@ -299,7 +299,7 @@ bool gfx::shader::shader::on_shader_or_technique_modified(obs_properties_t* prop
// Clear parameter options. // Clear parameter options.
auto grp = obs_property_group_content(obs_properties_get(props, ST_PARAMETERS)); auto grp = obs_property_group_content(obs_properties_get(props, ST_PARAMETERS));
for (auto p = obs_properties_first(grp); p != nullptr; p = obs_properties_first(grp)) { for (auto p = obs_properties_first(grp); p != nullptr; p = obs_properties_first(grp)) {
obs::tools::obs_properties_remove_by_name(grp, obs_property_name(p)); streamfx::obs::tools::obs_properties_remove_by_name(grp, obs_property_name(p));
} }
// Rebuild new parameters. // Rebuild new parameters.

View File

@ -21,7 +21,7 @@
#include "common.hpp" #include "common.hpp"
#include "plugin.hpp" #include "plugin.hpp"
namespace obs { namespace streamfx::obs {
template<class _factory, typename _instance> template<class _factory, typename _instance>
class encoder_factory { class encoder_factory {
public: public:
@ -350,4 +350,4 @@ namespace obs {
virtual void get_video_info(struct video_scale_info* info) {} virtual void get_video_info(struct video_scale_info* info) {}
}; };
} // namespace obs } // namespace streamfx::obs

View File

@ -21,7 +21,7 @@
#include "common.hpp" #include "common.hpp"
#include "util/util-event.hpp" #include "util/util-event.hpp"
namespace obs { namespace streamfx::obs {
template<typename T> template<typename T>
class signal_handler_base { class signal_handler_base {
protected: protected:
@ -91,4 +91,4 @@ namespace obs {
streamfx::util::event<std::shared_ptr<obs_source_t>, const struct audio_data*, bool> event; streamfx::util::event<std::shared_ptr<obs_source_t>, const struct audio_data*, bool> event;
}; };
} // namespace obs } // namespace streamfx::obs

View File

@ -21,7 +21,7 @@
#include "common.hpp" #include "common.hpp"
#include "plugin.hpp" #include "plugin.hpp"
namespace obs { namespace streamfx::obs {
template<class _factory, typename _instance> template<class _factory, typename _instance>
class source_factory { class source_factory {
protected: protected:
@ -640,4 +640,4 @@ namespace obs {
} }
}; };
} // namespace obs } // namespace streamfx::obs

View File

@ -22,11 +22,11 @@
#include "obs/obs-tools.hpp" #include "obs/obs-tools.hpp"
#include "plugin.hpp" #include "plugin.hpp"
static std::shared_ptr<obs::source_tracker> source_tracker_instance; static std::shared_ptr<streamfx::obs::source_tracker> source_tracker_instance;
void obs::source_tracker::source_create_handler(void* ptr, calldata_t* data) noexcept void streamfx::obs::source_tracker::source_create_handler(void* ptr, calldata_t* data) noexcept
try { try {
obs::source_tracker* self = reinterpret_cast<obs::source_tracker*>(ptr); streamfx::obs::source_tracker* self = reinterpret_cast<streamfx::obs::source_tracker*>(ptr);
obs_source_t* target = nullptr; obs_source_t* target = nullptr;
calldata_get_ptr(data, "source", &target); calldata_get_ptr(data, "source", &target);
@ -47,15 +47,15 @@ try {
{ {
std::unique_lock<std::mutex> ul(self->_lock); std::unique_lock<std::mutex> ul(self->_lock);
self->_sources.insert({std::string(name), {weak, obs::obs_weak_source_deleter}}); self->_sources.insert({std::string(name), {weak, streamfx::obs::obs_weak_source_deleter}});
} }
} catch (...) { } catch (...) {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::source_tracker::source_destroy_handler(void* ptr, calldata_t* data) noexcept void streamfx::obs::source_tracker::source_destroy_handler(void* ptr, calldata_t* data) noexcept
try { try {
obs::source_tracker* self = reinterpret_cast<obs::source_tracker*>(ptr); streamfx::obs::source_tracker* self = reinterpret_cast<streamfx::obs::source_tracker*>(ptr);
obs_source_t* target = nullptr; obs_source_t* target = nullptr;
calldata_get_ptr(data, "source", &target); calldata_get_ptr(data, "source", &target);
@ -81,9 +81,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::source_tracker::source_rename_handler(void* ptr, calldata_t* data) noexcept void streamfx::obs::source_tracker::source_rename_handler(void* ptr, calldata_t* data) noexcept
try { try {
obs::source_tracker* self = reinterpret_cast<obs::source_tracker*>(ptr); streamfx::obs::source_tracker* self = reinterpret_cast<streamfx::obs::source_tracker*>(ptr);
obs_source_t* target = nullptr; obs_source_t* target = nullptr;
const char* prev_name = nullptr; const char* prev_name = nullptr;
@ -106,7 +106,7 @@ try {
if (!weak) { if (!weak) {
return; return;
} }
self->_sources.insert({new_name, {weak, obs::obs_weak_source_deleter}}); self->_sources.insert({new_name, {weak, streamfx::obs::obs_weak_source_deleter}});
return; return;
} }
@ -118,22 +118,22 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::source_tracker::initialize() void streamfx::obs::source_tracker::initialize()
{ {
source_tracker_instance = std::make_shared<obs::source_tracker>(); source_tracker_instance = std::make_shared<streamfx::obs::source_tracker>();
} }
void obs::source_tracker::finalize() void streamfx::obs::source_tracker::finalize()
{ {
source_tracker_instance.reset(); source_tracker_instance.reset();
} }
std::shared_ptr<obs::source_tracker> obs::source_tracker::get() std::shared_ptr<streamfx::obs::source_tracker> streamfx::obs::source_tracker::get()
{ {
return source_tracker_instance; return source_tracker_instance;
} }
obs::source_tracker::source_tracker() streamfx::obs::source_tracker::source_tracker()
{ {
auto osi = obs_get_signal_handler(); auto osi = obs_get_signal_handler();
signal_handler_connect(osi, "source_create", &source_create_handler, this); signal_handler_connect(osi, "source_create", &source_create_handler, this);
@ -141,7 +141,7 @@ obs::source_tracker::source_tracker()
signal_handler_connect(osi, "source_rename", &source_rename_handler, this); signal_handler_connect(osi, "source_rename", &source_rename_handler, this);
} }
obs::source_tracker::~source_tracker() streamfx::obs::source_tracker::~source_tracker()
{ {
auto osi = obs_get_signal_handler(); auto osi = obs_get_signal_handler();
if (osi) { if (osi) {
@ -153,7 +153,7 @@ obs::source_tracker::~source_tracker()
this->_sources.clear(); this->_sources.clear();
} }
void obs::source_tracker::enumerate(enumerate_cb_t ecb, filter_cb_t fcb) void streamfx::obs::source_tracker::enumerate(enumerate_cb_t ecb, filter_cb_t fcb)
{ {
// Need func-local copy, otherwise we risk corruption if a new source is created or destroyed. // Need func-local copy, otherwise we risk corruption if a new source is created or destroyed.
decltype(_sources) _clone; decltype(_sources) _clone;
@ -163,8 +163,8 @@ void obs::source_tracker::enumerate(enumerate_cb_t ecb, filter_cb_t fcb)
} }
for (auto kv : _clone) { for (auto kv : _clone) {
auto source = auto source = std::shared_ptr<obs_source_t>(obs_weak_source_get_source(kv.second.get()),
std::shared_ptr<obs_source_t>(obs_weak_source_get_source(kv.second.get()), obs::obs_source_deleter); streamfx::obs::obs_source_deleter);
if (!source) { if (!source) {
continue; continue;
} }
@ -183,29 +183,29 @@ void obs::source_tracker::enumerate(enumerate_cb_t ecb, filter_cb_t fcb)
} }
} }
bool obs::source_tracker::filter_sources(std::string, obs_source_t* source) bool streamfx::obs::source_tracker::filter_sources(std::string, obs_source_t* source)
{ {
return (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT); return (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT);
} }
bool obs::source_tracker::filter_audio_sources(std::string, obs_source_t* source) bool streamfx::obs::source_tracker::filter_audio_sources(std::string, obs_source_t* source)
{ {
uint32_t flags = obs_source_get_output_flags(source); uint32_t flags = obs_source_get_output_flags(source);
return !(flags & OBS_SOURCE_AUDIO) || (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT); return !(flags & OBS_SOURCE_AUDIO) || (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT);
} }
bool obs::source_tracker::filter_video_sources(std::string, obs_source_t* source) bool streamfx::obs::source_tracker::filter_video_sources(std::string, obs_source_t* source)
{ {
uint32_t flags = obs_source_get_output_flags(source); uint32_t flags = obs_source_get_output_flags(source);
return !(flags & OBS_SOURCE_VIDEO) || (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT); return !(flags & OBS_SOURCE_VIDEO) || (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT);
} }
bool obs::source_tracker::filter_transitions(std::string, obs_source_t* source) bool streamfx::obs::source_tracker::filter_transitions(std::string, obs_source_t* source)
{ {
return (obs_source_get_type(source) != OBS_SOURCE_TYPE_TRANSITION); return (obs_source_get_type(source) != OBS_SOURCE_TYPE_TRANSITION);
} }
bool obs::source_tracker::filter_scenes(std::string, obs_source_t* source) bool streamfx::obs::source_tracker::filter_scenes(std::string, obs_source_t* source)
{ {
return (obs_source_get_type(source) != OBS_SOURCE_TYPE_SCENE); return (obs_source_get_type(source) != OBS_SOURCE_TYPE_SCENE);
} }

View File

@ -23,7 +23,7 @@
#include <map> #include <map>
#include <mutex> #include <mutex>
namespace obs { namespace streamfx::obs {
class source_tracker { class source_tracker {
std::map<std::string, std::shared_ptr<obs_weak_source_t>> _sources; std::map<std::string, std::shared_ptr<obs_weak_source_t>> _sources;
std::mutex _lock; std::mutex _lock;
@ -35,7 +35,7 @@ namespace obs {
public: // Singleton public: // Singleton
static void initialize(); static void initialize();
static void finalize(); static void finalize();
static std::shared_ptr<obs::source_tracker> get(); static std::shared_ptr<streamfx::obs::source_tracker> get();
public: public:
source_tracker(); source_tracker();
@ -69,4 +69,4 @@ namespace obs {
static bool filter_transitions(std::string name, obs_source_t* source); static bool filter_transitions(std::string name, obs_source_t* source);
static bool filter_scenes(std::string name, obs_source_t* source); static bool filter_scenes(std::string name, obs_source_t* source);
}; };
} // namespace obs } // namespace streamfx::obs

View File

@ -21,9 +21,9 @@
#include <stdexcept> #include <stdexcept>
#include "plugin.hpp" #include "plugin.hpp"
void obs::deprecated_source::handle_destroy(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_destroy(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
obs_source_t* source; obs_source_t* source;
if (!calldata_get_ptr(calldata, "source", &source)) { if (!calldata_get_ptr(calldata, "source", &source)) {
@ -44,9 +44,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_remove(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_remove(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.remove) { if (!self->events.remove) {
return; return;
} }
@ -57,9 +57,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_save(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_save(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.save) { if (!self->events.save) {
return; return;
} }
@ -70,9 +70,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_load(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_load(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.load) { if (!self->events.load) {
return; return;
} }
@ -83,9 +83,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_activate(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_activate(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.activate) { if (!self->events.activate) {
return; return;
} }
@ -96,9 +96,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_deactivate(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_deactivate(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.deactivate) { if (!self->events.deactivate) {
return; return;
} }
@ -109,9 +109,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_show(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_show(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.show) { if (!self->events.show) {
return; return;
} }
@ -122,9 +122,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_hide(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_hide(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.hide) { if (!self->events.hide) {
return; return;
} }
@ -135,9 +135,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_enable(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_enable(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.enable) { if (!self->events.enable) {
return; return;
} }
@ -154,9 +154,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_push_to_mute_changed(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_push_to_mute_changed(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.push_to_mute_changed) { if (!self->events.push_to_mute_changed) {
return; return;
} }
@ -173,9 +173,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_push_to_mute_delay(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_push_to_mute_delay(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.push_to_mute_delay) { if (!self->events.push_to_mute_delay) {
return; return;
} }
@ -192,9 +192,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_push_to_talk_changed(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_push_to_talk_changed(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.push_to_talk_changed) { if (!self->events.push_to_talk_changed) {
return; return;
} }
@ -211,9 +211,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_push_to_talk_delay(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_push_to_talk_delay(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.push_to_talk_delay) { if (!self->events.push_to_talk_delay) {
return; return;
} }
@ -230,9 +230,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_rename(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_rename(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.enable) { if (!self->events.enable) {
return; return;
} }
@ -254,9 +254,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_update_properties(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_update_properties(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.update_properties) { if (!self->events.update_properties) {
return; return;
} }
@ -267,9 +267,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_update_flags(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_update_flags(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.update_flags) { if (!self->events.update_flags) {
return; return;
} }
@ -286,9 +286,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_mute(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_mute(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.mute) { if (!self->events.mute) {
return; return;
} }
@ -305,9 +305,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_volume(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_volume(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.volume) { if (!self->events.volume) {
return; return;
} }
@ -326,9 +326,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_audio_sync(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_audio_sync(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.audio_sync) { if (!self->events.audio_sync) {
return; return;
} }
@ -347,9 +347,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_audio_mixers(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_audio_mixers(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.audio_mixers) { if (!self->events.audio_mixers) {
return; return;
} }
@ -368,9 +368,10 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_audio_data(void* p, obs_source_t*, const audio_data* audio, bool muted) noexcept void streamfx::obs::deprecated_source::handle_audio_data(void* p, obs_source_t*, const audio_data* audio,
bool muted) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.audio) { if (!self->events.audio) {
return; return;
} }
@ -382,9 +383,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_filter_add(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_filter_add(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.filter_add) { if (!self->events.filter_add) {
return; return;
} }
@ -401,9 +402,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_filter_remove(void* p, calldata_t* calldata) noexcept void streamfx::obs::deprecated_source::handle_filter_remove(void* p, calldata_t* calldata) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.filter_remove) { if (!self->events.filter_remove) {
return; return;
} }
@ -420,9 +421,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_reorder_filters(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_reorder_filters(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.reorder_filters) { if (!self->events.reorder_filters) {
return; return;
} }
@ -433,9 +434,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_transition_start(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_transition_start(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.transition_start) { if (!self->events.transition_start) {
return; return;
} }
@ -446,9 +447,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_transition_video_stop(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_transition_video_stop(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.transition_video_stop) { if (!self->events.transition_video_stop) {
return; return;
} }
@ -459,9 +460,9 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
void obs::deprecated_source::handle_transition_stop(void* p, calldata_t*) noexcept void streamfx::obs::deprecated_source::handle_transition_stop(void* p, calldata_t*) noexcept
try { try {
obs::deprecated_source* self = reinterpret_cast<obs::deprecated_source*>(p); streamfx::obs::deprecated_source* self = reinterpret_cast<streamfx::obs::deprecated_source*>(p);
if (!self->events.transition_stop) { if (!self->events.transition_stop) {
return; return;
} }
@ -472,7 +473,7 @@ try {
DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
} }
obs::deprecated_source::~deprecated_source() streamfx::obs::deprecated_source::~deprecated_source()
{ {
#ifdef auto_signal_d #ifdef auto_signal_d
#undef auto_signal_d #undef auto_signal_d
@ -513,7 +514,7 @@ obs::deprecated_source::~deprecated_source()
this->_self = nullptr; this->_self = nullptr;
} }
obs::deprecated_source::deprecated_source() streamfx::obs::deprecated_source::deprecated_source()
{ {
#ifdef auto_signal_c #ifdef auto_signal_c
#undef auto_signal_c #undef auto_signal_c
@ -553,18 +554,20 @@ obs::deprecated_source::deprecated_source()
this->events.audio.set_listen_callback([this]() noexcept { this->events.audio.set_listen_callback([this]() noexcept {
if (!this->_self) if (!this->_self)
return; return;
obs_source_add_audio_capture_callback(this->_self, obs::deprecated_source::handle_audio_data, this); obs_source_add_audio_capture_callback(this->_self, streamfx::obs::deprecated_source::handle_audio_data,
this);
}); });
this->events.audio.set_silence_callback([this]() noexcept { this->events.audio.set_silence_callback([this]() noexcept {
if (!this->_self) if (!this->_self)
return; return;
obs_source_remove_audio_capture_callback(this->_self, obs::deprecated_source::handle_audio_data, this); obs_source_remove_audio_capture_callback(this->_self, streamfx::obs::deprecated_source::handle_audio_data,
this);
}); });
} }
} }
obs::deprecated_source::deprecated_source(std::string name, bool ptrack_ownership, bool add_reference) streamfx::obs::deprecated_source::deprecated_source(std::string name, bool ptrack_ownership, bool add_reference)
: ::obs::deprecated_source::deprecated_source() : ::streamfx::obs::deprecated_source::deprecated_source()
{ {
this->_self = obs_get_source_by_name(name.c_str()); this->_self = obs_get_source_by_name(name.c_str());
if (!this->_self) { if (!this->_self) {
@ -577,8 +580,8 @@ obs::deprecated_source::deprecated_source(std::string name, bool ptrack_ownershi
} }
} }
obs::deprecated_source::deprecated_source(obs_source_t* source, bool ptrack_ownership, bool add_reference) streamfx::obs::deprecated_source::deprecated_source(obs_source_t* source, bool ptrack_ownership, bool add_reference)
: ::obs::deprecated_source::deprecated_source() : ::streamfx::obs::deprecated_source::deprecated_source()
{ {
this->_self = source; this->_self = source;
if (!this->_self) { if (!this->_self) {
@ -689,7 +692,7 @@ obs::deprecated_source& obs::deprecated_source::operator=(deprecated_source cons
} }
*/ */
obs::deprecated_source::deprecated_source(deprecated_source&& other) streamfx::obs::deprecated_source::deprecated_source(deprecated_source&& other)
: _self(std::move(other._self)), _track_ownership(std::move(other._track_ownership)) : _self(std::move(other._self)), _track_ownership(std::move(other._track_ownership))
{ {
// Clean out other source // Clean out other source
@ -730,7 +733,7 @@ obs::deprecated_source::deprecated_source(deprecated_source&& other)
#undef auto_signal_c #undef auto_signal_c
} }
obs::deprecated_source& obs::deprecated_source::operator=(deprecated_source&& other) streamfx::obs::deprecated_source& streamfx::obs::deprecated_source::operator=(deprecated_source&& other)
{ {
if (this != &other) { if (this != &other) {
return *this; return *this;
@ -782,7 +785,7 @@ obs::deprecated_source& obs::deprecated_source::operator=(deprecated_source&& ot
return *this; return *this;
} }
obs_source_type obs::deprecated_source::type() obs_source_type streamfx::obs::deprecated_source::type()
{ {
if (!_self) { if (!_self) {
return static_cast<obs_source_type>(-1); return static_cast<obs_source_type>(-1);
@ -790,7 +793,7 @@ obs_source_type obs::deprecated_source::type()
return obs_source_get_type(_self); return obs_source_get_type(_self);
} }
void* obs::deprecated_source::type_data() void* streamfx::obs::deprecated_source::type_data()
{ {
if (!_self) { if (!_self) {
return nullptr; return nullptr;
@ -798,7 +801,7 @@ void* obs::deprecated_source::type_data()
return obs_source_get_type_data(_self); return obs_source_get_type_data(_self);
} }
uint32_t obs::deprecated_source::width() uint32_t streamfx::obs::deprecated_source::width()
{ {
if (!_self) { if (!_self) {
return 0; return 0;
@ -806,7 +809,7 @@ uint32_t obs::deprecated_source::width()
return obs_source_get_width(_self); return obs_source_get_width(_self);
} }
uint32_t obs::deprecated_source::height() uint32_t streamfx::obs::deprecated_source::height()
{ {
if (!_self) { if (!_self) {
return 0; return 0;
@ -814,17 +817,17 @@ uint32_t obs::deprecated_source::height()
return obs_source_get_height(_self); return obs_source_get_height(_self);
} }
bool obs::deprecated_source::destroyed() bool streamfx::obs::deprecated_source::destroyed()
{ {
return _self == nullptr; return _self == nullptr;
} }
void obs::deprecated_source::clear() void streamfx::obs::deprecated_source::clear()
{ {
_self = nullptr; _self = nullptr;
} }
obs_source_t* obs::deprecated_source::get() obs_source_t* streamfx::obs::deprecated_source::get()
{ {
return _self; return _self;
} }

View File

@ -21,7 +21,7 @@
#include "common.hpp" #include "common.hpp"
#include "util/util-event.hpp" #include "util/util-event.hpp"
namespace obs { namespace streamfx::obs {
class deprecated_source { class deprecated_source {
obs_source_t* _self; obs_source_t* _self;
bool _track_ownership = false; bool _track_ownership = false;
@ -89,49 +89,49 @@ namespace obs {
public: // Events public: // Events
struct { struct {
// Destroy and Remove // Destroy and Remove
streamfx::util::event<obs::deprecated_source*> destroy; streamfx::util::event<streamfx::obs::deprecated_source*> destroy;
streamfx::util::event<obs::deprecated_source*> remove; streamfx::util::event<streamfx::obs::deprecated_source*> remove;
// Saving, Loading and Update // Saving, Loading and Update
streamfx::util::event<obs::deprecated_source*> save; streamfx::util::event<streamfx::obs::deprecated_source*> save;
streamfx::util::event<obs::deprecated_source*> load; streamfx::util::event<streamfx::obs::deprecated_source*> load;
streamfx::util::event<obs::deprecated_source*> update_properties; streamfx::util::event<streamfx::obs::deprecated_source*> update_properties;
// Activate, Deactivate // Activate, Deactivate
streamfx::util::event<obs::deprecated_source*> activate; streamfx::util::event<streamfx::obs::deprecated_source*> activate;
streamfx::util::event<obs::deprecated_source*> deactivate; streamfx::util::event<streamfx::obs::deprecated_source*> deactivate;
// Show Hide // Show Hide
streamfx::util::event<obs::deprecated_source*> show; streamfx::util::event<streamfx::obs::deprecated_source*> show;
streamfx::util::event<obs::deprecated_source*> hide; streamfx::util::event<streamfx::obs::deprecated_source*> hide;
// Other // Other
streamfx::util::event<obs::deprecated_source*, bool> enable; streamfx::util::event<streamfx::obs::deprecated_source*, bool> enable;
streamfx::util::event<obs::deprecated_source*, std::string, std::string> rename; streamfx::util::event<streamfx::obs::deprecated_source*, std::string, std::string> rename;
streamfx::util::event<obs::deprecated_source*, long long> update_flags; streamfx::util::event<streamfx::obs::deprecated_source*, long long> update_flags;
// Hotkeys (PtM, PtT) // Hotkeys (PtM, PtT)
streamfx::util::event<obs::deprecated_source*, bool> push_to_mute_changed; streamfx::util::event<streamfx::obs::deprecated_source*, bool> push_to_mute_changed;
streamfx::util::event<obs::deprecated_source*, long long> push_to_mute_delay; streamfx::util::event<streamfx::obs::deprecated_source*, long long> push_to_mute_delay;
streamfx::util::event<obs::deprecated_source*, bool> push_to_talk_changed; streamfx::util::event<streamfx::obs::deprecated_source*, bool> push_to_talk_changed;
streamfx::util::event<obs::deprecated_source*, long long> push_to_talk_delay; streamfx::util::event<streamfx::obs::deprecated_source*, long long> push_to_talk_delay;
// Audio // Audio
streamfx::util::event<obs::deprecated_source*, bool> mute; streamfx::util::event<streamfx::obs::deprecated_source*, bool> mute;
streamfx::util::event<obs::deprecated_source*, double&> volume; streamfx::util::event<streamfx::obs::deprecated_source*, double&> volume;
streamfx::util::event<obs::deprecated_source*, long long&> audio_sync; streamfx::util::event<streamfx::obs::deprecated_source*, long long&> audio_sync;
streamfx::util::event<obs::deprecated_source*, long long&> audio_mixers; streamfx::util::event<streamfx::obs::deprecated_source*, long long&> audio_mixers;
streamfx::util::event<obs::deprecated_source*, const audio_data*, bool> audio; streamfx::util::event<streamfx::obs::deprecated_source*, const audio_data*, bool> audio;
// Filters // Filters
streamfx::util::event<obs::deprecated_source*, obs_source_t*> filter_add; streamfx::util::event<streamfx::obs::deprecated_source*, obs_source_t*> filter_add;
streamfx::util::event<obs::deprecated_source*, obs_source_t*> filter_remove; streamfx::util::event<streamfx::obs::deprecated_source*, obs_source_t*> filter_remove;
streamfx::util::event<obs::deprecated_source*> reorder_filters; streamfx::util::event<streamfx::obs::deprecated_source*> reorder_filters;
// Transition // Transition
streamfx::util::event<obs::deprecated_source*> transition_start; streamfx::util::event<streamfx::obs::deprecated_source*> transition_start;
streamfx::util::event<obs::deprecated_source*> transition_video_stop; streamfx::util::event<streamfx::obs::deprecated_source*> transition_video_stop;
streamfx::util::event<obs::deprecated_source*> transition_stop; streamfx::util::event<streamfx::obs::deprecated_source*> transition_stop;
} events; } events;
}; };
} // namespace obs } // namespace streamfx::obs

View File

@ -74,7 +74,7 @@ static bool scs_contains(scs_searchdata& sd, obs_source_t* source)
return true; return true;
} }
bool obs::tools::scene_contains_source(obs_scene_t* scene, obs_source_t* source) bool streamfx::obs::tools::scene_contains_source(obs_scene_t* scene, obs_source_t* source)
{ {
scs_searchdata sd; scs_searchdata sd;
sd.source = source; sd.source = source;
@ -113,7 +113,7 @@ struct _hack_obs_properties {
}; };
} }
bool obs::tools::obs_properties_remove_by_name(obs_properties_t* props, const char* name) bool streamfx::obs::tools::obs_properties_remove_by_name(obs_properties_t* props, const char* name)
{ {
// Due to a bug in obs_properties_remove_by_name, calling it on the first or last element of a group corrupts the // Due to a bug in obs_properties_remove_by_name, calling it on the first or last element of a group corrupts the
// obs_properties_t's first and last pointers, which now point at nonsense. // obs_properties_t's first and last pointers, which now point at nonsense.
@ -161,7 +161,7 @@ bool obs::tools::obs_properties_remove_by_name(obs_properties_t* props, const ch
} }
if (el_cur->type == OBS_PROPERTY_GROUP) { if (el_cur->type == OBS_PROPERTY_GROUP) {
if (obs::tools::obs_properties_remove_by_name( if (streamfx::obs::tools::obs_properties_remove_by_name(
obs_property_group_content(reinterpret_cast<obs_property_t*>(el_cur)), name)) obs_property_group_content(reinterpret_cast<obs_property_t*>(el_cur)), name))
return true; return true;
} }
@ -170,7 +170,7 @@ bool obs::tools::obs_properties_remove_by_name(obs_properties_t* props, const ch
return false; return false;
} }
obs::tools::child_source::child_source(obs_source_t* parent, std::shared_ptr<obs_source_t> child) streamfx::obs::tools::child_source::child_source(obs_source_t* parent, std::shared_ptr<obs_source_t> child)
: _parent(parent), _child(child) : _parent(parent), _child(child)
{ {
if (!obs_source_add_active_child(_parent, _child.get())) { if (!obs_source_add_active_child(_parent, _child.get())) {
@ -178,12 +178,12 @@ obs::tools::child_source::child_source(obs_source_t* parent, std::shared_ptr<obs
} }
} }
obs::tools::child_source::~child_source() streamfx::obs::tools::child_source::~child_source()
{ {
obs_source_remove_active_child(_parent, _child.get()); obs_source_remove_active_child(_parent, _child.get());
} }
std::shared_ptr<obs_source_t> obs::tools::child_source::get() std::shared_ptr<obs_source_t> streamfx::obs::tools::child_source::get()
{ {
return _child; return _child;
} }

View File

@ -20,7 +20,7 @@
#pragma once #pragma once
#include "common.hpp" #include "common.hpp"
namespace obs { namespace streamfx::obs {
namespace tools { namespace tools {
bool scene_contains_source(obs_scene_t* scene, obs_source_t* source); bool scene_contains_source(obs_scene_t* scene, obs_source_t* source);
@ -96,4 +96,4 @@ namespace obs {
{ {
obs_data_release(v); obs_data_release(v);
} }
} // namespace obs } // namespace streamfx::obs

View File

@ -87,7 +87,7 @@ try {
_threadpool = std::make_shared<streamfx::util::threadpool>(); _threadpool = std::make_shared<streamfx::util::threadpool>();
// Initialize Source Tracker // Initialize Source Tracker
obs::source_tracker::initialize(); streamfx::obs::source_tracker::initialize();
// GS Stuff // GS Stuff
{ {
@ -242,7 +242,7 @@ try {
} }
// Finalize Source Tracker // Finalize Source Tracker
obs::source_tracker::finalize(); streamfx::obs::source_tracker::finalize();
// // Auto-Updater // // Auto-Updater
//#ifdef ENABLE_UPDATER //#ifdef ENABLE_UPDATER

View File

@ -359,7 +359,8 @@ obs_properties_t* mirror_factory::get_properties2(mirror_instance* data)
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Unknown)), obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Unknown)),
static_cast<int64_t>(SPEAKERS_UNKNOWN)); static_cast<int64_t>(SPEAKERS_UNKNOWN));
obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Mono)), static_cast<int64_t>(SPEAKERS_MONO)); obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Mono)),
static_cast<int64_t>(SPEAKERS_MONO));
obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Stereo)), obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Stereo)),
static_cast<int64_t>(SPEAKERS_STEREO)); static_cast<int64_t>(SPEAKERS_STEREO));
obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(StereoLFE)), obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(StereoLFE)),