The phone had no voice channel view: the people, the streams and the channel's chat were spread over three tabs, and watching replaced the Chat tab with a bare player. The voice channel now has a screen of its own (design mockup 02): the channel's name and topic with Leave, the stream we watch with LIVE, viewers, quality, volume and full screen (or a card to watch one), the people with talking and muted marks, crowns and LIVE, an Invite button that copies a ts3server:// link to the channel, the channel chat with its pins, topics and members, the composer with hold-to-talk when push-to-talk is the transmit mode, and Mute, Deafen, Go Live, Share and Leave in place of the navigation. It opens from the top bar's voice button, the voice card, the Activity tab and by watching a stream; back keeps a stream playing behind it. The navigation: Home's server cards and Open went nowhere on the phone (the Home tab stayed); a server now switches to the Servers tab. The Chat tab is Chats and stays the chat while watching. The studio, like the voice screen, goes without the bottom bar, as its mockup does. The pins, topics and server members (beside the chat on the desktop) open as pages over the phone's screen. Home gains what mockup 01 has and the engine knows: who is online on the current server, its chats with their last message and time (emoji left out of the one-line preview), the servers (side by side on the phone) and the streams of our channel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
2.0 KiB
Rust
66 lines
2.0 KiB
Rust
//! The rail, the server card, the channel tree and the voice controls.
|
|
|
|
use slint::ComponentHandle;
|
|
use voelin_core::Command;
|
|
use voelin_model::ChannelId;
|
|
|
|
use crate::app::{Bridge, MainWindow, with_app};
|
|
|
|
pub(super) fn wire(ui: &MainWindow) {
|
|
let bridge = ui.global::<Bridge>();
|
|
bridge.on_select_server(|id| {
|
|
with_app(|app| app.select_server(id as i64));
|
|
});
|
|
bridge.on_search(|text| {
|
|
with_app(|app| app.search(text.to_string()));
|
|
});
|
|
bridge.on_search_members(|text| {
|
|
with_app(|app| app.search_members(text.to_string()));
|
|
});
|
|
bridge.on_show_voice_view(|on| {
|
|
with_app(|app| app.show_voice_view(on));
|
|
});
|
|
bridge.on_connect_voice(|| {
|
|
with_app(|app| app.connect_voice());
|
|
});
|
|
bridge.on_disconnect_voice(|| {
|
|
with_app(|app| app.command(|session| Command::DisconnectVoice { session }));
|
|
});
|
|
bridge.on_toggle_observe(|| {
|
|
with_app(|app| app.toggle_observe());
|
|
});
|
|
bridge.on_join_channel(|cid| {
|
|
with_app(|app| {
|
|
app.command(|session| Command::MoveToChannel {
|
|
session,
|
|
channel: cid as ChannelId,
|
|
password: None,
|
|
})
|
|
});
|
|
});
|
|
bridge.on_toggle_collapse(|cid| {
|
|
with_app(|app| app.toggle_collapse(cid as ChannelId));
|
|
});
|
|
bridge.on_set_input_muted(|muted| {
|
|
with_app(|app| app.command(|session| Command::SetInputMuted { session, muted }));
|
|
});
|
|
bridge.on_set_output_muted(|muted| {
|
|
with_app(|app| app.command(|session| Command::SetOutputMuted { session, muted }));
|
|
});
|
|
bridge.on_push_to_talk(|on| {
|
|
with_app(|app| app.command(|session| Command::SetTransmitting { session, on }));
|
|
});
|
|
bridge.on_edit_bookmark(|id| with_app(|app| app.bookmark_form(id as i64)).unwrap_or_default());
|
|
bridge.on_save_bookmark(|form| {
|
|
with_app(|app| app.save_bookmark(form));
|
|
});
|
|
bridge.on_delete_bookmark(|id| {
|
|
with_app(|app| app.delete_bookmark(id as i64));
|
|
});
|
|
bridge.on_open_client(|id| with_app(|app| app.open_client(id as u16)).unwrap_or(false));
|
|
bridge.on_client_audio_changed(|form| {
|
|
with_app(|app| app.client_playback_changed(&form));
|
|
});
|
|
bridge.on_invite(|| with_app(|app| app.invite_link()).unwrap_or_default().into());
|
|
}
|