From bce372bd79d938389e53829f7e6570965c96d53b Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Wed, 26 Jan 2022 18:58:43 +0100 Subject: [PATCH] Display Info of created source in Preview --- UserInterfaceManager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index b7b9171..706c09d 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -6192,6 +6192,8 @@ Source * SourcePreview::getSource() void SourcePreview::Render(float width) { + static InfoVisitor _info; + if(source_) { // cancel if failed if (source_->failed()) { @@ -6241,8 +6243,10 @@ void SourcePreview::Render(float width) ImGuiToolkit::Icon(source_->icon().x, source_->icon().y); ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::Text("%s", label_.c_str()); - if (source_->ready()) - ImGui::Text("%d x %d %s", frame->width(), frame->height(), frame->use_alpha() ? "RGBA" : "RGB"); + if (source_->ready()) { + source_->accept(_info); + ImGui::Text("%s", _info.str().c_str()); + } else ImGui::Text("loading..."); }