From 5a55f738a9e07af9aa9341742293532a1b997072 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Thu, 24 Jul 2014 13:05:56 +0200 Subject: [PATCH 1/2] README.md: add precompiled binaries --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 7bfe35c..32972d7 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,11 @@ echo '/usr/local/lib/' | sudo tee -a /etc/ld.so.conf.d/locallib.conf sudo ldconfig ``` +## Precompiled binaries +You can download precompiled binaries from [jenkins](https://jenkins.libtoxcore.so): +* [Linux 32 bit](https://jenkins.libtoxcore.so/job/toxic_linux_i386/lastSuccessfulBuild/artifact/toxic_linux_i386.tar.xz) +* [Linux 64 bit](https://jenkins.libtoxcore.so/job/toxic_linux_amd64/lastSuccessfulBuild/artifact/toxic_linux_amd64.tar.xz) + ## Settings Running Toxic for the first time creates an empty file called toxic.conf in your home configuration directory ("~/.config/tox" for Linux users). Adding options to this file allows you to enable auto-logging, change the time format (12/24 hour), and much more. You can view our example config file [here](misc/toxic.conf.example). From 3a1e23a3ff720cc8907e92bfd27e7fbea68bb4d5 Mon Sep 17 00:00:00 2001 From: mannol Date: Fri, 25 Jul 2014 02:12:32 +0200 Subject: [PATCH 2/2] Fixed sounds not playing --- src/friendlist.c | 4 ++-- src/notify.c | 19 +++++++++++-------- src/settings.c | 22 +++++++++++----------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/friendlist.c b/src/friendlist.c index 5f884c6..fb69188 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -106,7 +106,7 @@ static void friendlist_onMessage(ToxWindow *self, Tox *m, int32_t num, const cha if (friends[num].chatwin == -1) { if (get_num_active_windows() < MAX_WINDOWS_NUM) { friends[num].chatwin = add_window(m, new_chat(m, friends[num].num)); - notify(self, generic_message, NT_NOFOCUS); + notify(self, generic_message, NT_WNDALERT_0 | NT_NOFOCUS); } else { char nick[TOX_MAX_NAME_LENGTH]; get_nick_truncate(m, nick, num); @@ -240,7 +240,7 @@ static void friendlist_onGroupInvite(ToxWindow *self, Tox *m, int32_t num, const if (friends[num].chatwin == -1) { if (get_num_active_windows() < MAX_WINDOWS_NUM) { friends[num].chatwin = add_window(m, new_chat(m, friends[num].num)); - notify(self, generic_message, NT_NOFOCUS); + notify(self, generic_message, NT_WNDALERT_0 | NT_NOFOCUS); } else { char nick[TOX_MAX_NAME_LENGTH]; diff --git a/src/notify.c b/src/notify.c index df3e7af..f89120f 100644 --- a/src/notify.c +++ b/src/notify.c @@ -235,10 +235,12 @@ void terminate_notify() #ifdef _SOUND_NOTIFY int set_sound(Notification sound, const char* value) { + if (sound == silent) return 0; + free(Control.sounds[sound]); size_t len = strlen(value) + 1; - Control.sounds[sound] = calloc(1, len); + Control.sounds[sound] = calloc(len, 1); memcpy(Control.sounds[sound], value, len); struct stat buf; @@ -252,7 +254,7 @@ int play_sound_internal(Notification what, _Bool loop) alGenSources(1, &source); alGenBuffers(1, &buffer); - buffer = alutCreateBufferFromFile((const char*)Control.sounds[what]); + buffer = alutCreateBufferFromFile(Control.sounds[what]); alSourcei(source, AL_BUFFER, buffer); alSourcei(source, AL_LOOPING, loop); @@ -310,6 +312,13 @@ static int m_play_sound(Notification notif, uint64_t flags) int notify(ToxWindow* self, Notification notif, uint64_t flags) { + /* Consider colored notify as primary */ + if (self && self->alert == WINDOW_ALERT_NONE) { + if (flags & NT_WNDALERT_0) self->alert = WINDOW_ALERT_0; + else if (flags & NT_WNDALERT_1) self->alert = WINDOW_ALERT_1; + else if (flags & NT_WNDALERT_2) self->alert = WINDOW_ALERT_2; + } + if (flags & NT_NOFOCUS && Control.this_window == get_focused_window_id()) return -1; @@ -325,11 +334,5 @@ int notify(ToxWindow* self, Notification notif, uint64_t flags) /* TODO: pop notify window */ } - if (self && self->alert == WINDOW_ALERT_NONE) { - if (flags & NT_WNDALERT_0) self->alert = WINDOW_ALERT_0; - else if (flags & NT_WNDALERT_1) self->alert = WINDOW_ALERT_1; - else if (flags & NT_WNDALERT_2) self->alert = WINDOW_ALERT_2; - } - return rc; } diff --git a/src/settings.c b/src/settings.c index 408c7ee..4f7008d 100644 --- a/src/settings.c +++ b/src/settings.c @@ -205,61 +205,61 @@ int settings_load(struct user_settings *s, const char *patharg) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) set_sound(call_outgoing, PACKAGE_DATADIR "/sounds/OutgoingCall.wav"); } - if ( config_setting_lookup_string(setting, sound_strings.generic_message, &str) || + if ( !config_setting_lookup_string(setting, sound_strings.generic_message, &str) || !set_sound(generic_message, str) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) 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) ) { - if (strcasecmp(str, NO_SOUND)) + if (strcasecmp(str, NO_SOUND) != 0) set_sound(transfer_completed, PACKAGE_DATADIR "/sounds/TransferComplete.wav"); } }