mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-14 05:33:03 +01:00
allow disabling of individual sounds
This commit is contained in:
parent
04fbf5f724
commit
9476db02a9
@ -252,6 +252,8 @@ tox = {
|
||||
.br
|
||||
};
|
||||
.br
|
||||
// To disable a sound set the path to "silent"
|
||||
.br
|
||||
sounds = {
|
||||
.br
|
||||
error="__DATADIR__/sounds/Error.wav";
|
||||
|
@ -37,6 +37,7 @@ tox = {
|
||||
// download_path="/home/USERNAME/Downloads/";
|
||||
};
|
||||
|
||||
// To disable a sound set the path to "silent"
|
||||
sounds = {
|
||||
error="__DATADIR__/sounds/Error.wav";
|
||||
self_log_in="__DATADIR__/sounds/LogIn.wav";
|
||||
|
@ -40,6 +40,8 @@
|
||||
#define PACKAGE_DATADIR "."
|
||||
#endif
|
||||
|
||||
#define NO_SOUND "silent"
|
||||
|
||||
const struct _ui_strings {
|
||||
const char* self;
|
||||
const char* timestamps;
|
||||
@ -202,45 +204,65 @@ int settings_load(struct user_settings *s, const char *patharg)
|
||||
#ifdef _SOUND_NOTIFY
|
||||
if ((setting = config_lookup(cfg, sound_strings.self)) != NULL) {
|
||||
if ( (config_setting_lookup_string(setting, sound_strings.error, &str) != CONFIG_TRUE) ||
|
||||
!set_sound(error, str) )
|
||||
!set_sound(error, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(error, PACKAGE_DATADIR "/sounds/Error.wav");
|
||||
}
|
||||
|
||||
if ( !config_setting_lookup_string(setting, sound_strings.user_log_in, &str) ||
|
||||
!set_sound(user_log_in, str) )
|
||||
!set_sound(user_log_in, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(user_log_in, PACKAGE_DATADIR "/sounds/ContactLogsIn.wav");
|
||||
}
|
||||
|
||||
if ( !config_setting_lookup_string(setting, sound_strings.self_log_in, &str) ||
|
||||
!set_sound(self_log_in, str) )
|
||||
!set_sound(self_log_in, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(self_log_in, PACKAGE_DATADIR "/sounds/LogIn.wav");
|
||||
}
|
||||
|
||||
if ( !config_setting_lookup_string(setting, sound_strings.user_log_out, &str) ||
|
||||
!set_sound(user_log_out, str) )
|
||||
!set_sound(user_log_out, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(user_log_out, PACKAGE_DATADIR "/sounds/ContactLogsOut.wav");
|
||||
}
|
||||
|
||||
if ( !config_setting_lookup_string(setting, sound_strings.self_log_out, &str) ||
|
||||
!set_sound(self_log_out, str) )
|
||||
!set_sound(self_log_out, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(self_log_out, PACKAGE_DATADIR "/sounds/LogOut.wav");
|
||||
}
|
||||
|
||||
if ( !config_setting_lookup_string(setting, sound_strings.call_incoming, &str) ||
|
||||
!set_sound(call_incoming, str) )
|
||||
!set_sound(call_incoming, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(call_incoming, PACKAGE_DATADIR "/sounds/IncomingCall.wav");
|
||||
}
|
||||
|
||||
if ( !config_setting_lookup_string(setting, sound_strings.call_outgoing, &str) ||
|
||||
!set_sound(call_outgoing, str) )
|
||||
!set_sound(call_outgoing, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(call_outgoing, PACKAGE_DATADIR "/sounds/OutgoingCall.wav");
|
||||
}
|
||||
|
||||
if ( config_setting_lookup_string(setting, sound_strings.generic_message, &str) ||
|
||||
!set_sound(generic_message, str) )
|
||||
!set_sound(generic_message, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(generic_message, PACKAGE_DATADIR "/sounds/NewMessage.wav");
|
||||
}
|
||||
|
||||
if ( !config_setting_lookup_string(setting, sound_strings.transfer_pending, &str) ||
|
||||
!set_sound(transfer_pending, str) )
|
||||
!set_sound(transfer_pending, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(transfer_pending, PACKAGE_DATADIR "/sounds/TransferPending.wav");
|
||||
}
|
||||
|
||||
if ( !config_setting_lookup_string(setting, sound_strings.transfer_completed, &str) ||
|
||||
!set_sound(transfer_completed, str) )
|
||||
!set_sound(transfer_completed, str) ) {
|
||||
if (strcasecmp(str, NO_SOUND))
|
||||
set_sound(transfer_completed, PACKAGE_DATADIR "/sounds/TransferComplete.wav");
|
||||
}
|
||||
}
|
||||
else {
|
||||
set_sound(error, PACKAGE_DATADIR "/sounds/Error.wav");
|
||||
set_sound(user_log_in, PACKAGE_DATADIR "/sounds/ContactLogsIn.wav");
|
||||
|
Loading…
Reference in New Issue
Block a user