BGBusinessMacro.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. //
  2. // BGBusinessMacro.h
  3. // BuguLive
  4. // Created by xfg on 16/8/3.
  5. // Copyright © 2016年 xfg. All rights reserved.
  6. // 业务宏
  7. #ifndef FWBusinessMacro_h
  8. #define FWBusinessMacro_h
  9. // 以下为大众宏(可能整个app都有用到)
  10. // SDK类型
  11. typedef NS_ENUM(NSInteger, FW_LIVESDK_TYPE)
  12. {
  13. FW_LIVESDK_TYPE_TXY = 0, // 腾讯云直播
  14. // FW_LIVESDK_TYPE_KSY = 1, // 金山云直播
  15. FW_LIVESDK_TYPE_VOICE = 2, // 语音直播
  16. };
  17. // 视频类型
  18. typedef NS_ENUM(NSInteger, FW_LIVE_TYPE)
  19. {
  20. FW_LIVE_TYPE_HOST = 0, // 直播的主播(推流)
  21. // FW_LIVE_TYPE_RELIVE = 1, // 点播(回播、回看)
  22. FW_LIVE_TYPE_AUDIENCE = 2, // 直播的观众(拉流)
  23. // FW_LIVE_TYPE_HDLIVE = 3, // 腾讯云互动直播(已废弃)
  24. FW_LIVE_TYPE_RECORD = 4, // 录制短视频
  25. };
  26. // 连麦类型
  27. typedef NS_ENUM(NSInteger, FW_MICK_TYPE)
  28. {
  29. // FW_MICK_TYPE_KSY = 1, // 金山云连麦
  30. FW_MICK_TYPE_AGORA = 2, // 声网连麦
  31. };
  32. // 当前视频状态
  33. typedef NS_ENUM(NSInteger, FW_LIVE_STATE)
  34. {
  35. FW_LIVE_STATE_OVER = 0, // 已结束
  36. FW_LIVE_STATE_ING = 1, // 正在直播
  37. FW_LIVE_STATE_BEGINING = 2, // 创建中
  38. // FW_LIVE_STATE_RELIVE = 3, // 回看
  39. };
  40. #define kWebViewTimeoutInterval 15 // webview超时时间
  41. #define kIMALoginParamUserKey @"kIMALoginParamUserKey" // 用户信息的key
  42. #define kIMAPlatform_AutoLogin_Key @"kIMAPlatform_AutoLogin_Key" // 自动登录key
  43. #define kMyCookies @"mycookies"
  44. #define kAppDoMainUrlListKey @"AppDoMainUrlListKey" // 存储app备用域名key
  45. #define kAppCurrentMainUrlKey @"AppCurrentMainUrlKey" // 存储app当前使用的域名key
  46. #define kAppVersionTimeKey @"AppVersionTimeKey" // 存储app时间版本号的key
  47. #define kFWAESKey @"kFWAESKey" // 存储app当前使用的AES加密key
  48. #define KRecordingEnd @"RecordingEnd"
  49. //==================================================================================
  50. // 以下为小众宏(可能单纯某个类用到)
  51. // 直播间宏
  52. #define kFollowBtnWidth 40 // followBtn的宽度
  53. #define kLiveStatusViewWidth 50 // LiveStatusView的宽度
  54. #define kLogoContainerViewHeight 30 // 主播头像容器视图的高度
  55. #define kSendGiftContrainerHeight 45 // 发送礼物按钮视图的容器视图高度
  56. #define COMMENT_TABLEVIEW_WIDTH kScreenW*0.65 // 普通消息容器视图宽度
  57. #define COMMENT_TABLEVIEW_HEIGHT 150 // 普通消息容器视图高度
  58. #define SEND_GIFT_ANIMATE_VIEW_WIDTH 235 // 礼物的动画视图的高度
  59. #define SEND_GIFT_ANIMATE_VIEW_HEIGHT 52 // 礼物的动画视图的高度
  60. #define kLiveTopRightNumWidth 80 // 直播间当前人气
  61. #define kShoppingHeight kScreenH-1.5*0.4*kScreenW //直播购物视图高度
  62. #define BARRAGE_VIEW_Y_1 kScreenH-kSendGiftContrainerHeight-COMMENT_TABLEVIEW_HEIGHT-15-35 - 35 -120 //弹幕视图1(底下的)的Y值
  63. #define BARRAGE_VIEW_Y_2 BARRAGE_VIEW_Y_1 - 36
  64. //弹幕视图2(上面的)的Y值
  65. #define SEND_GIFT_ANIMATE_VIEW_Y_1 BARRAGE_VIEW_Y_2 - SEND_GIFT_ANIMATE_VIEW_HEIGHT-5 //礼物的动画视图1(底下的)的Y值
  66. #define SEND_GIFT_ANIMATE_VIEW_Y_2 SEND_GIFT_ANIMATE_VIEW_Y_1-SEND_GIFT_ANIMATE_VIEW_HEIGHT //礼物的动画视图2(上面的)的Y值
  67. #define kAudienceEnteringTipViewHeight kScreenH-kSendGiftContrainerHeight-COMMENT_TABLEVIEW_HEIGHT-15-35 - 35 //观众进入提示视图的Y值·
  68. #define kOpenTipViewHeight kLogoContainerViewHeight + 70
  69. #define kLiveMessageRefreshTime 0.4 // 直播间刷新消息列表的定时器间隔时间
  70. #define kGiftViewSendedDescTime 5 // 礼物连发倒计时
  71. #define kGoodsViewDescTime 0.35 // 直播购物弹窗出现时间
  72. #define kLiveInputViewLimitLength 64 // 直播间普通、弹幕消息输入的最大长度
  73. #define kViconWidthOrHeight 13 // 认证图标的大小
  74. #define kViconWidthOrHeight2 16 // 认证图标的大小
  75. #define kViconWidthOrHeight3 20 // 认证图标的大小
  76. #define kViconWidthOrHeight4 22 // 认证图标的大小
  77. #define kFirstComeRoomRefreshTime 4 // 直播间主播刷新观众列表时间(刚进来的时候)
  78. #define kPrivateRoomRefreshTime 10 // 私密直播刷新观众列表时间
  79. #define kHostRefreshTime 20 // 直播间主播刷新观众列表时间
  80. #define kMaxWaitFirstFrameSec 1000000 // 直播间请求画面的最多次数
  81. #define kApplyMikeTime 30 // 连麦超时时间
  82. // 金山连麦
  83. #define kLinkMickXRate 0.69 // 金山连麦小窗口X坐标相对手机宽度的比例
  84. #define kLinkMickYRate 0.12 // 金山连麦小窗口Y坐标相对手机高度的比例
  85. #define kLinkMickWRate 0.28 // 金山连麦小窗口宽度相对手机宽度的比例
  86. #define kLinkMickHRate 0.28 // 金山连麦小窗口高度相对手机高度的比例
  87. // 直播间消息列表TCShowLiveMessageView的宏
  88. #define kRoomTableViewMsgKey @"kRoomTableViewMsgKey"
  89. #define kMaxMsgCount 60 // 最多显示kMaxMsgCount条消息
  90. #define kLiveMessageContentOffsetTime 4 // 当查看直播间消息列表时停留的时间
  91. // 自定义表情图片宏
  92. #define LIVE_USER_RANK_TAG @"/:rank" // 消息列表用户等级的标识
  93. #define LIVE_MSG_TAG @"/:zdy" // 消息列表中末尾图片的标识(目前是表情)
  94. #define LIVE_MSG_TAG2 @"/:zdyimg" // 消息列表中末尾图片的标识(暂时用到的是点亮)
  95. // 礼物动画页面的tag
  96. // 飞机1
  97. #define kPlane1Tag 1001
  98. #define kPlane1TypeStr @"plane1"
  99. // 飞机2
  100. #define kPlane2Tag 1002
  101. #define kPlane2TypeStr @"plane2"
  102. // 法拉利
  103. #define kFerrariTag 1003
  104. #define kFerrariTypeStr @"ferrari"
  105. // 兰博基尼
  106. #define kLambohiniTag 1004
  107. #define kLambohiniTypeStr @"lamborghini"
  108. // 火箭
  109. #define kRocket1Tag 1005
  110. #define kRocket1TypeStr @"rocket1"
  111. // 连麦相关
  112. #define kTCShowMultiViewHeight (kScreenH-kLogoContainerViewHeight-25-20-50-kDefaultMargin) //CShowMultiView总的高度 = 屏幕高度减去TCShowLiveTopView的最大Y值,再减去TCShowLiveBottomView高度和kDefaultMargin
  113. #define kTCShowMultiSubViewScale 0.7 //TCShowMultiSubView的宽、高比
  114. #define kTCShowMultiSubViewHeight (kTCShowMultiViewHeight-kDefaultMargin*2)/3 //TCShowMultiSubView的高度
  115. #define kTCShowMultiSubViewSize CGSizeMake(kTCShowMultiSubViewHeight/kTCShowMultiSubViewScale, kTCShowMultiSubViewHeight)
  116. // 游戏相关
  117. #define pokerW ([UIScreen mainScreen].bounds.size.width - 4 * 10) / 3
  118. #define kTexasSmallWidth kTexasPokerWidth*5.0/3.0
  119. #define KtexasBigWidth kTexasPokerWidth*11.0/3.0
  120. #define kGuessSizeViewHeight kScreenW/375.0*199.0
  121. #define kGuessSizeButtomHeight kGuessSizeViewHeight*78.0/427.0
  122. #define kPokerW PokerW() // 炸金花扑克视图宽度
  123. static __inline__ CGFloat PokerW(void)
  124. {
  125. CGFloat width = pokerW/(2.0/3.0+2.0/3.0+1);
  126. return width;
  127. }
  128. #define kPokerH PokerH() // 炸金花扑克视图高度
  129. static __inline__ CGFloat PokerH(void)
  130. {
  131. CGFloat width = pokerW/(2.0/3.0+2.0/3.0+1);
  132. CGFloat pokHeight = width*209/160;
  133. return pokHeight;
  134. }
  135. #define kBullPokerW BullPokerW() // 斗牛扑克视图宽度
  136. static __inline__ CGFloat BullPokerW()
  137. {
  138. CGFloat width = pokerW/(4*1.0/3.0+1);
  139. return width;
  140. }
  141. #define kBullPokerH BullPokerH() // 斗牛扑克视图宽度
  142. static __inline__ CGFloat BullPokerH()
  143. {
  144. CGFloat height = kBullPokerW * 209/160;
  145. return height;
  146. }
  147. #define kTexasPokerW TexasPokerW() // 斗牛扑克视图宽度
  148. static __inline__ CGFloat TexasPoker()
  149. {
  150. CGFloat width = pokerW/(4*1.0/3.0+1);
  151. return width;
  152. }
  153. #define kTexasPokerH TexasPokerH() // 斗牛扑克视图宽度
  154. static __inline__ CGFloat TexasPokerH()
  155. {
  156. CGFloat height = kBullPokerW * 209/160;
  157. return height;
  158. }
  159. #define kTexasPokerWidth TexasPokerWidth() // 炸金花扑克视图宽度
  160. static __inline__ CGFloat TexasPokerWidth()
  161. {
  162. CGFloat width = ([UIScreen mainScreen].bounds.size.width - 4 * 10)/7.0-1;
  163. return width;
  164. }
  165. //=============================枚举=========================================
  166. #pragma mark 个人中心
  167. typedef NS_ENUM(NSInteger, MPersonCenterSections)
  168. {
  169. //
  170. //
  171. MPCMySmallShop, //我的小店
  172. MPCInviteUser, //邀请赚钱
  173. MPCRenZhenSection, //主播认证
  174. MPCIncomeSection, //分享收益
  175. MPCContributeSection, //贡献榜
  176. MPCSZJLSection, //直播间收支记录
  177. MPCSetSection, //设置
  178. MPCSetInvateCode, //邀请码
  179. MPCAcountSection, //账户
  180. MPBGSHOP,
  181. MPGuiZu, //贵族
  182. MPCarBuy, //座驾
  183. MPCVIPSection, //VIP会员
  184. MPCLuckNumber, //VIP会员
  185. MPCexchangeCoinsSection, //兑换游戏币
  186. MPCOutPutSection, //送出
  187. MPCGradeSection, //等级
  188. MPCLiveHostCenter, //主播中心
  189. MPCShareISection, //分享收益
  190. MPCGameSISection, //游戏分享收益
  191. MPCGoodsMSection, //商品管理
  192. MPCMyOrderSection, //我的订单
  193. MPCOrderMSection, //订单管理
  194. MPCShopCartSection, //我的购物车
  195. MPCMyAutionSection, //我的竞拍
  196. MPCAutionMSection, //竞拍管理
  197. MPCMyLitteShopSection, //我的小店
  198. MPCFamilySection, //我的公会
  199. MPCTradeSection, //我的公会
  200. MPCMyInfoSection, //我的主页
  201. MPCMyEditSection, //我的编辑页
  202. MPCMyVideoSection, //小视频
  203. MPPTableCCount,
  204. };
  205. #define kPKChangeToPunish @"kPKChangeToPunish"
  206. #endif /* FWBusinessMacro_h */