home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 1997 June / PC_Shareware-1997-06.iso / manga / mp2win95 / _setup.1 / ARGS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-01  |  1.8 KB  |  99 lines

  1. #include "all.h"
  2. #include "crc.h"
  3. #include "ibitstr.h"
  4. #include "header.h"
  5. #include "subband.h"
  6.  
  7. #include <wtypes.h>
  8.  
  9. /* A abstract class to pass values to maplay. From the Win32 API, we can only
  10.     pass one 32-bit value to a thread. This will be a pointer to a object
  11.     of this class. The Args class contains the seeking control variables
  12.     needed for both MPEG and MCI files. */
  13.  
  14. /* Added stop and done variables and functions for terminating the
  15.    threads from outside. */
  16.  
  17. class Args
  18. {
  19.     public:
  20.  
  21.     Args()
  22.    {
  23.        hWnd = NULL;
  24.        stop = FALSE;
  25.       done = FALSE;
  26.       desired_position = 0;
  27.       position_change = FALSE;
  28.    }
  29.  
  30.     virtual ~Args() {}
  31.  
  32.    void set_stop(BOOL flag) { stop = flag; }
  33.    void set_done(BOOL flag) { done = flag; }
  34.  
  35.    void set_desired_position(int32 frame)
  36.    {
  37.        desired_position = frame;
  38.    }
  39.  
  40.    void set_position_change(BOOL flag)
  41.    {
  42.        position_change = flag;
  43.    }
  44.  
  45.    int32 desired_position_query() { return(desired_position); }
  46.    BOOL  position_change_query()  { return(position_change);  }
  47.  
  48.    volatile BOOL stop_query() { return(stop); }
  49.    volatile BOOL done_query() { return(done); }
  50.  
  51.     HWND hWnd;
  52.  
  53.    private:
  54.  
  55.       volatile int32 desired_position;
  56.     volatile BOOL position_change;
  57.    volatile BOOL stop;
  58.    volatile BOOL done;
  59. };
  60.  
  61. // A class to contain arguments for maplay.
  62. class MPEG_Args : public Args
  63. {
  64. public:
  65.  
  66.     MPEG_Args()
  67.     {
  68.         stream = NULL;
  69.         MPEGheader = NULL;
  70.         phwo = NULL;
  71.       huffdec_path = NULL;
  72.         which_c = both;
  73.       }
  74.  
  75.     Ibitstream *stream;
  76.     Header *MPEGheader;
  77.     HWAVEOUT *phwo;
  78.    char *huffdec_path;
  79.     enum e_channels which_c;
  80.  
  81.     ~MPEG_Args() { }
  82. };
  83.  
  84. // A class to hold the arguments for MCI playing.
  85. class MCI_Args : public Args {
  86.  
  87. public:
  88.     MCI_Args()
  89.     {
  90.         playing = FALSE;
  91.     }
  92.  
  93.    ~MCI_Args() { }
  94.  
  95.     volatile BOOL playing;
  96. };
  97.  
  98.  
  99.