notsecure / uTox

Lightweight Tox client
utox.org
GNU General Public License v3.0
597 stars 149 forks source link

play a sound when a message is received #1087

Closed linuxraspilxc closed 8 years ago

linuxraspilxc commented 9 years ago

Hello, when will this be merged?

GrayHatter commented 9 years ago

Working on a UI refactor, in addition to also trying to fix utox's hold on the openal handle, so this has been pushed to the back burner.

I'll merge it today if you can add an option to the settings page to beep on new messages. The only reason is that I hesitate to make utox make noise by surprise.

linuxraspilxc commented 9 years ago

Do you intend to keep this second notifications switch forever? I want to add other notifications (for example when a call is interrupted by broken connection etc.) later.

Am 17.06.2015 um 21:18 schrieb GrayHatter:

Working on a UI refactor, in addition to also trying to fix utox's hold on the openal handle, so this has been pushed to the back burner.

I'll merge it today if you can add an option to the settings page to beep on new messages. The only reason is that I hesitate to make utox make noise by surprise.

— Reply to this email directly or view it on GitHub https://github.com/notsecure/uTox/pull/1087#issuecomment-112918840.

GrayHatter commented 9 years ago

@linuxraspilxc if you really want to be awesome; figure out how to embed the sounds from https://github.com/zamaudio/toxsounds into a single binary and then play those sounds when needed.

There's sounds for each event, that I can think of that needs a sound. If you're able to get that working I'll add a checkbox/toggle that can be used for each sound.

I've got something like that working in #1007 for an image, just haven't gotten around to making it work with audio too.

GrayHatter commented 9 years ago

if you can get those sounds working, I'll put the switch/toggle code at the top of the list to get that PR merged ASAP (or possibly merge without it)

linuxraspilxc commented 9 years ago

I will do some research on that, however, the wave files are very large.

Am 17.06.2015 um 21:36 schrieb GrayHatter:

@linuxraspilxc https://github.com/linuxraspilxc if you really want to be awesome; figure out how to embed the sounds from https://github.com/zamaudio/toxsounds into a single binary and then play those sounds when needed.

There's sounds for each event, that I can think of that needs a sound. If you're able to get that working I'll add a checkbox/toggle that can be used for each sound.

I've got something like that working in #1007 https://github.com/notsecure/uTox/pull/1007 for an image, just haven't gotten around to making it work with audio too.

— Reply to this email directly or view it on GitHub https://github.com/notsecure/uTox/pull/1087#issuecomment-112922981.

linuxraspilxc commented 9 years ago

PS: I find the ringtone from the toxsounds quite annoying ... maybe it will be better to put the sounds separately on the filesystem instead of compiling them into the binary so the user can change the sound files.

Am 17.06.2015 um 21:39 schrieb GrayHatter:

if you can get those sounds working, I'll put the switch/toggle code at the top of the list to get that PR merged ASAP (or possibly merge without it)

— Reply to this email directly or view it on GitHub https://github.com/notsecure/uTox/pull/1087#issuecomment-112923442.

GrayHatter commented 9 years ago

We can support external files for sounds, but the executable file needs to be a single file to keep with the point of utox.

You're more than welcome to create different sounds, or try and get @zamaudio to do it. Or to omit anything you find annoying, just make sure that it remains FOSS if you want to pull from elsewhere.

linuxraspilxc commented 9 years ago

I added the switch now,

I will implement the playback of wav files later because I get quite busy some times

Am 17.06.2015 um 22:03 schrieb GrayHatter:

We can support external files for sounds, but the executable file needs to be a single file to keep with the point of utox.

You're more than welcome to create different sounds, or try and get @zamaudio https://github.com/zamaudio to do it. Or to omit anything you find annoying, just make sure that it remains FOSS if you want to pull from elsewhere.

— Reply to this email directly or view it on GitHub https://github.com/notsecure/uTox/pull/1087#issuecomment-112930126.

GrayHatter commented 9 years ago

@linuxraspilxc thanks for this, appreciate it!

GrayHatter commented 9 years ago

the utox save V2 is legacy, this patch is needed

diff --git a/main.h b/main.h
index 9320b3e..6f2c17a 100644
--- a/main.h
+++ b/main.h
@@ -64,7 +64,6 @@ typedef struct
     uint8_t proxyenable;
     uint8_t logging_enabled : 1;
     uint8_t audible_notifications_enabled : 1;
