mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[feat] add audio capture button in control bar
This commit is contained in:
@@ -28,6 +28,8 @@ static std::vector<std::string> exit_fullscreen = {u8" 退出全屏",
|
||||
" Exit fullscreen"};
|
||||
static std::vector<std::string> control_mouse = {u8" 控制", " Control"};
|
||||
static std::vector<std::string> release_mouse = {u8" 释放", " Release"};
|
||||
static std::vector<std::string> audio_capture = {u8" 声音", " Audio"};
|
||||
static std::vector<std::string> mute = {u8" 静音", " Mute"};
|
||||
static std::vector<std::string> settings = {u8"设置", "Settings"};
|
||||
static std::vector<std::string> language = {u8"语言:", "Language:"};
|
||||
static std::vector<std::string> language_zh = {u8"中文", "Chinese"};
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -117,6 +117,7 @@ class Render {
|
||||
std::string connect_button_label_ = "Connect";
|
||||
std::string fullscreen_button_label_ = "Fullscreen";
|
||||
std::string mouse_control_button_label_ = "Mouse Control";
|
||||
std::string audio_capture_button_label_ = "Audio Capture";
|
||||
std::string settings_button_label_ = "Setting";
|
||||
char input_password_tmp_[7] = "";
|
||||
char input_password_[7] = "";
|
||||
@@ -187,12 +188,14 @@ class Render {
|
||||
bool control_bar_expand_ = true;
|
||||
bool fullscreen_button_pressed_ = false;
|
||||
bool mouse_control_button_pressed_ = false;
|
||||
bool audio_capture_button_pressed_ = true;
|
||||
bool show_settings_window_ = false;
|
||||
bool received_frame_ = false;
|
||||
bool is_create_connection_ = false;
|
||||
bool audio_buffer_fresh_ = false;
|
||||
bool rejoin_ = false;
|
||||
bool control_mouse_ = false;
|
||||
bool audio_capture_ = true;
|
||||
bool local_id_copied_ = false;
|
||||
bool show_password_ = true;
|
||||
bool password_inited_ = false;
|
||||
|
||||
Reference in New Issue
Block a user