mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-10-29 05:40:23 -04:00 
			
		
		
		
	introduce pa_sink_input_get_relative_volume()
This commit is contained in:
		
							parent
							
								
									bd3154a861
								
							
						
					
					
						commit
						a998038ee2
					
				
					 2 changed files with 23 additions and 0 deletions
				
			
		|  | @ -923,6 +923,28 @@ const pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i) { | |||
|     return &i->virtual_volume; | ||||
| } | ||||
| 
 | ||||
| /* Called from main context */ | ||||
| pa_cvolume *pa_sink_input_get_relative_volume(pa_sink_input *i, pa_cvolume *v) { | ||||
|     pa_sink_input_assert_ref(i); | ||||
|     pa_assert(v); | ||||
|     pa_assert(PA_SINK_INPUT_IS_LINKED(i->state)); | ||||
| 
 | ||||
|     *v = i->virtual_volume; | ||||
| 
 | ||||
|     /* This always returns a relative volume, even in flat volume mode */ | ||||
| 
 | ||||
|     if (i->sink->flags & PA_SINK_FLAT_VOLUME) { | ||||
|         pa_cvolume sv; | ||||
| 
 | ||||
|         sv = *pa_sink_get_volume(i->sink, FALSE); | ||||
| 
 | ||||
|         pa_sw_cvolume_divide(v, v, | ||||
|                              pa_cvolume_remap(&sv, &i->sink->channel_map, &i->channel_map)); | ||||
|     } | ||||
| 
 | ||||
|     return v; | ||||
| } | ||||
| 
 | ||||
| /* Called from main context */ | ||||
| void pa_sink_input_set_mute(pa_sink_input *i, pa_bool_t mute, pa_bool_t save) { | ||||
|     pa_assert(i); | ||||
|  |  | |||
|  | @ -302,6 +302,7 @@ pa_usec_t pa_sink_input_get_latency(pa_sink_input *i, pa_usec_t *sink_latency); | |||
| 
 | ||||
| void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, pa_bool_t save); | ||||
| const pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i); | ||||
| pa_cvolume *pa_sink_input_get_relative_volume(pa_sink_input *i, pa_cvolume *v); | ||||
| void pa_sink_input_set_mute(pa_sink_input *i, pa_bool_t mute, pa_bool_t save); | ||||
| pa_bool_t pa_sink_input_get_mute(pa_sink_input *i); | ||||
| void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_proplist *p); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lennart Poettering
						Lennart Poettering