mirror of
				https://github.com/Xetibo/ReSet.git
				synced 2025-11-04 09:45:19 +01:00 
			
		
		
		
	fix: Get initial mute status for default sink and source
This commit is contained in:
		
							parent
							
								
									746b19e09d
								
							
						
					
					
						commit
						08700b824f
					
				
					 2 changed files with 20 additions and 0 deletions
				
			
		| 
						 | 
					@ -120,6 +120,16 @@ pub fn populate_sources(input_box: Arc<SourceBox>) {
 | 
				
			||||||
                    let default_sink = input_box_imp.reset_default_source.clone();
 | 
					                    let default_sink = input_box_imp.reset_default_source.clone();
 | 
				
			||||||
                    let source = default_sink.borrow();
 | 
					                    let source = default_sink.borrow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if source.muted {
 | 
				
			||||||
 | 
					                        input_box_imp
 | 
				
			||||||
 | 
					                            .reset_source_mute
 | 
				
			||||||
 | 
					                            .set_icon_name("microphone-disabled-symbolic");
 | 
				
			||||||
 | 
					                    } else {
 | 
				
			||||||
 | 
					                        input_box_imp
 | 
				
			||||||
 | 
					                            .reset_source_mute
 | 
				
			||||||
 | 
					                            .set_icon_name("audio-input-microphone-symbolic");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    let volume = source.volume.first().unwrap_or(&0_u32);
 | 
					                    let volume = source.volume.first().unwrap_or(&0_u32);
 | 
				
			||||||
                    let fraction = (*volume as f64 / 655.36).round();
 | 
					                    let fraction = (*volume as f64 / 655.36).round();
 | 
				
			||||||
                    let percentage = (fraction).to_string() + "%";
 | 
					                    let percentage = (fraction).to_string() + "%";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -119,6 +119,16 @@ pub fn populate_sinks(output_box: Arc<SinkBox>) {
 | 
				
			||||||
                    let default_sink = output_box_imp.reset_default_sink.clone();
 | 
					                    let default_sink = output_box_imp.reset_default_sink.clone();
 | 
				
			||||||
                    let sink = default_sink.borrow();
 | 
					                    let sink = default_sink.borrow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if sink.muted {
 | 
				
			||||||
 | 
					                        output_box_imp
 | 
				
			||||||
 | 
					                            .reset_sink_mute
 | 
				
			||||||
 | 
					                            .set_icon_name("audio-volume-muted-symbolic");
 | 
				
			||||||
 | 
					                    } else {
 | 
				
			||||||
 | 
					                        output_box_imp
 | 
				
			||||||
 | 
					                            .reset_sink_mute
 | 
				
			||||||
 | 
					                            .set_icon_name("audio-volume-high-symbolic");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    let volume = sink.volume.first().unwrap_or(&0);
 | 
					                    let volume = sink.volume.first().unwrap_or(&0);
 | 
				
			||||||
                    let fraction = (*volume as f64 / 655.36).round();
 | 
					                    let fraction = (*volume as f64 / 655.36).round();
 | 
				
			||||||
                    let percentage = (fraction).to_string() + "%";
 | 
					                    let percentage = (fraction).to_string() + "%";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue