AccompanyView.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // AccompanyView.h
  3. // TeacherDaya
  4. //
  5. // Created by Kyle on 2021/3/9.
  6. // Copyright © 2021 DayaMusic. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSInteger, ACCOMPANYACTION) {
  10. ACCOMPANYACTION_ADDSONG, // 添加伴奏
  11. ACCOMPANYACTION_PLAYSONG, // 播放
  12. ACCOMPANYACTION_STOP, // 停止
  13. ACCOMPANYACTION_DISPLAY, // 下载状态显示
  14. ACCOMPANYACTION_CHOOSE, // 选中回调
  15. ACCOMPANYACTION_MODIFY_VOLUME, // 修改音量
  16. };
  17. typedef void(^AccompanyTargetBlock)(ACCOMPANYACTION action, NSString * _Nullable songId, NSString * _Nullable songName, BOOL isAccompany);
  18. typedef void(^AccompanyPlayAction)(ACCOMPANYACTION action, NSString * _Nullable songId, NSString * _Nullable songName, BOOL isAccompany, NSString *_Nullable songUrl);
  19. NS_ASSUME_NONNULL_BEGIN
  20. @interface AccompanyView : UIView
  21. /** 播放音量 范围0-100 */
  22. @property (nonatomic, assign) NSInteger volume;
  23. @property (nonatomic, assign) BOOL isShow;
  24. @property (nonatomic, assign) BOOL isPlaying;
  25. @property (nonatomic, strong) UIButton *playButton;
  26. @property (nonatomic, assign) BOOL hideDownloadStatus;
  27. - (void)showAccompanyView;
  28. - (void)targetAction:(AccompanyTargetBlock)callback;
  29. - (void)accompanyPlayAction:(AccompanyPlayAction)actionBlock;
  30. - (void)refreshView;
  31. - (void)refreshWithSongId:(NSString *)songId;
  32. - (void)refreshAllSongStatus;
  33. - (void)dismissAlertView;
  34. @end
  35. NS_ASSUME_NONNULL_END