OCBarrageRenderView.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // OCBarrageContentView.h
  3. // TestApp
  4. //
  5. // Created by QMTV on 2017/8/22.
  6. // Copyright © 2017年 LFC. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "OCBarrageCell.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. typedef NS_ENUM(NSInteger, OCBarrageRenderStatus) {
  12. OCBarrageRenderStoped = 0,
  13. OCBarrageRenderStarted,
  14. OCBarrageRenderPaused
  15. };
  16. @interface OCBarrageRenderView : UIView <CAAnimationDelegate> {
  17. NSMutableArray<OCBarrageCell *> *_animatingCells;
  18. NSMutableArray<OCBarrageCell *> *_idleCells;
  19. dispatch_semaphore_t _animatingCellsLock;
  20. dispatch_semaphore_t _idleCellsLock;
  21. dispatch_semaphore_t _trackInfoLock;
  22. OCBarrageCell *_lastestCell;
  23. UIView *_lowPositionView;
  24. UIView *_middlePositionView;
  25. UIView *_highPositionView;
  26. UIView *_veryHighPositionView;
  27. BOOL _autoClear;
  28. OCBarrageRenderStatus _renderStatus;
  29. NSMutableDictionary *_trackNextAvailableTime;
  30. }
  31. @property (nonatomic, strong, readonly) NSMutableArray<OCBarrageCell *> *animatingCells;
  32. @property (nonatomic, strong, readonly) NSMutableArray<OCBarrageCell *> *idleCells;
  33. @property (nonatomic, assign) OCBarrageRenderPositionStyle renderPositionStyle;
  34. @property (nonatomic, assign, readonly) OCBarrageRenderStatus renderStatus;
  35. - (nullable OCBarrageCell *)dequeueReusableCellWithClass:(Class)barrageCellClass;
  36. - (void)fireBarrageCell:(OCBarrageCell *)barrageCell;
  37. - (void)start;
  38. - (void)pause;
  39. - (void)resume;
  40. - (void)stop;
  41. @end
  42. NS_ASSUME_NONNULL_END