mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	add new API call pa_cvolume_compatible()
This commit is contained in:
		
							parent
							
								
									619ed8a82d
								
							
						
					
					
						commit
						ebb2ecbe12
					
				
					 3 changed files with 19 additions and 0 deletions
				
			
		| 
						 | 
					@ -98,6 +98,7 @@ pa_context_unload_module;
 | 
				
			||||||
pa_context_unref;
 | 
					pa_context_unref;
 | 
				
			||||||
pa_cvolume_avg;
 | 
					pa_cvolume_avg;
 | 
				
			||||||
pa_cvolume_channels_equal_to;
 | 
					pa_cvolume_channels_equal_to;
 | 
				
			||||||
 | 
					pa_cvolume_compatible;
 | 
				
			||||||
pa_cvolume_equal;
 | 
					pa_cvolume_equal;
 | 
				
			||||||
pa_cvolume_max;
 | 
					pa_cvolume_max;
 | 
				
			||||||
pa_cvolume_remap;
 | 
					pa_cvolume_remap;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -325,3 +325,17 @@ pa_cvolume *pa_cvolume_remap(pa_cvolume *v, pa_channel_map *from, pa_channel_map
 | 
				
			||||||
    *v = result;
 | 
					    *v = result;
 | 
				
			||||||
    return v;
 | 
					    return v;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int pa_cvolume_compatible(const pa_cvolume *v, const pa_sample_spec *ss) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pa_assert(v);
 | 
				
			||||||
 | 
					    pa_assert(ss);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!pa_cvolume_valid(v))
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!pa_sample_spec_valid(ss))
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return v->channels == ss->channels;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -192,6 +192,10 @@ double pa_sw_volume_to_linear(pa_volume_t v) PA_GCC_CONST;
 | 
				
			||||||
/** Remap a volume from one channel mapping to a different channel mapping. \since 0.9.12 */
 | 
					/** Remap a volume from one channel mapping to a different channel mapping. \since 0.9.12 */
 | 
				
			||||||
pa_cvolume *pa_cvolume_remap(pa_cvolume *v, pa_channel_map *from, pa_channel_map *to);
 | 
					pa_cvolume *pa_cvolume_remap(pa_cvolume *v, pa_channel_map *from, pa_channel_map *to);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Return non-zero if the specified volume is compatible with
 | 
				
			||||||
 | 
					 * the specified sample spec. \since 0.9.13 */
 | 
				
			||||||
 | 
					int pa_cvolume_compatible(const pa_cvolume *v, const pa_sample_spec *ss) PA_GCC_PURE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PA_C_DECL_END
 | 
					PA_C_DECL_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue