diff --git a/src/stream_manager_ui.cpp b/src/stream_manager_ui.cpp index de6c12e..426bf71 100644 --- a/src/stream_manager_ui.cpp +++ b/src/stream_manager_ui.cpp @@ -57,7 +57,16 @@ void StreamManagerUI::render(void) { ImGui::PushID(entt::to_integral(oc)); ImGui::TableNextColumn(); - ImGui::Text("%d", entt::to_integral(entt::to_entity(oc))); + { + std::string label = std::to_string(entt::to_integral(entt::to_entity(oc))); + if (ImGui::SmallButton(label.c_str())) { + ImGui::OpenPopup("src_settings"); + } + if (ImGui::BeginPopup("src_settings")) { + ImGui::TextUnformatted("TODO"); + ImGui::EndPopup(); + } + } if (_os.registry().all_of(oc)) { ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg1, ImGui::GetColorU32(ImVec4{0.6f, 0.f, 0.6f, 0.25f})); @@ -125,7 +134,23 @@ void StreamManagerUI::render(void) { ImGui::PushID(entt::to_integral(oc)); ImGui::TableNextColumn(); - ImGui::Text("%d", entt::to_integral(entt::to_entity(oc))); + { + std::string label = std::to_string(entt::to_integral(entt::to_entity(oc))); + if (ImGui::SmallButton(label.c_str())) { + ImGui::OpenPopup("sink_settings"); + } + if (ImGui::BeginPopup("sink_settings")) { + if (auto* bitrate = _os.registry().try_get(oc); bitrate != nullptr) { + if (ImGui::BeginMenu("bitrate")) { + if (ImGui::InputScalar("rate", ImGuiDataType_S64, &bitrate->rate)) { + _os.throwEventUpdate(oc); + } + ImGui::EndMenu(); + } + } + ImGui::EndPopup(); + } + } if (_os.registry().all_of(oc)) { ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg1, ImGui::GetColorU32(ImVec4{0.6f, 0.f, 0.6f, 0.25f})); diff --git a/src/tox_av_voip_model.cpp b/src/tox_av_voip_model.cpp index faf2121..2feced3 100644 --- a/src/tox_av_voip_model.cpp +++ b/src/tox_av_voip_model.cpp @@ -910,7 +910,7 @@ bool ToxAVVoIPModel::onEvent(const ObjectStore::Events::ObjectUpdate& e) { rate = 0; } if (!e.e.get()->setBitrate(rate)) { - rate = e.e.get()->_video_bitrate; + rate = e.e.get()->_video_bitrate; // reset } } else if (e.e.all_of()) { auto& rate = e.e.get_or_emplace().rate; @@ -918,7 +918,7 @@ bool ToxAVVoIPModel::onEvent(const ObjectStore::Events::ObjectUpdate& e) { rate = 0; } if (!e.e.get()->setBitrate(rate)) { - rate = e.e.get()->_audio_bitrate; + rate = e.e.get()->_audio_bitrate; // reset } }