New support for gstreamer video effects in MediaPlayer

Implementation of the GUI allowing to set the pipeline element description
This commit is contained in:
Bruno Herbelin
2023-08-08 17:43:46 +02:00
parent 5419622c74
commit f75b384c17
3 changed files with 116 additions and 35 deletions

View File

@@ -1949,6 +1949,12 @@ bool ImGuiToolkit::InputCodeMultiline(const char* label, std::string *str, const
char hiddenlabel[256];
sprintf(hiddenlabel, "##%s", label);
// Draw the label with default font
ImVec2 pos_top = ImGui::GetCursorPos();
ImGui::SetCursorPosX(pos_top.x + size.x + 8);
ImGui::Text("%s", label);
// Draw code with mono font
ImGuiToolkit::PushFont(FONT_MONO);
static ImVec2 onechar = ImGui::CalcTextSize("C");
@@ -1958,9 +1964,11 @@ bool ImGuiToolkit::InputCodeMultiline(const char* label, std::string *str, const
// work on a string wrapped to the number of chars in a line
std::string edited = wrapp( *str, (size_t) floor(size.x / onechar.x) - 1);
ImGui::SetCursorPos(pos_top);
// Input text into std::string with callback
ImGui::InputTextMultiline(hiddenlabel, (char*)edited.c_str(), edited.capacity() + 1, size, flags, InputTextCallback, &edited);
if (ImGui::IsItemDeactivatedAfterEdit() ){
if (ImGui::IsItemDeactivated() ){
// unwrap after edit
*str = unwrapp(edited);
// return number of lines
@@ -1973,10 +1981,6 @@ bool ImGuiToolkit::InputCodeMultiline(const char* label, std::string *str, const
ImGui::PopFont();
// show label
ImGui::SameLine();
ImGui::Text("%s", label);
return ret;
}