Fossil

Check-in [35b07813a8]
Login

Check-in [35b07813a8]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Two new alert sounds.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 35b07813a89148c580269e47b50c689ef2e6660ac7882776b95b8e3d3db39bd7
User & Date: drh 2021-01-05 19:23:28.454
Context
2021-01-05
19:24
Remove a debugging printf() that was mistakenly left in the previous check-in. ... (check-in: 42efc62951 user: drh tags: trunk)
19:23
Two new alert sounds. ... (check-in: 35b07813a8 user: drh tags: trunk)
19:05
Provide for two different chat-alert sounds in the /Admin/Chat configuration menu. ... (check-in: d8e6994350 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Added src/alerts/bflat2.wav.

cannot compute difference between binary files

Added src/alerts/bloop.wav.

cannot compute difference between binary files

Changes to src/alerts/mkwav.c.
57
58
59
60
61
62
63
64
65
66



67






68
69
70
71
72
73
74
75
76
77
78
79
int main(int argc, char **argv){
  int i = 0;
  unsigned char aBuf[800];
# define N      sizeof(aBuf)
# define pitch1 195.9977*2   /* G */
# define pitch2 233.0819*2   /* B-flat */
# define pitch3 293.6648*2   /* D */
  while( i<N ){
    double v;
    v = 33.0*sin((2*M_PI*pitch1*i)/8000);



    v += 33.0*sin((2*M_PI*pitch2*i)/8000);






    v += 33.0*sin((2*M_PI*pitch3*i)/8000);
    if( i<100 ){
      v = v*i/100.0;
    }else if( i>N-100 ){
      v = v*(N-i)/100.0;
    }
    aBuf[i] = (char)(v+99.0);
    i++;
  }
  write_wave("out.wav", N, aBuf);
  return 0;
}







|

|
>
>
>
|
>
>
>
>
>
>
|
|
|
|
|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
int main(int argc, char **argv){
  int i = 0;
  unsigned char aBuf[800];
# define N      sizeof(aBuf)
# define pitch1 195.9977*2   /* G */
# define pitch2 233.0819*2   /* B-flat */
# define pitch3 293.6648*2   /* D */
  while( i<N/2 ){
    double v;
    v = 99.0*sin((2*M_PI*pitch3*i)/8000);
    if( i<200 ){
      v = v*i/200.0;
    }else if( i>N-200 ){
      v = v*(N-i)/200.0;
    }
    aBuf[i] = (char)(v+99.0);
    i++;
  }
  while( i<N ){
    double v;
    v = 99.0*sin((2*M_PI*pitch1*i)/8000);
    if( i<200 ){
      v = v*i/200.0;
    }else if( i>N-200 ){
      v = v*(N-i)/200.0;
    }
    aBuf[i] = (char)(v+99.0);
    i++;
  }
  write_wave("out.wav", N, aBuf);
  return 0;
}
Changes to src/chat.c.
711
712
713
714
715
716
717

718
719
720
721
722
723
724
** arrives.
*/
void chat_audio_alert(void){
  Blob audio = empty_blob;
  int n = 0;
  const char *zName = db_get("chat-alert-sound", "alerts/plunk.wav");
  const char *zAudio = (const char*)builtin_file(zName, &n);

  blob_init(&audio, zAudio, n);
  cgi_set_content_type("audio/wav");
  cgi_set_content(&audio);  
}

/*
** COMMAND: chat







>







711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
** arrives.
*/
void chat_audio_alert(void){
  Blob audio = empty_blob;
  int n = 0;
  const char *zName = db_get("chat-alert-sound", "alerts/plunk.wav");
  const char *zAudio = (const char*)builtin_file(zName, &n);
fprintf(stderr, "ALERT: %s (%d)\n", zName, n);
  blob_init(&audio, zAudio, n);
  cgi_set_content_type("audio/wav");
  cgi_set_content(&audio);  
}

/*
** COMMAND: chat
Changes to src/main.mk.
218
219
220
221
222
223
224

225

226
227
228
229
230
231
232
  $(SRCDIR)/../skins/rounded1/footer.txt \
  $(SRCDIR)/../skins/rounded1/header.txt \
  $(SRCDIR)/../skins/xekri/css.txt \
  $(SRCDIR)/../skins/xekri/details.txt \
  $(SRCDIR)/../skins/xekri/footer.txt \
  $(SRCDIR)/../skins/xekri/header.txt \
  $(SRCDIR)/accordion.js \

  $(SRCDIR)/alerts/bflat3.wav \

  $(SRCDIR)/alerts/plunk.wav \
  $(SRCDIR)/chat.js \
  $(SRCDIR)/ci_edit.js \
  $(SRCDIR)/copybtn.js \
  $(SRCDIR)/default.css \
  $(SRCDIR)/diff.tcl \
  $(SRCDIR)/forum.js \







>

>







218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
  $(SRCDIR)/../skins/rounded1/footer.txt \
  $(SRCDIR)/../skins/rounded1/header.txt \
  $(SRCDIR)/../skins/xekri/css.txt \
  $(SRCDIR)/../skins/xekri/details.txt \
  $(SRCDIR)/../skins/xekri/footer.txt \
  $(SRCDIR)/../skins/xekri/header.txt \
  $(SRCDIR)/accordion.js \
  $(SRCDIR)/alerts/bflat2.wav \
  $(SRCDIR)/alerts/bflat3.wav \
  $(SRCDIR)/alerts/bloop.wav \
  $(SRCDIR)/alerts/plunk.wav \
  $(SRCDIR)/chat.js \
  $(SRCDIR)/ci_edit.js \
  $(SRCDIR)/copybtn.js \
  $(SRCDIR)/default.css \
  $(SRCDIR)/diff.tcl \
  $(SRCDIR)/forum.js \
Changes to src/setup.c.
1127
1128
1129
1130
1131
1132
1133


1134
1135
1136
1137
1138
1139
1140
**
** The "Admin/Chat" page.  Requires Setup privilege.
*/
void setup_chat(void){
  static const char *const azAlerts[] = {
    "alerts/plunk.wav",  "Plunk",
    "alerts/bflat3.wav", "Tone-1",


  };

  login_check_credentials();
  if( !g.perm.Setup ){
    login_needed(0);
    return;
  }







>
>







1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
**
** The "Admin/Chat" page.  Requires Setup privilege.
*/
void setup_chat(void){
  static const char *const azAlerts[] = {
    "alerts/plunk.wav",  "Plunk",
    "alerts/bflat3.wav", "Tone-1",
    "alerts/bflat2.wav", "Tone-2",
    "alerts/bloop.wav",  "Bloop",
  };

  login_check_credentials();
  if( !g.perm.Setup ){
    login_needed(0);
    return;
  }
Changes to win/Makefile.mingw.
630
631
632
633
634
635
636

637

638
639
640
641
642
643
644
  $(SRCDIR)/../skins/rounded1/footer.txt \
  $(SRCDIR)/../skins/rounded1/header.txt \
  $(SRCDIR)/../skins/xekri/css.txt \
  $(SRCDIR)/../skins/xekri/details.txt \
  $(SRCDIR)/../skins/xekri/footer.txt \
  $(SRCDIR)/../skins/xekri/header.txt \
  $(SRCDIR)/accordion.js \

  $(SRCDIR)/alerts/bflat3.wav \

  $(SRCDIR)/alerts/plunk.wav \
  $(SRCDIR)/chat.js \
  $(SRCDIR)/ci_edit.js \
  $(SRCDIR)/copybtn.js \
  $(SRCDIR)/default.css \
  $(SRCDIR)/diff.tcl \
  $(SRCDIR)/forum.js \







>

>







630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
  $(SRCDIR)/../skins/rounded1/footer.txt \
  $(SRCDIR)/../skins/rounded1/header.txt \
  $(SRCDIR)/../skins/xekri/css.txt \
  $(SRCDIR)/../skins/xekri/details.txt \
  $(SRCDIR)/../skins/xekri/footer.txt \
  $(SRCDIR)/../skins/xekri/header.txt \
  $(SRCDIR)/accordion.js \
  $(SRCDIR)/alerts/bflat2.wav \
  $(SRCDIR)/alerts/bflat3.wav \
  $(SRCDIR)/alerts/bloop.wav \
  $(SRCDIR)/alerts/plunk.wav \
  $(SRCDIR)/chat.js \
  $(SRCDIR)/ci_edit.js \
  $(SRCDIR)/copybtn.js \
  $(SRCDIR)/default.css \
  $(SRCDIR)/diff.tcl \
  $(SRCDIR)/forum.js \
Changes to win/Makefile.msc.
551
552
553
554
555
556
557

558

559
560
561
562
563
564
565
        "$(SRCDIR)\..\skins\rounded1\footer.txt" \
        "$(SRCDIR)\..\skins\rounded1\header.txt" \
        "$(SRCDIR)\..\skins\xekri\css.txt" \
        "$(SRCDIR)\..\skins\xekri\details.txt" \
        "$(SRCDIR)\..\skins\xekri\footer.txt" \
        "$(SRCDIR)\..\skins\xekri\header.txt" \
        "$(SRCDIR)\accordion.js" \

        "$(SRCDIR)\alerts\bflat3.wav" \

        "$(SRCDIR)\alerts\plunk.wav" \
        "$(SRCDIR)\chat.js" \
        "$(SRCDIR)\ci_edit.js" \
        "$(SRCDIR)\copybtn.js" \
        "$(SRCDIR)\default.css" \
        "$(SRCDIR)\diff.tcl" \
        "$(SRCDIR)\forum.js" \







>

>







551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
        "$(SRCDIR)\..\skins\rounded1\footer.txt" \
        "$(SRCDIR)\..\skins\rounded1\header.txt" \
        "$(SRCDIR)\..\skins\xekri\css.txt" \
        "$(SRCDIR)\..\skins\xekri\details.txt" \
        "$(SRCDIR)\..\skins\xekri\footer.txt" \
        "$(SRCDIR)\..\skins\xekri\header.txt" \
        "$(SRCDIR)\accordion.js" \
        "$(SRCDIR)\alerts\bflat2.wav" \
        "$(SRCDIR)\alerts\bflat3.wav" \
        "$(SRCDIR)\alerts\bloop.wav" \
        "$(SRCDIR)\alerts\plunk.wav" \
        "$(SRCDIR)\chat.js" \
        "$(SRCDIR)\ci_edit.js" \
        "$(SRCDIR)\copybtn.js" \
        "$(SRCDIR)\default.css" \
        "$(SRCDIR)\diff.tcl" \
        "$(SRCDIR)\forum.js" \
1162
1163
1164
1165
1166
1167
1168

1169

1170
1171
1172
1173
1174
1175
1176
	echo "$(SRCDIR)\../skins/rounded1/footer.txt" >> $@
	echo "$(SRCDIR)\../skins/rounded1/header.txt" >> $@
	echo "$(SRCDIR)\../skins/xekri/css.txt" >> $@
	echo "$(SRCDIR)\../skins/xekri/details.txt" >> $@
	echo "$(SRCDIR)\../skins/xekri/footer.txt" >> $@
	echo "$(SRCDIR)\../skins/xekri/header.txt" >> $@
	echo "$(SRCDIR)\accordion.js" >> $@

	echo "$(SRCDIR)\alerts/bflat3.wav" >> $@

	echo "$(SRCDIR)\alerts/plunk.wav" >> $@
	echo "$(SRCDIR)\chat.js" >> $@
	echo "$(SRCDIR)\ci_edit.js" >> $@
	echo "$(SRCDIR)\copybtn.js" >> $@
	echo "$(SRCDIR)\default.css" >> $@
	echo "$(SRCDIR)\diff.tcl" >> $@
	echo "$(SRCDIR)\forum.js" >> $@







>

>







1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
	echo "$(SRCDIR)\../skins/rounded1/footer.txt" >> $@
	echo "$(SRCDIR)\../skins/rounded1/header.txt" >> $@
	echo "$(SRCDIR)\../skins/xekri/css.txt" >> $@
	echo "$(SRCDIR)\../skins/xekri/details.txt" >> $@
	echo "$(SRCDIR)\../skins/xekri/footer.txt" >> $@
	echo "$(SRCDIR)\../skins/xekri/header.txt" >> $@
	echo "$(SRCDIR)\accordion.js" >> $@
	echo "$(SRCDIR)\alerts/bflat2.wav" >> $@
	echo "$(SRCDIR)\alerts/bflat3.wav" >> $@
	echo "$(SRCDIR)\alerts/bloop.wav" >> $@
	echo "$(SRCDIR)\alerts/plunk.wav" >> $@
	echo "$(SRCDIR)\chat.js" >> $@
	echo "$(SRCDIR)\ci_edit.js" >> $@
	echo "$(SRCDIR)\copybtn.js" >> $@
	echo "$(SRCDIR)\default.css" >> $@
	echo "$(SRCDIR)\diff.tcl" >> $@
	echo "$(SRCDIR)\forum.js" >> $@