mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-07-01 15:57:46 +02:00
chore: Code cleanup
This commit is contained in:
parent
eed10e8b63
commit
e1cd11e601
21 changed files with 55 additions and 55 deletions
|
@ -37,7 +37,7 @@ impl InputStreamEntry {
|
|||
}
|
||||
let name = stream.application_name.clone() + ": " + stream.name.as_str();
|
||||
imp.resetSinkName.set_text(name.as_str());
|
||||
let volume = stream.volume.first().unwrap_or_else(|| &(0 as u32));
|
||||
let volume = stream.volume.first().unwrap_or(&0_u32);
|
||||
let fraction = (*volume as f64 / 655.36).round();
|
||||
let percentage = (fraction).to_string() + "%";
|
||||
imp.resetVolumePercentage.set_text(&percentage);
|
||||
|
|
|
@ -445,7 +445,7 @@ pub fn start_output_box_listener(conn: Connection, sink_box: Arc<SinkBox>) -> Co
|
|||
let output_box = sink_box.clone();
|
||||
let output_box_imp = output_box.imp();
|
||||
let is_default = ir.sink.name == default_sink.name;
|
||||
let volume = ir.sink.volume.first().unwrap_or_else(|| &(0 as u32));
|
||||
let volume = ir.sink.volume.first().unwrap_or(&0_u32);
|
||||
let fraction = (*volume as f64 / 655.36).round();
|
||||
let percentage = (fraction).to_string() + "%";
|
||||
|
||||
|
@ -532,7 +532,7 @@ pub fn start_output_box_listener(conn: Connection, sink_box: Arc<SinkBox>) -> Co
|
|||
}
|
||||
let name = ir.stream.application_name.clone() + ": " + ir.stream.name.as_str();
|
||||
imp.resetSinkName.set_text(name.as_str());
|
||||
let volume = ir.stream.volume.first().unwrap_or_else(|| &(0 as u32));
|
||||
let volume = ir.stream.volume.first().unwrap_or(&0_u32);
|
||||
let fraction = (*volume as f64 / 655.36).round();
|
||||
let percentage = (fraction).to_string() + "%";
|
||||
imp.resetVolumePercentage.set_text(&percentage);
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::components::base::listEntry::ListEntry;
|
|||
use crate::components::output::inputStreamEntry::InputStreamEntry;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{
|
||||
glib, Box, Button, CheckButton, CompositeTemplate, DropDown, Label, StringList, TemplateChild,
|
||||
glib, Box, Button, CheckButton, CompositeTemplate, Label, StringList, TemplateChild,
|
||||
};
|
||||
use gtk::{prelude::*, ProgressBar, Scale};
|
||||
use ReSet_Lib::audio::audio::Sink;
|
||||
|
|
|
@ -28,7 +28,7 @@ impl SinkEntry {
|
|||
let imp = obj.imp();
|
||||
imp.resetSinkName.set_text(stream.alias.clone().as_str());
|
||||
let name = Arc::new(stream.name.clone());
|
||||
let volume = stream.volume.first().unwrap_or_else(|| &(0 as u32));
|
||||
let volume = stream.volume.first().unwrap_or(&0_u32);
|
||||
let fraction = (*volume as f64 / 655.36).round();
|
||||
let percentage = (fraction).to_string() + "%";
|
||||
imp.resetVolumePercentage.set_text(&percentage);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue