home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / include / vocal.h < prev    next >
C/C++ Source or Header  |  1995-05-08  |  1KB  |  63 lines

  1. // -------- vocal.h
  2.  
  3. #ifndef VOCAL_HAND_H
  4. #define VOCAL_HAND_H
  5.  
  6. #include "hand.h"
  7. #include "media.h"
  8. #include "debug.h"
  9.  
  10. class VocalHand : public Hand  {
  11.   enum Driver {
  12.     nodriver,
  13.     digpakdriver,
  14.     ctvoicedriver
  15.   };
  16.   int curlib;
  17.   static SoundMedia sfxlib;
  18.   static Driver driver;
  19.   static unsigned *isplaying;
  20.   static unsigned port,irq;
  21.   static unsigned playing;
  22.   static void startup();
  23.   static void shutdown();
  24.   void thxplay_sound_clip(int index);
  25.   static void get_soundcard_settings();
  26.   static Driver load_digpak_driver();
  27.   static Driver load_ct_voice_driver();
  28.   static void init_driver();
  29.   static void terminate_driver();
  30.   static void set_port(unsigned port);
  31.   static void set_irq(unsigned irq);
  32.   static void set_status_flag(char* ptr);
  33.   friend class Theatrix;
  34. public:
  35.   VocalHand(Director* d=0) : Hand(d)
  36.     { }
  37.   virtual ~VocalHand() { }
  38.   void load_sfxlib(char*);
  39.   void set_sfxlib(char*);
  40.   void play_sound_clip(int index);
  41.   int sound_clip_is_playing();
  42.   void stop_sound_clip();
  43.   int get_num_clips();
  44.   int get_sound_clip_length(int index);
  45. };
  46.  
  47. inline void VocalHand::play_sound_clip(int index)
  48. {
  49.   Assert(curlib!=-1);
  50.   Assert(index>0 && index<=Media::clipcount(curlib));
  51.   thxplay_sound_clip(index);
  52. }
  53.  
  54. inline int VocalHand::get_sound_clip_length(int index)
  55. {
  56.   Assert(curlib!=-1);
  57.   MediaClip& mc = sfxlib.getclip(curlib,index-1);
  58.   return (int) mc.size;
  59. }
  60.  
  61. #endif
  62.  
  63.