Add methods to LinphoneCall to set/get playback and record volume

This commit is contained in:
François Grisez 2015-07-27 12:19:26 +02:00
parent 1308b23715
commit db1433aba5
2 changed files with 63 additions and 0 deletions

View file

@ -3203,6 +3203,32 @@ float linphone_call_get_record_volume(LinphoneCall *call){
return LINPHONE_VOLUME_DB_LOWEST;
}
double linphone_call_get_play_percent_volume(const LinphoneCall *call) {
if(call->audiostream) return audio_stream_get_output_volume(call->audiostream);
else {
ms_error("Could not get playback volume: no audio stream");
return -1.0;
}
}
void linphone_call_set_play_percent_volume(LinphoneCall *call, double volume) {
if(call->audiostream) audio_stream_set_output_volume(call->audiostream, volume);
else ms_error("Could not set playback volume: no audio stream");
}
double linphone_call_get_record_percent_volume(const LinphoneCall *call) {
if(call->audiostream) return audio_stream_get_input_volume(call->audiostream);
else {
ms_error("Could not get record volume: no audio stream");
return -1.0;
}
}
void linphone_call_set_record_percent_volume(LinphoneCall *call, double volume) {
if(call->audiostream) audio_stream_set_input_volume(call->audiostream, volume);
else ms_error("Could not set record volume: no audio stream");
}
/**
* Obtain real-time quality rating of the call
*

View file

@ -721,6 +721,43 @@ LINPHONE_PUBLIC const char *linphone_call_get_remote_user_agent(LinphoneCall *ca
LINPHONE_PUBLIC const char *linphone_call_get_remote_contact(LinphoneCall *call);
LINPHONE_PUBLIC float linphone_call_get_play_volume(LinphoneCall *call);
LINPHONE_PUBLIC float linphone_call_get_record_volume(LinphoneCall *call);
/**
* @brief Get playback volume.
*
* @param call The call.
* @return double Percenatge of the max supported volume. Valid values are in [ 0.0 : 1.0 ].
* In case of failure, a negative value is returned
*/
LINPHONE_PUBLIC double linphone_call_get_play_percent_volume(const LinphoneCall *call);
/**
* @brief Set playback volume.
*
* @param call The call.
* @param volume New volume in percentage of the max supported volume. Valid values are in [ 0.0 : 1.0 ].
* @return void
*/
LINPHONE_PUBLIC void linphone_call_set_play_percent_volume(LinphoneCall *call, double volume);
/**
* @brief Get record volume.
*
* @param call The call.
* @return double Percenatge of the max supported volume. Valid values are in [ 0.0 : 1.0 ].
* In case of failure, a negative value is returned
*/
LINPHONE_PUBLIC double linphone_call_get_record_percent_volume(const LinphoneCall *call);
/**
* @brief Set record volume.
*
* @param call The call.
* @param volume New volume in percentage of the max supported volume. Valid values are in [ 0.0 : 1.0 ].
* @return void
*/
LINPHONE_PUBLIC void linphone_call_set_record_percent_volume(LinphoneCall *call, double volume);
LINPHONE_PUBLIC float linphone_call_get_current_quality(LinphoneCall *call);
LINPHONE_PUBLIC float linphone_call_get_average_quality(LinphoneCall *call);
LINPHONE_PUBLIC const char* linphone_call_get_authentication_token(LinphoneCall *call);