mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 03:39:57 +01:00
Display list of sources in Session Group UI panel
This commit is contained in:
@@ -175,8 +175,11 @@ std::list<std::string> BaseToolkit::splitted(const std::string& str, char delim)
|
|||||||
std::string BaseToolkit::joinned(std::list<std::string> strlist, char separator)
|
std::string BaseToolkit::joinned(std::list<std::string> strlist, char separator)
|
||||||
{
|
{
|
||||||
std::string str;
|
std::string str;
|
||||||
for (auto it = strlist.cbegin(); it != strlist.cend(); ++it)
|
for (auto it = strlist.cbegin(); it != strlist.cend(); ++it) {
|
||||||
str += (*it) + separator;
|
if (it != strlist.cbegin())
|
||||||
|
str += separator;
|
||||||
|
str += (*it);
|
||||||
|
}
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -579,7 +579,7 @@ void ImGuiVisitor::visit (Source& s)
|
|||||||
|
|
||||||
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
|
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
|
||||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||||
ImGui::Text(s.info().c_str());
|
ImGui::Text("%s", s.info().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGuiVisitor::visit (MediaSource& s)
|
void ImGuiVisitor::visit (MediaSource& s)
|
||||||
@@ -663,7 +663,8 @@ void ImGuiVisitor::visit (SessionFileSource& s)
|
|||||||
|
|
||||||
void ImGuiVisitor::visit (SessionGroupSource& s)
|
void ImGuiVisitor::visit (SessionGroupSource& s)
|
||||||
{
|
{
|
||||||
if (s.session() == nullptr)
|
Session *session = s.session();
|
||||||
|
if (session == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// info
|
// info
|
||||||
@@ -682,7 +683,15 @@ void ImGuiVisitor::visit (SessionGroupSource& s)
|
|||||||
ImGui::SetCursorPos(pos);
|
ImGui::SetCursorPos(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show list of sources in text bloc (multi line, dark background)
|
||||||
|
ImGuiTextBuffer info;
|
||||||
|
info.append( BaseToolkit::joinned( session->getNameList(), '\n').c_str() );
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.14f, 0.14f, 0.14f, 0.9f));
|
||||||
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
|
ImGui::InputTextMultiline("##sourcesingroup", (char *)info.c_str(), info.size(),
|
||||||
|
ImVec2(IMGUI_RIGHT_ALIGN, CLAMP(session->numSource(), 2, 5) * ImGui::GetTextLineHeightWithSpacing()),
|
||||||
|
ImGuiInputTextFlags_ReadOnly);
|
||||||
|
ImGui::PopStyleColor(1);
|
||||||
|
|
||||||
if ( ImGui::Button( ICON_FA_SIGN_OUT_ALT " Import", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
if ( ImGui::Button( ICON_FA_SIGN_OUT_ALT " Import", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
||||||
Mixer::manager().import( &s );
|
Mixer::manager().import( &s );
|
||||||
|
|||||||
@@ -6171,7 +6171,7 @@ void Navigator::RenderNewPannel()
|
|||||||
ImGui::InputText("##url", bufurl, IM_ARRAYSIZE(bufurl), ImGuiInputTextFlags_ReadOnly);
|
ImGui::InputText("##url", bufurl, IM_ARRAYSIZE(bufurl), ImGuiInputTextFlags_ReadOnly);
|
||||||
ImGui::PopStyleColor(1);
|
ImGui::PopStyleColor(1);
|
||||||
|
|
||||||
ImGui::SameLine(0); ImGuiToolkit::Indication("URL for connecting to a stream on Secure Reliable Transport (SRT) protocol, waiting for connections in listener mode.", ICON_SOURCE_SRT);
|
ImGui::SameLine(0); ImGuiToolkit::Indication("URL for connecting with Secure Reliable Transport (SRT) protocol to a broadcaster that is waiting for connections (listener mode).", ICON_SOURCE_SRT);
|
||||||
|
|
||||||
if ( ImGui::Button("Call", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
|
if ( ImGui::Button("Call", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
|
||||||
new_source_preview_.setSource( Mixer::manager().createSourceSrt(Settings::application.custom_connect_ip, Settings::application.custom_connect_port), bufurl);
|
new_source_preview_.setSource( Mixer::manager().createSourceSrt(Settings::application.custom_connect_ip, Settings::application.custom_connect_port), bufurl);
|
||||||
|
|||||||
Reference in New Issue
Block a user