home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / timeslot.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  8KB  |  191 lines

  1. /***********************************************************************
  2. **      T I M E S L O T . H                                            *
  3. **                                                                     *
  4. ************************************************************************
  5. ** Copyright (C) 1996 by Microsoft Corporation                         *
  6. **                 All Rights Reserved                                 *
  7. ************************************************************************/
  8. /*
  9.  
  10.         TIMESLOT.H
  11.  
  12.         TimeSlot record object class definitions for Microsoft Guide
  13.  
  14.  
  15.  
  16. */
  17.  
  18.  
  19.  
  20. #ifndef _TIMESLOT_H_
  21. #define _TIMESLOT_H_
  22.  
  23. #include "dbsets.h"
  24.  
  25.  
  26. /*
  27.  
  28. TimeSlot objects are constructed from database records of the TimeSlot table.
  29.  
  30. The CTimeSlotRecordset class is used to select and create CTimeSlot objects
  31. from the TimeSlot table via functions in the CDatabaseRecordset parent class.
  32.  
  33. */
  34.  
  35.  
  36.  
  37. class COMMMSTVEXPORT CTimeSlotRecordset : public CDatabaseRecordset
  38. {
  39.  
  40. // This class provides TimeSlot recordset manipulation via parent functions
  41.  
  42.  
  43. virtual CString GetTableName( VOID);
  44.  
  45. virtual BOOL    SetRecordsetObject( VOID* cRecordsetObject);
  46.  
  47. public:
  48. virtual VOID*   GetRecordsetObject( VOID);
  49. virtual BOOLEAN Seek(LPCTSTR lpszComparison, CObject &coo);
  50. virtual BOOLEAN Seek(LPCTSTR lpszComparison, LONG lTimeSlotID);
  51. };
  52.  
  53.  
  54.  
  55.  
  56. class COMMMSTVEXPORT CTimeSlot : public CObject
  57. {
  58.  
  59.     friend class CTimeSlotRecordset; // generates the CTimeSlot record object
  60.  
  61.  
  62. private:
  63.  
  64.     LONG            m_lTimeSlotID;
  65.     LONG            m_lChannelID;
  66.     LONG            m_lEpisodeID;
  67.     COleDateTime    m_codtStartTime;
  68.     COleDateTime    m_codtEndTime;
  69.     LONG            m_lLength;
  70.     LONG            m_lPaymentAddress;
  71.     LONG            m_lPaymentToken;
  72.     COleDateTime    m_codtLastUpdate;
  73.     BOOL            m_bPayPerView;
  74.     BOOL            m_bClosedCaption;
  75.     BOOL            m_bStereo;
  76.     BOOL            m_bRerun;
  77.     BOOL            m_bTapeInhibited;
  78.     BOOL            m_bOtherPropertiesExist;
  79.     BOOL            m_bAlternateDataExists;
  80.     BOOL            m_bAlternateAudioExists;
  81.     LONG            m_lEnhMapID;
  82.  
  83. public:
  84.  
  85.     CTimeSlot(LONG lTimeSlotID = AFX_RFX_LONG_PSEUDO_NULL,
  86.                 LONG lChannelID = 0,
  87.                 LONG lEpisodeID = 0,
  88.                 COleDateTime codtStartTime = (DATE) 0,
  89.                 COleDateTime codtEndTime = (DATE) 0,
  90.                 LONG lLength = 0,
  91.                 LONG lPaymentAddress = -1,
  92.                 LONG lPaymentToken = 0,
  93.                 COleDateTime codtLastUpdate = (DATE) 0,
  94.                 BOOL bPayPerView = FALSE,
  95.                 BOOL bClosedCaption = FALSE,
  96.                 BOOL bStereo = FALSE,
  97.                 BOOL bRerun = FALSE,
  98.                 BOOL bTapeInhibited = FALSE,
  99.                 BOOL bOtherPropertiesExist = FALSE,
  100.                 BOOL bAlternateDataExists = FALSE,
  101.                 BOOL bAlternateAudioExists = FALSE,
  102.                 LONG lEnhMapID = 0) :
  103.                 m_lTimeSlotID(lTimeSlotID),
  104.                 m_lChannelID(lChannelID),
  105.                 m_lEpisodeID(lEpisodeID),
  106.                 m_codtStartTime(codtStartTime),
  107.                 m_codtEndTime(codtEndTime),
  108.                 m_lLength(lLength),
  109.                 m_lPaymentAddress(lPaymentAddress),
  110.                 m_lPaymentToken(lPaymentToken),
  111.                 m_codtLastUpdate(codtLastUpdate),
  112.                 m_bPayPerView(bPayPerView),
  113.                 m_bClosedCaption(bClosedCaption),
  114.                 m_bStereo(bStereo),
  115.                 m_bRerun(bRerun),
  116.                 m_bTapeInhibited(bTapeInhibited),
  117.                 m_bOtherPropertiesExist(bOtherPropertiesExist),
  118.                 m_bAlternateDataExists(bAlternateDataExists),
  119.                 m_bAlternateAudioExists(bAlternateAudioExists),
  120.                 m_lEnhMapID(lEnhMapID) { }
  121.  
  122.     ~CTimeSlot(VOID) { }
  123.  
  124.     VOID    SetChannelID( LONG lChannelID) { m_lChannelID = lChannelID; }
  125.     VOID    SetEpisodeID( LONG lEpisodeID) { m_lEpisodeID = lEpisodeID; }
  126.     VOID    SetStartTime( COleDateTime StartTime) { m_codtStartTime = StartTime; }
  127.     VOID    SetEndTime( COleDateTime EndTime) { m_codtEndTime = EndTime; }
  128.     VOID    SetLength( LONG lLength) { m_lLength = lLength; }
  129.     VOID    SetPaymentAddress( LONG lPaymentAddress) { m_lPaymentAddress = lPaymentAddress; }
  130.     VOID    SetPaymentToken( LONG lPaymentToken) { m_lPaymentToken = lPaymentToken; }
  131.     VOID    SetLastUpdate( COleDateTime LastUpdate) { m_codtLastUpdate = LastUpdate; }
  132.     VOID    SetPayPerView( BOOL bPayPerView) { m_bPayPerView = bPayPerView; }
  133.     VOID    SetClosedCaption( BOOL bClosedCaption) { m_bClosedCaption = bClosedCaption; }
  134.     VOID    SetStereo( BOOL bStereo) { m_bStereo = bStereo; }
  135.     VOID    SetRerun( BOOL bRerun) { m_bRerun = bRerun; }
  136.     VOID    SetTapeInhibited( BOOL bTapeInhibited) { m_bTapeInhibited = bTapeInhibited; }
  137.     VOID    SetOtherPropertiesExist( BOOL bOtherPropertiesExist) { m_bOtherPropertiesExist = bOtherPropertiesExist; }
  138.     VOID    SetAlternateDataExists( BOOL bAlternateDataExists) { m_bAlternateDataExists = bAlternateDataExists; }
  139.     VOID    SetAlternateAudioExists( BOOL bAlternateAudioExists) { m_bAlternateAudioExists = bAlternateAudioExists; }
  140.     VOID    SetEnhMapID( LONG lEnhMapID) { m_lEnhMapID = lEnhMapID; }
  141.  
  142.     LONG            TimeSlotID() { return m_lTimeSlotID; }
  143.     LONG            ChannelID() { return m_lChannelID; }
  144.     LONG            EpisodeID() { return m_lEpisodeID; }
  145.     COleDateTime    StartTime() { return m_codtStartTime; }
  146.     COleDateTime    EndTime() { return m_codtEndTime; }
  147.     LONG            Length() { return m_lLength; }
  148.     LONG            PaymentAddress() { return m_lPaymentAddress; }
  149.     LONG            PaymentToken() { return m_lPaymentToken; }
  150.     COleDateTime    LastUpdate() { return m_codtLastUpdate; }
  151.     BOOL               PayPerView() { return m_bPayPerView; }
  152.     BOOL               ClosedCaption() { return m_bClosedCaption; }
  153.     BOOL               Stereo() { return m_bStereo; }
  154.     BOOL               Rerun() { return m_bRerun; }
  155.     BOOL               TapeInhibited() { return m_bTapeInhibited; }
  156.     BOOL               OtherPropertiesExist() { return m_bOtherPropertiesExist; }
  157.     BOOL               AlternateDataExists() { return m_bAlternateDataExists; }
  158.     BOOL               AlternateAudioExists() { return m_bAlternateAudioExists; }
  159.     LONG            EnhMapID() { return m_lEnhMapID; }
  160. };
  161.  
  162.  
  163. // Table: TimeSlot
  164.  
  165. #define  TBL_TimeSlot  _T("[Time Slot]")
  166.  
  167. //      Field:                          Name                    Type    Size
  168.  
  169. #define FLD_TimeSlot_TimeSlotID     _T("TS Time Slot ID")    // AutoLong  4
  170. #define FLD_TimeSlot_ChannelID      _T("TS Channel ID")      // Long      4
  171. #define FLD_TimeSlot_EpisodeID      _T("TS Episode ID")      // Long      4
  172. #define FLD_TimeSlot_StartTime      _T("TS Start Time")      // Date      8
  173. #define FLD_TimeSlot_EndTime        _T("TS End Time")        // Date      8
  174. #define FLD_TimeSlot_Length         _T("TS Length")          // Long      4
  175. #define FLD_TimeSlot_PaymentAddress _T("TS Payment Address") // Long      4
  176. #define FLD_TimeSlot_PaymentToken   _T("TS Payment Token")   // Long      4
  177. #define FLD_TimeSlot_LastUpdate     _T("TS Last Update")     // Date      8
  178. #define FLD_TimeSlot_PayPerView        _T("TS Pay Per View")     // Bool      4
  179. #define FLD_TimeSlot_ClosedCaption      _T("TS Closed Caption")     // Bool      4
  180. #define FLD_TimeSlot_Stereo                _T("TS Stereo")     // Bool      4
  181. #define FLD_TimeSlot_Rerun                _T("TS Rerun")     // Bool      4
  182. #define FLD_TimeSlot_TapeInhibited      _T("TS Tape Inhibited")     // Bool      4
  183. #define FLD_TimeSlot_OtherPropertiesExist    _T("TS Other Properties Exist")     // Bool      4
  184. #define FLD_TimeSlot_AlternateDataExists    _T("TS Alternate Data Exists")     // Bool      4
  185. #define FLD_TimeSlot_AlternateAudioExists    _T("TS Alternate Audio Exists")     // Bool      4
  186. #define FLD_TimeSlot_EnhMapID        _T("TS Enhancement Mapping ID")
  187.  
  188.  
  189. #endif
  190.  
  191.