-    uint8_t audible_notifications_enabled_messages: 1;
     uint8_t filter : 1;
     uint8_t audio_filtering_enabled : 1;
     uint8_t close_to_tray : 1;
@@ -74,7 +73,9 @@ typedef struct
     uint16_t audio_device_in;
     uint16_t audio_device_out;
     uint8_t theme;
-    uint8_t nothing;
+    uint8_t push_to_talk : 1; /* Exists in PTT PR, this will cause a merge conflict. You can probably use this one. */
+    uint8_t audible_notifications_enabled_messages : 1;
+    uint8_t zero : 6;
     uint16_t unused[31];
     uint8_t proxy_ip[0];
 }UTOX_SAVE;
diff --git a/util.c b/util.c
index 2321315..d5840ba 100644
--- a/util.c
+++ b/util.c
@@ -611,7 +611,6 @@ typedef struct
     uint8_t proxyenable;
     uint8_t logging_enabled : 1;
     uint8_t audible_notifications_enabled : 1;
-    uint8_t audible_notifications_enabled_messages: 1;
     uint8_t filter : 1;
     uint8_t audio_filtering_enabled : 1;
     uint8_t zero : 4;
linuxraspilxc commented 9 years ago

Sorry, maybe too late in the evening but I don't get it. can't you merge the versions?

Am 18.06.2015 um 20:53 schrieb GrayHatter:

the utox save V2 is legacy, this patch is needed

diff --git a/main.h b/main.h index 9320b3e..6f2c17a 100644 --- a/main.h +++ b/main.h @@ -64,7 +64,6 @@ typedef struct uint8_t proxyenable; uint8_t logging_enabled : 1; uint8_t audible_notifications_enabled : 1;

  • uint8_t audible_notifications_enabled_messages: 1; uint8_t filter : 1; uint8_t audio_filtering_enabled : 1; uint8_t close_to_tray : 1; @@ -74,7 +73,9 @@ typedef struct uint16_t audio_device_in; uint16_t audio_device_out; uint8_t theme;
  • uint8_t nothing;
  • uint8_t push_to_talk : 1; /* Exists in PTT PR, this will cause a merge conflict. You can probably use this one. */
  • uint8_t audible_notifications_enabled_messages : 1;
  • uint8_t zero : 6; uint16_t unused[31]; uint8_t proxy_ip[0]; }UTOX_SAVE; diff --git a/util.c b/util.c index 2321315..d5840ba 100644 --- a/util.c +++ b/util.c @@ -611,7 +611,6 @@ typedef struct uint8_t proxyenable; uint8_t logging_enabled : 1; uint8_t audible_notifications_enabled : 1;
  • uint8_t audible_notifications_enabled_messages: 1; uint8_t filter : 1; uint8_t audio_filtering_enabled : 1; uint8_t zero : 4;

— Reply to this email directly or view it on GitHub https://github.com/notsecure/uTox/pull/1087#issuecomment-113256732.

GrayHatter commented 9 years ago

I can, but you need to patch these changes. I can merge in all of your changes, but the PR currently breaks the save file, the patch above corrects the problems.

I can just do it myself, but it really should be part of your PR.

Either way, you can ignore that patch.diff and I'll get to testing it soonish

linuxraspilxc commented 9 years ago

Done

Am 18.06.2015 um 21:40 schrieb GrayHatter:

I can, but you need to patch these changes. I can merge in all of your changes, but the PR currently breaks the save file, the patch above corrects the problems.

I can just do it myself, but it really should be part of your PR.

Either way, you can ignore that patch.diff and I'll get to testing it soonish

— Reply to this email directly or view it on GitHub https://github.com/notsecure/uTox/pull/1087#issuecomment-113268530.

GrayHatter commented 9 years ago

let me do a bit more testing and then merge if it's ready

GrayHatter commented 9 years ago

@linuxraspilxc sorry, haven't forgotten, just busy.

linuxraspilxc commented 9 years ago

Same here On 24.06.2015 19:05, GrayHatter wrote:

@linuxraspilxc https://github.com/linuxraspilxc sorry, haven't forgotten, just busy.

— Reply to this email directly or view it on GitHub https://github.com/notsecure/uTox/pull/1087#issuecomment-114943233.

GrayHatter commented 8 years ago

I can't merge this at this point, could you resubmit this to https://github.com/grayhatter/utox to the new_av_api branch, or to develop if it's 2015-10-23?