opt: rename to dual-way

This commit is contained in:
Kingtous 2023-01-30 22:57:20 +08:00
parent 8ab49d11d1
commit 05822991bf
38 changed files with 43 additions and 49 deletions

View File

@ -109,8 +109,8 @@ const kRemoteImageQualityCustom = 'custom';
/// [kRemoteAudioGuestToHost] Guest to host audio mode(default).
const kRemoteAudioGuestToHost = 'guest-to-host';
/// [kRemoteAudioTwoWay] two-way audio mode(default).
const kRemoteAudioTwoWay = 'two-way';
/// [kRemoteAudioDualWay] dual-way audio mode(default).
const kRemoteAudioDualWay = 'dual-way';
const kIgnoreDpi = true;

View File

@ -1115,8 +1115,8 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
dismissOnClicked: true,
),
MenuEntryRadioOption(
text: translate('Two way'),
value: kRemoteAudioTwoWay,
text: translate('Dual way'),
value: kRemoteAudioDualWay,
dismissOnClicked: true,
),
],

View File

@ -446,7 +446,7 @@ enum ImageQuality {
enum AudioMode {
GuestToHost = 0;
TwoWay = 1;
DualWay = 1;
}
message VideoCodecState {

View File

@ -1262,8 +1262,8 @@ impl LoginConfigHandler {
pub fn get_audio_mode_enum(q: &str, ignore_default: bool) -> Option<AudioMode> {
if q == "guest-to-host" {
Some(AudioMode::GuestToHost)
} else if q == "two-way" {
Some(AudioMode::TwoWay)
} else if q == "dual-way" {
Some(AudioMode::DualWay)
} else {
if ignore_default {
None

View File

@ -393,7 +393,7 @@ impl<T: InvokeUiSession> Remote<T> {
allow_err!(sender.send(()));
}
}
AudioMode::TwoWay => {
AudioMode::DualWay => {
// Start audio thread for playback.
// Cancel previous local audio session.
if let Some(sender) = self.stop_local_audio_sender.take() {
@ -889,14 +889,15 @@ impl<T: InvokeUiSession> Remote<T> {
self.handler.load_last_jobs();
}
// Start audio thread for playback if current audio mode is two-way transmission.
// Start audio thread for playback if current audio mode is dual-way transmission.
if !self.handler.is_file_transfer() && !self.handler.is_port_forward() {
let audio_mode = LoginConfigHandler::get_audio_mode_enum(
self.handler.load_config().audio_mode.as_str(),
false,
)
.unwrap_or(AudioMode::GuestToHost);
if audio_mode == AudioMode::TwoWay {
log::debug!("current audio mode: {:?}", audio_mode);
if audio_mode == AudioMode::DualWay {
// Cancel previous local audio session.
if let Some(sender) = self.stop_local_audio_sender.take() {
allow_err!(sender.send(()));

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", "自动"),
("Other Default Options", "其它默认选项"),
("Guest to Host", "被控到主机"),
("Two way", "双向"),
("Dual way", "双向"),
("Audio Transmission Mode", "音频传输模式"),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -437,7 +437,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Please confirm if you want to share your desktop?", ""),
("Closed as expected", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
("Display", ""),
("Default View Style", ""),

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", "Automatisch"),
("Other Default Options", "Weitere Standardoptionen"),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -447,7 +447,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Other Default Options", "Otras opciones predeterminadas"),
("Closed as expected", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", "خودکار"),
("Other Default Options", "سایر گزینه های پیش فرض"),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", "Auto"),
("Other Default Options", "Autres options par défaut"),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", "Auto"),
("Other Default Options", "Altre Opzioni Predefinite"),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", "Auto"),
("Other Default Options", "Inne opcje domyślne"),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -448,7 +448,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Please confirm if you want to share your desktop?", "Подтвердите, что хотите поделиться своим рабочим столом?"),
("Closed as expected", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", "自動"),
("Other Default Options", "其它默認選項"),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -446,7 +446,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Auto", ""),
("Other Default Options", ""),
("Guest to Host", ""),
("Two way", ""),
("Dual way", ""),
("Audio Transmission Mode", ""),
].iter().cloned().collect();
}

View File

@ -669,13 +669,6 @@ impl<T: InvokeUiSession> Session<T> {
}
}
}
fn get_audio_transmission_mode(&self, id: &str) {
}
fn set_audio_transmission_mode(&self, id: &str, mode: String) {
}
}
pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {