From 556ac1fbb727d2cbfaedcf994d553475a9893f9d Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 2 Mar 2017 13:05:38 -0800 Subject: [PATCH] UI: Add logging of audio monitoring to sources --- UI/adv-audio-control.cpp | 17 +++++++++++++++++ UI/window-basic-main.cpp | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/UI/adv-audio-control.cpp b/UI/adv-audio-control.cpp index deadbedc9..b7bfd4d08 100644 --- a/UI/adv-audio-control.cpp +++ b/UI/adv-audio-control.cpp @@ -297,6 +297,23 @@ void OBSAdvAudioCtrl::monitoringTypeChanged(int index) { int mt = monitoringType->itemData(index).toInt(); obs_source_set_monitoring_type(source, (obs_monitoring_type)mt); + + const char *type = nullptr; + + switch (mt) { + case OBS_MONITORING_TYPE_NONE: + type = "none"; + break; + case OBS_MONITORING_TYPE_MONITOR_ONLY: + type = "monitor only"; + break; + case OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT: + type = "monitor and output"; + break; + } + + blog(LOG_INFO, "User changed audio monitoring for source '%s' to: %s", + obs_source_get_name(source), type); } static inline void setMixer(obs_source_t *source, const int mixerIdx, diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 7dbc85219..8590dd75d 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -587,6 +587,18 @@ static bool LogSceneItem(obs_scene_t*, obs_sceneitem_t *item, void*) blog(LOG_INFO, " - source: '%s' (%s)", name, id); + obs_monitoring_type monitoring_type = + obs_source_get_monitoring_type(source); + + if (monitoring_type != OBS_MONITORING_TYPE_NONE) { + const char *type = + (monitoring_type == OBS_MONITORING_TYPE_MONITOR_ONLY) + ? "monitor only" + : "monitor and output"; + + blog(LOG_INFO, " - monitoring: %s", type); + } + obs_source_enum_filters(source, LogFilter, (void*)(intptr_t)2); return true; }