bitrate setting for sinks in ui
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousDelivery / dumpsyms (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled

This commit is contained in:
Green Sky 2025-04-04 13:02:02 +02:00
parent 18af7a7a38
commit 6d33c6e141
No known key found for this signature in database
GPG Key ID: DBE05085D874AB4A
2 changed files with 29 additions and 4 deletions

View File

@ -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<Components::TagDefaultTarget>(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<Components::Bitrate>(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<Components::TagDefaultTarget>(oc)) {
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg1, ImGui::GetColorU32(ImVec4{0.6f, 0.f, 0.6f, 0.25f}));

View File

@ -910,7 +910,7 @@ bool ToxAVVoIPModel::onEvent(const ObjectStore::Events::ObjectUpdate& e) {
rate = 0;
}
if (!e.e.get<ToxAVCallVideoSink*>()->setBitrate(rate)) {
rate = e.e.get<ToxAVCallVideoSink*>()->_video_bitrate;
rate = e.e.get<ToxAVCallVideoSink*>()->_video_bitrate; // reset
}
} else if (e.e.all_of<ToxAVCallAudioSink*>()) {
auto& rate = e.e.get_or_emplace<Components::Bitrate>().rate;
@ -918,7 +918,7 @@ bool ToxAVVoIPModel::onEvent(const ObjectStore::Events::ObjectUpdate& e) {
rate = 0;
}
if (!e.e.get<ToxAVCallAudioSink*>()->setBitrate(rate)) {
rate = e.e.get<ToxAVCallAudioSink*>()->_audio_bitrate;
rate = e.e.get<ToxAVCallAudioSink*>()->_audio_bitrate; // reset
}
}