mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-07-12 20:57:46 +02:00
feat: Add basic functionality to all audio usecases
This commit is contained in:
parent
2f1099267a
commit
c1984b5b79
32 changed files with 368 additions and 201 deletions
|
@ -5,8 +5,8 @@ use std::sync::Arc;
|
|||
use crate::components::base::settingBox::SettingBox;
|
||||
use crate::components::base::utils::Listeners;
|
||||
use crate::components::bluetooth::bluetoothBox::BluetoothBox;
|
||||
use crate::components::input::sourceBox::SourceBox;
|
||||
use crate::components::output::audioBox::{populate_streams, AudioBox, populate_sinks};
|
||||
use crate::components::input::sourceBox::{SourceBox, populate_outputstreams, populate_sources};
|
||||
use crate::components::output::sinkBox::{SinkBox, populate_inputstreams, populate_sinks};
|
||||
use crate::components::wifi::wifiBox::{scanForWifi, show_stored_connections, WifiBox};
|
||||
use gtk::prelude::WidgetExt;
|
||||
use gtk::{FlowBox, Frame, Label};
|
||||
|
@ -63,11 +63,14 @@ pub const HANDLE_AUDIO_CLICK: fn(Arc<Listeners>, FlowBox) =
|
|||
listeners.stop_network_listener();
|
||||
listeners.bluetooth_listener.store(false, Ordering::SeqCst);
|
||||
listeners.pulse_listener.store(true, Ordering::SeqCst);
|
||||
let audioOutput = Arc::new(AudioBox::new());
|
||||
populate_streams(listeners.clone(), audioOutput.clone());
|
||||
let audioOutput = Arc::new(SinkBox::new());
|
||||
populate_inputstreams(listeners.clone(), audioOutput.clone());
|
||||
populate_sinks(audioOutput.clone());
|
||||
let audioFrame = wrapInFrame(SettingBox::new(&*audioOutput));
|
||||
let sourceFrame = wrapInFrame(SettingBox::new(&SourceBox::new()));
|
||||
let audioInput = Arc::new(SourceBox::new());
|
||||
populate_outputstreams(listeners.clone(), audioInput.clone());
|
||||
populate_sources(audioInput.clone());
|
||||
let sourceFrame = wrapInFrame(SettingBox::new(&*audioInput));
|
||||
resetMain.remove_all();
|
||||
resetMain.insert(&audioFrame, -1);
|
||||
resetMain.insert(&sourceFrame, -1);
|
||||
|
@ -79,8 +82,8 @@ pub const HANDLE_VOLUME_CLICK: fn(Arc<Listeners>, FlowBox) =
|
|||
listeners.stop_network_listener();
|
||||
listeners.bluetooth_listener.store(false, Ordering::SeqCst);
|
||||
listeners.pulse_listener.store(false, Ordering::SeqCst);
|
||||
let audioOutput = Arc::new(AudioBox::new());
|
||||
populate_streams(listeners.clone(), audioOutput.clone());
|
||||
let audioOutput = Arc::new(SinkBox::new());
|
||||
populate_inputstreams(listeners.clone(), audioOutput.clone());
|
||||
populate_sinks(audioOutput.clone());
|
||||
let audioFrame = wrapInFrame(SettingBox::new(&*audioOutput));
|
||||
resetMain.remove_all();
|
||||
|
@ -93,7 +96,10 @@ pub const HANDLE_MICROPHONE_CLICK: fn(Arc<Listeners>, FlowBox) =
|
|||
listeners.stop_network_listener();
|
||||
listeners.bluetooth_listener.store(false, Ordering::SeqCst);
|
||||
listeners.pulse_listener.store(false, Ordering::SeqCst);
|
||||
let sourceFrame = wrapInFrame(SettingBox::new(&SourceBox::new()));
|
||||
let audioInput = Arc::new(SourceBox::new());
|
||||
populate_outputstreams(listeners.clone(), audioInput.clone());
|
||||
populate_sources(audioInput.clone());
|
||||
let sourceFrame = wrapInFrame(SettingBox::new(&*audioInput));
|
||||
resetMain.remove_all();
|
||||
resetMain.insert(&sourceFrame, -1);
|
||||
resetMain.set_max_children_per_line(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue