home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / sound / nh10src / sbdplay.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-15  |  1.7 KB  |  69 lines

  1. #include <dos.h>
  2. #include <sbc.h>
  3. #include <bios.h>
  4. #include <sbcvoice.h>
  5. #include <stdio.h>
  6. #include <fcntl.h>
  7. #include <io.h>
  8.  
  9.  
  10. //┌───────────────────────────────────────────────────────────────────────┐//
  11. //│ MASTER LOOP                                                           │//
  12. //└───────────────────────────────────────────────────────────────────────┘//
  13. sb_disk_play (char *filename)
  14. {
  15.      ct_io_addx = 0x220 ;
  16.      if (sbc_check_card() & 4)
  17.      {
  18.         if (sbc_scan_int())
  19.         {
  20.             if ( !ctvd_init(16) )
  21.             {
  22.                  play_file (filename);
  23.                  ctvd_terminate () ;
  24.             }
  25.  else show_error (7, "Soundblaster Problem")
  26.         }
  27. else show_error (8, "Interrupt Error");
  28.     }
  29. else show_error (9, "Soundblaster not found");
  30.         return;
  31. }
  32.  
  33.  
  34. //┌───────────────────────────────────────────────────────────────────────┐//
  35. //│ MASTER LOOP                                                           │//
  36. //└───────────────────────────────────────────────────────────────────────┘//
  37. play_file (char *filename)
  38. {
  39.      int handle ;
  40.      handle = open(filename, O_RDONLY);
  41.      ctvd_speaker (1);
  42.      if (ctvd_output(handle) == NO_ERROR)
  43.      {
  44.             play_voice_in_bkgnd();
  45.             if (ctvd_drv_error()) show_error (7, "Soundblaster Problem")
  46.      }
  47.      close (handle);
  48.      return;
  49. }
  50.  
  51.  
  52.  
  53. //┌───────────────────────────────────────────────────────────────────────┐//
  54. //│ MASTER LOOP                                                           │//
  55. //└───────────────────────────────────────────────────────────────────────┘//
  56. play_voice_in_bkgnd ()
  57. {
  58.      nsigned key ;
  59.  
  60.      /* Polls for hot key while playing voice file */
  61.  
  62.      while ( ct_voice_status )
  63.      {
  64.              kbhit();
  65.          }
  66.          return;
  67. }
  68.  
  69.