Demand.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:3k
源码类别:

DVD

开发平台:

C/C++

  1. //
  2. // (C)版权2007 深圳市键桥通讯有限公司
  3. // 
  4. // 文件名称: demand.h
  5. // 
  6. // 创建日期: 2007.03.28
  7. //
  8. // 创建人 : wangxr
  9. //
  10. // 修改人 : wangxr
  11. //
  12. // 描 述:  EPG预约实现头文件
  13. //
  14. // 版 本:1.0.0
  15. //
  16. //--------------------------------------------------------------------
  17. #include "epg.h"
  18. #include "Appltype.h"
  19. #ifndef __DEMAND_H
  20. #define __DEMAND_H
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. #include "epg.h"
  26. #include "appltype.h"
  27. //操作标记
  28. #define EDHF_OPER_FLAG "EPGF"
  29. //最大预约节目数目
  30. #define EPGD_MAX_DESUM 10
  31. //预约类型
  32. typedef enum _enum_DemandType
  33. {
  34. DT_EPG=0,
  35. DT_NVOD ,
  36. DT_MANAGE
  37. }enumDemandType;
  38. //added by yyj 2007.7.16 
  39. typedef enum _enum_DemandConflictReturnType
  40. {
  41.        DEMAND_PGM_NO_CONFLICT,
  42. DEMAND_PGM_OVERTIME,
  43. DEMAND_PGM_CONFLICT
  44. }enumDemandConflictReturnType;
  45. //预约数据链
  46. typedef   struct  _EPGDDataLink
  47. {
  48. int prgno; //节目id号,查找节目索引号
  49. int eid;
  50. USHORT mjd;//播放日期
  51. int seconds;//事件的起始秒
  52. int duration;//事件的播放时长
  53. int   edt; //事件类型
  54. /////added by yyj start 2007.6.11/////
  55. char   chlname[50];//频道名称
  56. char   date[20];//当前节目日期
  57.        char   time[20];//当前节目时间
  58. char   prgname[50];//节目名称
  59.        //////////////////////////////////
  60. struct  _EPGDDataLink *nextnode;
  61. }EPGDDataLink;
  62. //预约事件结构
  63. typedef  struct _EPGDEntLink
  64. {
  65. USHORT mjd; //播放日期 ,7天中的某一天
  66. time_t seconds;//起始秒
  67. time_t duration;//播放时长
  68. short eventid; //事件id号,在该天事件中的索引
  69. struct _EPGDEntLink  *next;
  70. }EPGDEntLink;
  71. //预约频道结构
  72. typedef struct _EPGDChlLink
  73. {
  74. enumDemandType edt;//预约类型
  75. int  ProgIndex;//节目索引
  76. EPGDEntLink *DmdEnt;
  77. struct _EPGDChlLink *next;
  78. }EPGDChlLink;
  79. //全局变量
  80. EPGDChlLink *EDTLink;
  81. //节目预约公用接口
  82. #if 0
  83. BOOL KB_AddDataLink(int prgno,int eid,USHORT mjd,int secs,int dur,int edt);
  84. #else
  85. BOOL KB_AddDataLink(EPGDDataLink *Demanddata);
  86. #endif
  87. BOOL KB_DelDataLink(USHORT mjd,int sec);
  88. void   KB_ClearDataLink(void);
  89. void  KB_DelOnTimeDmdEnt(void);
  90. BOOL KB_CheckOnlyOne(USHORT mjg,int secs,int * nManiIdx,int* nSubIdx);
  91. int   KB_GetDmdEntCount(void);
  92. BOOL KB_GetDataLink(int nItemIdx,EPGDDataLink* pdl);
  93. BOOL KB_GetDataLinkNum(UINT *num);
  94. BOOL KB_CheckOntimeDemand(int *chno,int*type,int*entid);
  95. BOOL KB_CheckDmdEnt(int nChlNo,int nent,int  nWeekCurTab,int type);
  96. int KB_AddDmdEnt(int nChlNo,int nent,int  nWeekCurTab,int Evntid,int type);
  97. int KB_DelDmdEnt(int nChlNo,int nent,int nWeekCurTab,int type);
  98. int KB_SaveDmdEnt(void);
  99. int KB_LoadDmdEnt(void);
  100. int KB_CreatDmdDataLink(void);
  101. //yyj add 2007.7.3
  102. void KB_ClearAllDmdEnt(void);
  103. //yyj add 2007.7.4
  104. BOOL KB_CheckConfilictDmdEnt(USHORT mjg,int nChlNo,int nent,int * nManiIdx,int* nSubIdx,int type);
  105. BOOL KB_DelConfilictDmdEnt(USHORT mjg,int nChlNo,int nent,int * nManiIdx,int* nSubIdx,int type);
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109. #endif