[feat] add audio capture button in control bar

This commit is contained in:
dijunkun
2024-08-15 11:25:19 +08:00
parent 65927c2091
commit 4704d494ec
4 changed files with 27 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ int Render::ControlBar() {
if (control_bar_expand_) {
ImGui::SetCursorPosX(is_control_bar_in_left_ ? (control_window_width_ + 5)
: 87);
: 53);
// Mouse control
std::string mouse = ICON_FA_COMPUTER_MOUSE;
if (ImGui::Button(mouse.c_str(), ImVec2(25, 25))) {
@@ -30,6 +30,26 @@ int Render::ControlBar() {
mouse_control_button_pressed_ = !mouse_control_button_pressed_;
}
ImGui::SameLine();
// Audio capture
std::string audio = audio_capture_button_pressed_ ? ICON_FA_VOLUME_HIGH
: ICON_FA_VOLUME_XMARK;
if (ImGui::Button(audio.c_str(), ImVec2(25, 25))) {
if (mouse_control_button_label_ ==
localization::audio_capture[localization_language_index_] &&
connection_established_) {
audio_capture_button_pressed_ = true;
audio_capture_ = true;
audio_capture_button_label_ =
localization::mute[localization_language_index_];
} else {
control_mouse_ = false;
audio_capture_button_label_ =
localization::audio_capture[localization_language_index_];
}
audio_capture_button_pressed_ = !audio_capture_button_pressed_;
}
ImGui::SameLine();
// Fullscreen
std::string fullscreen =