Overview
Comment: | Implement loading standard sounds, and working in sound test menu. (Free replacements for standard sounds are not yet available, though.) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
b43c838ca36496e2ebcca1384d46d8cb |
User & Date: | user on 2022-01-21 05:17:46 |
Other Links: | manifest | tags |
Context
2022-01-25
| ||
06:31 | Implement (attribute userflags) syntax, in order to access bit patterns of user flags directly in class codes (e.g. so that they can be passed to subroutines, etc). check-in: a724f44255 user: user tags: trunk | |
2022-01-21
| ||
05:17 | Implement loading standard sounds, and working in sound test menu. (Free replacements for standard sounds are not yet available, though.) check-in: b43c838ca3 user: user tags: trunk | |
2022-01-20
| ||
06:37 | Explain the "Attempt to use a nonexistent object" error when attempting to move a Sliding Door after one side has been destroyed. check-in: 1977494fc3 user: user tags: trunk | |
Changes
Modified config.doc from [6c9a4775e5] to [dfb6c74832].
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | - + + + + + + + | .audio.mmlTuning The MML tuning of the A4 note, in Hz. The default is 440 Hz, but some people do not like that tuning, so you can change it. This setting only affects 24-TET sounds, and not overtone-based sounds. .audio.mmlVolume MML volume, from 0 to 1; fractions are allowed. The default value is |
︙ |
Modified sound.c from [c480308e9b] to [8e65d6bcfc].
︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | + + | #include <string.h> #include "sqlite3.h" #include "smallxrm.h" #include "quarks.h" #include "heromesh.h" #include "cursorshapes.h" #define N_STANDARD_SOUNDS 50 typedef struct { Uint8*data; Uint32 len; // length in bytes } WaveSound; static Uint8 sound_on; static Sint16 mmlvolume=10000; |
︙ | |||
167 168 169 170 171 172 173 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | + - - + + + + | } if(!fp) return; } else { optionquery[2]=Q_standardSounds; v=xrm_get_resource(resourcedb,optionquery,optionquery,3); if(!v) return; fp=fopen(v,"r"); if(!fp) { |
︙ | |||
199 200 201 202 203 204 205 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | + + + + + + + - + + + | if(!usersounds || !user_sound_names) fatal("Allocation failed\n"); user_sound_names[i]=strdup(nam); if(!user_sound_names[i]) fatal("Allocation failed\n"); ws=usersounds+i; ws->data=0; ws->len=0; } else { for(i=0;i<N_STANDARD_SOUNDS;i++) if(!sqlite3_stricmp(nam,standard_sound_names[i])) goto found; for(i=0;i<N_MESSAGES;i++) if(!sqlite3_stricmp(nam,standard_message_names[i])) { i+=N_STANDARD_SOUNDS; goto found; } goto notfound; found: |
︙ | |||
248 249 250 251 252 253 254 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | - + | if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) { needs_amplify=1; wavevolume=strtod(v,0); } optionquery[2]=Q_mmlVolume; if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) mmlvolume=fmin(strtod(v,0)*32767.0,32767.0); if(wavevolume>0.00001) { |
︙ | |||
337 338 339 340 341 342 343 344 345 346 347 348 349 350 | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | + + + | const unsigned char*s; if(!sound_on) return; if(!v2.t && !v2.u && (mmlpos || wavesound)) return; SDL_LockAudio(); wavesound=0; mmlpos=0; switch(v1.t) { case TY_MESSAGE: v1.u+=N_STANDARD_SOUNDS; //fallthrough case TY_SOUND: if(v1.u<nstandardsounds) { wavesound=standardsounds[v1.u].data; wavelen=standardsounds[v1.u].len; } break; case TY_USOUND: |
︙ | |||
390 391 392 393 394 395 396 | 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | - + - - + + - + - + - + + - - + + + + + + + + | char buf[256]; if(main_options['T'] && main_options['v']) { if(mmltuning) printf("mmltempo=%d; mmlvolume=%d; mmltuning[96]=%d\n",(int)mmltempo,(int)mmlvolume,(int)mmltuning[96]); for(i=0;i<nusersounds;i++) printf("%d: %s (ptr=%p, len=%d bytes)\n",i,user_sound_names[i],usersounds[i].data,usersounds[i].len); fflush(stdout); } if(!screen) return; |