Re: [Xastir] Bulletin received sound

2021-08-08 Thread Steve Huston
On Sun, Aug 8, 2021 at 9:50 PM David Ranch  wrote:
> Instead of calling "play_sound", why not make a system call to run a
> shell script?  Within the shell script, you can do anything you want be
> change the audio file it plays, wakes the display, sets of GPIO pin to
> light an LED, etc.

The play_sound function does make a system call, which I then set in
the config to be a shell script that does what I want.  I don't see
any other system call somewhere, and it would seem silly to add one
when this one exists (really, if I wanted it to play a sound also, I
could have it do that too while doing other things at the same time).

-- 
Steve Huston - W2SRH - Unix Sysadmin, PICSciE/CSES & Astrophysical Sci
  Princeton University  |ICBM Address: 40.346344   -74.652242
345 Lewis Library   |"On my ship, the Rocinante, wheeling through
  Princeton, NJ   08544 | the galaxies; headed for the heart of Cygnus,
(267) 793-0852  | headlong into mystery."  -Rush, 'Cygnus X-1'
___
Xastir mailing list
Xastir@lists.xastir.org
http://xastir.org/mailman/listinfo/xastir


Re: [Xastir] Bulletin received sound

2021-08-08 Thread David Ranch



Instead of calling "play_sound", why not make a system call to run a 
shell script?  Within the shell script, you can do anything you want be 
change the audio file it plays, wakes the display, sets of GPIO pin to 
light an LED, etc.


--David
KI6ZHD


On 08/08/2021 06:26 PM, Steve Huston wrote:

I have a Raspberry Pi setup running Xastir, and use the "play sound
effect" system to manually turn on the display when I receive a
message.  When I get a message it calls a script I wrote that simply
looks at the argument (.wav filename) and if it's "newmessage.wav" it
turns off the screen blanking and unsets dpms to light up the display.
This way without having the screen on all the time, it lets me know if
I have a new message.

I'd like this to work for bulletins as well, and quickly realized when
looking at the source that adding a new config option for playing a
certain message when a new bulletin is received is beyond my ability.
What is within my ability, however, is copying the call for play_sound
to the right place in db.c so that it uses the same "new message"
sound when a bulletin comes in:

diff --git a/src/db.c b/src/db.c
index 4ccfd68a..78291e64 100644
--- a/src/db.c
+++ b/src/db.c
@@ -18709,6 +18709,10 @@ int decode_message(char *call,char *path,char
*message,char from,int port,int th
{
  // fprintf(stderr,"found BLN: |%s| |%s|\n",addr,message);
  bulletin_data_add(addr,call,message,"",MESSAGE_BULLETIN,from);
+if (sound_play_new_message)
+{
+  play_sound(sound_command,sound_new_message);
+}
  done = 1;
}
if (debug_level & 1)

I'd submit this as a pull request, but it seems silly to fork the
project to add four lines to it.  If you'd like me to, I will however.
Or if you think there's a better way to do this, that's fine too.  Or
if you think you don't want it at all, I'll keep hacking my local copy
:D



___
Xastir mailing list
Xastir@lists.xastir.org
http://xastir.org/mailman/listinfo/xastir


[Xastir] Bulletin received sound

2021-08-08 Thread Steve Huston
I have a Raspberry Pi setup running Xastir, and use the "play sound
effect" system to manually turn on the display when I receive a
message.  When I get a message it calls a script I wrote that simply
looks at the argument (.wav filename) and if it's "newmessage.wav" it
turns off the screen blanking and unsets dpms to light up the display.
This way without having the screen on all the time, it lets me know if
I have a new message.

I'd like this to work for bulletins as well, and quickly realized when
looking at the source that adding a new config option for playing a
certain message when a new bulletin is received is beyond my ability.
What is within my ability, however, is copying the call for play_sound
to the right place in db.c so that it uses the same "new message"
sound when a bulletin comes in:

diff --git a/src/db.c b/src/db.c
index 4ccfd68a..78291e64 100644
--- a/src/db.c
+++ b/src/db.c
@@ -18709,6 +18709,10 @@ int decode_message(char *call,char *path,char
*message,char from,int port,int th
   {
 // fprintf(stderr,"found BLN: |%s| |%s|\n",addr,message);
 bulletin_data_add(addr,call,message,"",MESSAGE_BULLETIN,from);
+if (sound_play_new_message)
+{
+  play_sound(sound_command,sound_new_message);
+}
 done = 1;
   }
   if (debug_level & 1)

I'd submit this as a pull request, but it seems silly to fork the
project to add four lines to it.  If you'd like me to, I will however.
Or if you think there's a better way to do this, that's fine too.  Or
if you think you don't want it at all, I'll keep hacking my local copy
:D

-- 
Steve Huston - W2SRH - Unix Sysadmin, PICSciE/CSES & Astrophysical Sci
  Princeton University  |ICBM Address: 40.346344   -74.652242
345 Lewis Library   |"On my ship, the Rocinante, wheeling through
  Princeton, NJ   08544 | the galaxies; headed for the heart of Cygnus,
(267) 793-0852  | headlong into mystery."  -Rush, 'Cygnus X-1'
___
Xastir mailing list
Xastir@lists.xastir.org
http://xastir.org/mailman/listinfo/xastir