Browse Source

UI: Add logging of audio monitoring to sources

jp9000 8 years ago
parent
commit
556ac1fbb7
2 changed files with 29 additions and 0 deletions
  1. 17 0
      UI/adv-audio-control.cpp
  2. 12 0
      UI/window-basic-main.cpp

+ 17 - 0
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,

+ 12 - 0
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;
 }